repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
hannorein/rebound
ipython_examples/ScreenshotsAndMoviesWithWebGL.ipynb
gpl-3.0
import rebound sim = rebound.Simulation() sim.add(m=1) # add a star for i in range(10): sim.add(m=1e-3,a=0.4+0.1*i,inc=0.03*i,omega=5.*i) # Jupiter mass planets on close orbits sim.move_to_com() # Move to the centre of mass frame w = sim.getWidget() w """ Explanation: Screenshots and Movies with WebGL One can use...
NirantK/deep-learning-practice
04-InitSeqtoSeq/dlnd_language_translation.ipynb
apache-2.0
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
yy/dviz-course
m09-estimation/m09-lab.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import seaborn as sns import altair as alt import pandas as pd import scipy.stats as ss import statsmodels """ Explanation: Module 9: Estimation End of explanation """ import vega_datasets movies = vega_datasets.data.movies() movies.head() vega_datasets.__version_...
LFPy/LFPy
examples/LFPy-example-09.ipynb
gpl-3.0
# importing some modules, setting some matplotlib values for pl.plot. import LFPy import numpy as np import matplotlib.pyplot as plt plt.rcParams.update({'font.size' : 12, 'figure.facecolor' : '1', 'figure.subplot.wspace' : 0.5, 'figure.subplot.hspace' : 0...
armgilles/presentation
EPSI/I4/Business Intellgence/EP4/premier_pas_algo_titanic.ipynb
mit
# Importer les lib python import pandas as pd """ Explanation: On va débuter step by step Inscription et récupération des données : Aller sur le site Kaggle et inscrivez-vous Ensuite aller sur le contest du Titanic Télécharger les données train.csv et test.csv dans l'onglet data Mettez ces données dans un répertoire ...
uber/pyro
tutorial/source/ekf.ipynb
apache-2.0
import os import math import torch import pyro import pyro.distributions as dist from pyro.infer.autoguide import AutoDelta from pyro.optim import Adam from pyro.infer import SVI, Trace_ELBO, config_enumerate from pyro.contrib.tracking.extended_kalman_filter import EKFState from pyro.contrib.tracking.distributions imp...
fastai/fastai
nbs/examples/migrating_lightning.ipynb
apache-2.0
from migrating_lightning import * from fastai.vision.all import * """ Explanation: Tutorial - Migrating from Lightning Incrementally adding fastai goodness to your Lightning training We're going to use the MNIST training code from Lightning's 'Quick Start' (as at August 2020), converted to a module. Note: The sour...
civisanalytics/civis-python
examples/PythonAPIClientDemo.ipynb
bsd-3-clause
print(f"Using Civis Python API Client version {civis.__version__}.") """ Explanation: The Civis Python API Client Stephen Hoover, Lead Data Scientist<br> August 2017 Civis Platform provides you with a Data Science API which gives you direct access to Civis Platform's cloud-based infrastructure, data science tools, an...
hhain/sdap17
notebooks/henrik_ueb02/Mustererkennung_in_Funkmessdaten.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pprint as pp hdfs = pd.HDFStore("../../data/raw/henrik/TestMessungen_NEU.hdf") hdfs.keys """ Explanation: Mustererkennung in Funkmessdaten Aufgabe 1: Laden der Datenbank in Jupyter Notebook End of e...
statkclee/ThinkStats2
code/chap07soln-kor.ipynb
gpl-3.0
%matplotlib inline from __future__ import print_function import math import first import chap07soln import thinkstats2 import thinkplot import numpy as np """ Explanation: 통계적 사고 (2판) 연습문제 (thinkstats2.com, think-stat.xwmooc.org)<br> Allen Downey / 이광춘(xwMOOC) End of explanation """ def ScatterPlot(ages, weights, a...
googledatalab/notebooks
tutorials/Stackdriver Monitoring/Group metrics.ipynb
apache-2.0
# set_datalab_project_id('my-project-id') """ Explanation: Look at metric data based on Stackdriver groups In this tutorial, we see how to look at the group structure in a project, and how to use groups to filter and aggregate metric data. For this tutorial to execute completely, you need to have: * a Stackdriver acco...
csaladenes/csaladenes.github.io
present/mcc2/PythonDataScienceHandbook/05.04-Feature-Engineering.ipynb
mit
data = [ {'price': 850000, 'rooms': 4, 'neighborhood': 'Queen Anne'}, {'price': 700000, 'rooms': 3, 'neighborhood': 'Fremont'}, {'price': 650000, 'rooms': 3, 'neighborhood': 'Wallingford'}, {'price': 600000, 'rooms': 2, 'neighborhood': 'Fremont'} ] """ Explanation: <!--BOOK_INFORMATION--> <img align="l...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/pipelines/automl_tabular_classification_beans.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform[full] $USER_FLAG """ Explanation: Vertex AI Pipelines: AutoML Tabular pipelines using google-cloud-pipeline-components <tab...
tianchuanting/Udacity
P2/P2.ipynb
mit
%pylab inline import pandas as pd import matplotlib.pylab as plt import seaborn as sns import statsmodels.api as sm # read the data and inspect titanic = pd.read_csv('titanic-data.csv') print titanic.info() titanic.head() # drop those columns we are not interested in. titanic.drop(["Name", "Ticket", "Cabin", "Embarke...
hparik11/Deep-Learning-Nanodegree-Foundation-Repository
sentiment-rnn/.ipynb_checkpoints/Sentiment_RNN_Solution-checkpoint.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
scoaste/showcase
machine-learning/regression/week-4-ridge-regression-assignment-2-completed.ipynb
mit
import graphlab """ Explanation: Regression Week 4: Ridge Regression (gradient descent) In this notebook, you will implement ridge regression via gradient descent. You will: * Convert an SFrame into a Numpy array * Write a Numpy function to compute the derivative of the regression weights with respect to a single feat...
OliverEvans96/rte_matrix
gen_matrices/Diagonal Dominance.ipynb
gpl-3.0
# Check to see whether sum of scattering coefs. = 2 # nth = number of theta values # kk = integer index num. of theta to diff other angles wrt. def check_scat_sum(nth,kk): th_un, ww_un = leg.leggauss(nth) th_vals = pi * (th_un + 1) weights = pi * ww_un th = th_vals[kk] thp = th_vals[th_vals!=th...
feststelltaste/software-analytics
courses/python_pandas_basics/session0/SchnupperkursDataScienceCDR.ipynb
gpl-3.0
import pandas as pd """ Explanation: Einführung Willkommen bei "Komm' wir spielen NSA!"! Dieses Notebook ist eine kleine Einführung in die Data Science Welt mit Python, dem Notebook-System Jupyter, dem Datenanalyse-Framework Pandas, der Visualisierungsbibliothek "matplotlib" und der Machine-Learning-Bibliothek "scikit...
machinelearningdeveloper/lc101-kc
December 05, 2016/Covered in class.ipynb
unlicense
## List access fruit = ['cranberries', 'apples'] print(fruit[0]) ## As storage string_key_to_int_value = {'one': 1, 'two': 2} print(string_key_to_int_value) int_key_to_string_value = {1: 'one', 2: 'two'} print(int_key_to_string_value) fruit = { 'apples': 10, 'oranges': 25, 'pears': 15 } print(fruit) ...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/KMeans.ipynb
gpl-3.0
from numpy import random, array #Create fake income/age clusters for N people in k clusters def createClusteredData(N, k): random.seed(10) pointsPerCluster = float(N)/k X = [] for i in range (k): incomeCentroid = random.uniform(20000.0, 200000.0) ageCentroid = random.uniform(20.0, 70.0)...
ioos/notebooks_demos
notebooks/2017-03-21-ERDDAP_IOOS_Sensor_Map.ipynb
mit
import requests try: from urllib.parse import urlencode except ImportError: from urllib import urlencode def encode_erddap(urlbase, fname, columns, params): """ urlbase: the base string for the endpoint (e.g.: https://erddap.axiomdatascience.com/erddap/tabledap). fname: the data sour...
zingale/pyro2
presentations/pyro_intro.ipynb
bsd-3-clause
import mesh.patch as patch import mesh.boundary as bnd import numpy as np g = patch.Grid2d(16, 16, ng=2) print(g) bc = bnd.BC(xlb="periodic", xrb="periodic", ylb="reflect", yrb="outflow") print(bc) d = patch.CellCenterData2d(g) d.register_var("a", bc) d.create() print(d) """ Explanation: Introduction to Pyro Micha...
djpine/linfit
linfit.ipynb
lgpl-2.1
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # for unequal plot boxes from linfit import linfit """ Explanation: Least squares fitting using linfit.py This notebook demonstrates the function linfit, which I propose adding to the SciPy library. linfit is designed to be a ...
kylemede/DS-ML-sandbox
notebooks/.ipynb_checkpoints/Basic_DS_Udemy_notes-checkpoint.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt np.random.seed(10) dossageEffectiveness = abs(np.random.normal(5.0, 1.5, 1000)) repurchaseRate = (dossageEffectiveness + np.random.normal(0, 0.1, 1000)) * 3 repurchaseRate/=np.max(repurchaseRate) plt.scatter(dossageEffectiveness, repurchaseRate) plt...
sdpython/ensae_teaching_cs
_doc/notebooks/data/data_irep.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: IREP: registre des émissions polluantes Ce jeu de données est disponible sous le nombre Registre des émissions polluantes. End of explanation """ from ensae_teaching_cs.data import load_irep load_irep() import panda...
QinetiQ-datascience/Docker-Data-Science
WooWeb-Presentation/Workspace/Widgets/Using Interact.ipynb
mit
from __future__ import print_function from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets """ Explanation: Using Interact The interact function (ipywidgets.interact) automatically creates user interface (UI) controls for exploring code and data interactively. It is the eas...
bjshaw/phys202-2015-work
assignments/assignment10/ODEsEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def lorentz_derivs(yvec, t, sigma, rho, beta): """Compute the the de...
claudiuskerth/PhDthesis
Data_analysis/SNP-indel-calling/dadi/02_dadi_1D_two_epoch.ipynb
mit
from ipyparallel import Client cl = Client() cl.ids # clear the namespace in engines cl.clear() %px %who %%px --local # run whole cell on all engines a well as in the local IPython session import numpy as np import sys sys.path.insert(0, '/home/claudius/Downloads/dadi') import dadi """ Explanation: Table of ...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/03_tensorflow/c_dataset.ipynb
apache-2.0
from google.cloud import bigquery import tensorflow as tf import numpy as np import shutil print(tf.__version__) """ Explanation: <h1> 2c. Loading large datasets progressively with the tf.data.Dataset </h1> In this notebook, we continue reading the same small dataset, but refactor our ML pipeline in two small, but si...
ewulczyn/talk_page_abuse
src/analysis/Ellery Characterizing Attackers.ipynb
apache-2.0
t = 0.5 df_first_attack = df_diffs['2015'].query('pred_recipient_score>=%s' % t).sort('rev_timestamp')\ .assign(timestamp = lambda x: x.rev_timestamp)\ .groupby(['user_text'], as_index=False).first()[['user_text', 'timestamp']] df_counts = df_diffs['2015'].merge(df_first_a...
samuelsinayoko/kaggle-housing-prices
ols/data_exploration_numerical_features.ipynb
mit
target = pd.read_csv('../data/train_target.csv') target.describe() """ Explanation: Sale price distribution First step is to look at the target sale price for the training data set, i.e. the column we're trying to predict. End of explanation """ target = target / 1000 sns.distplot(target); plt.title('SalePrice') ...
andrew-lundgren/detchar
Notebooks/gaussian_and_lines.ipynb
gpl-3.0
sample_rate = 4096 nyquist = sample_rate/2 time_length_seconds = 512 """ Explanation: We're going to simulate data discretely sampled in time. We need to set a sample rate in Hz. The highest resolvable frequency, the Nyquist frequency, is half the sample rate. We also need to decide how long the simulated data record ...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/GPU/BasicGPU.ipynb
apache-2.0
!nvidia-smi import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) logdir = '/root/pipeline/logs/tensorflow' import numpy as np import matplotlib.pyplot as plt import datetime from tensorflow.python.framework import ops from tensorflow.python.platform import gfile from IPython...
pligor/predicting-future-product-prices
dfa/notebook/.ipynb_checkpoints/dfa_simulations-checkpoint.ipynb
agpl-3.0
import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy.signal as ss import scipy.stats as st plt.style.use('ggplot') %matplotlib inline """ Explanation: DFA robustness simulations Dominik Krzemiński End of explanation """ def calc_rms(x, scale): """ Root Mean Square in windows wit...
mommermi/Introduction-to-Python-for-Scientists
notebooks/.ipynb_checkpoints/Numpy_20161014-checkpoint.ipynb
mit
import time import math a = range(10000000) def func(a): return 1e-6*(4*a**2.) #7+1./(a+3)**3.4-(23*a)**4.2)-20 # measure how long it takes in seconds start_time = time.time() new_a = [] for val in a: new_a.append(func(val)) print time.time()-start_time, "seconds" """ Explanation: Numpy (see http://ww...
tombstone/models
research/object_detection/colab_tutorials/inference_tf2_colab.ipynb
apache-2.0
!pip install -U --pre tensorflow=="2.2.0" import os import pathlib # Clone the tensorflow models repository if it doesn't already exist if "models" in pathlib.Path.cwd().parts: while "models" in pathlib.Path.cwd().parts: os.chdir('..') elif not pathlib.Path('models').exists(): !git clone --depth 1 https://git...
halimacc/CS231n-assignments
assignment1/knn.ipynb
unlicense
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt from __future__ import print_function # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inlin...
TeamHG-Memex/eli5
notebooks/LIME and synthetic data.ipynb
mit
import numpy as np import pandas as pd from matplotlib import cm from IPython.display import HTML, display_html, display from sklearn.datasets import make_circles from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression...
google/floq-client
samples/notebooks/Floq_Client_Colab_Tutorial.ipynb
apache-2.0
#@title Copyright 2021 Floq authors, All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
jrg365/gpytorch
examples/04_Variational_and_Approximate_GPs/Approximate_GP_Objective_Functions.ipynb
mit
# Define some training data train_x = torch.linspace(0, 1, 100) train_y = torch.cos(train_x * 2 * math.pi) + torch.randn(100).mul(train_x.pow(3) * 1.) fig, ax = plt.subplots(1, 1, figsize=(5, 3)) ax.scatter(train_x, train_y, c='k', marker='.', label="Data") ax.set(xlabel="x", ylabel="y") """ Explanation: Different ob...
jakevdp/PracticalLombScargle
figures/LINEAR_Example.ipynb
bsd-3-clause
import pandas as pd def get_LINEAR_lightcurve(lcid): from astroML.datasets import fetch_LINEAR_sample LINEAR_sample = fetch_LINEAR_sample() data = pd.DataFrame(LINEAR_sample[lcid], columns=['t', 'mag', 'magerr']) data.to_csv('LINEAR_{0}.csv'.format(lcid), index=False) # Uncom...
maxis42/ML-DA-Coursera-Yandex-MIPT
4 Stats for data analysis/Homework/9 test correlation analysis/Test Correlation analysis.ipynb
mit
from __future__ import division import numpy as np import pandas as pd from scipy import stats from statsmodels.stats.weightstats import * from statsmodels.stats.proportion import proportion_confint %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from IPython.core.interactiveshell import In...
robertoalotufo/ia898
master/corrdemo.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import sys,os ia898path = os.path.abspath('../../') if ia898path not in sys.path: sys.path.append(ia898path) import ia898.src as ia """ Explanation: Demo Template Matching using Normalized Cross Correlation In th...
desihub/desisim
doc/nb/bgs-reference-spectra.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt import seaborn as sns import desitarget.mock.io as mockio import multiprocessing nproc = multiprocessing.cpu_count() // 2 %matplotlib inline sns.set(style='ticks', font_scale=1.4, palette='Set2') col = sns.color_palette() """ Explanation: BGS Reference ...
MissouriDSA/twitter-locale
twitter/twitter_4.ipynb
mit
# BE SURE TO RUN THIS CELL BEFORE ANY OF THE OTHER CELLS import psycopg2 import pandas as pd from skbio.diversity.alpha import shannon # query database statement = """ SELECT * FROM twitter.job WHERE description LIKE '%New York City%'; """ try: connect_str = "dbname='twitter' user='dsa_ro_user' host='dbase.dsa....
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/cmip6/models/sandbox-1/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-1', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-1 Topic: Ocean Sub-Topics: Timeste...
dhgarrette/cnn
pyexamples/tutorials/RNNs.ipynb
apache-2.0
model = Model() NUM_LAYERS=2 INPUT_DIM=50 HIDDEN_DIM=10 builder = LSTMBuilder(NUM_LAYERS, INPUT_DIM, HIDDEN_DIM, model) # or: # builder = SimpleRNNBuilder(NUM_LAYERS, INPUT_DIM, HIDDEN_DIM, model) """ Explanation: An LSTM/RNN overview: An (1-layer) RNN can be thought of as a sequence of cells, $h_1,...,h_k$, where $h_...
empiricalstateofmind/blog
content/notebooks/parallel.ipynb
mit
from IPython.parallel import Client %pylab inline """ Explanation: After speaking to a number of academics involved with Monte Carlo simulations, I realised many of them resort to creating bash scripts to run a number of python instances of simulation before writing another script to piece the data back together. It ...
zomansud/coursera
ml-regression/week-1/PhillyCrime.ipynb
mit
import graphlab """ Explanation: Fire up graphlab create End of explanation """ sales = graphlab.SFrame.read_csv('Philadelphia_Crime_Rate_noNA.csv/') sales """ Explanation: Load some house value vs. crime rate data Dataset is from Philadelphia, PA and includes average house sales price in a number of neighborhoods...
ajhenrikson/phys202-2015-work
assignments/midterm/AlgorithmsEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact """ Explanation: Algorithms Exercise 3 Imports End of explanation """ def char_probs(s): """Find the probabilities of the unique characters in the string s. Parameters ---------- ...
whitead/numerical_stats
unit_4/hw_2016/homework_4_key.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np #Question 1.1 x = np.linspace(0,3, 1000) exp1 = 0.1 * np.exp(-1.0 * x) exp2 = 1 * np.exp(-1.5 * x) exp3 = 10 * np.exp(-2 * x) plt.plot(x, exp1, label='$\lambda = 1.0$') plt.plot(x, exp2, label='$\lambda = 1.5$') plt.plot(x, exp3, label='$\lambda = ...
bashtage/statsmodels
examples/notebooks/plots_boxplots.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm """ Explanation: Box Plots The following illustrates some options for the boxplot in statsmodels. These include violin_plot and bean_plot. End of explanation """ data = sm.datasets.anes96.load_pandas() party_ID = np.a...
fastai/course-v3
nbs/dl2/devise.ipynb
apache-2.0
path = Config().data_path()/'imagenet' """ Explanation: Data End of explanation """ src = (ImageList.from_folder(path) .split_by_folder() .label_from_folder()) data = src.presize(size=224).databunch(bs=256).normalize(imagenet_stats) """ Explanation: Inputs: precomputed activations We will build...
kradams/MIDS-W261-2015-Adams
week01/quiz/MIDS-W261-2015-QUIZ-Week01-Adams.ipynb
mit
%%writefile mapper.py #!/usr/bin/python import sys import re count = 0 WORD_RE = re.compile(r"[\w']+") filename = sys.argv[2] findword = sys.argv[1] with open (filename, "r") as myfile: #Please insert your code for line in myfile.readlines(): words = WORD_RE.findall(line.lower()) for w in words:...
gboeing/urban-data-science
modules/09-spatial-analysis/lecture.ipynb
mit
import geopandas as gpd import matplotlib.pyplot as plt import numpy as np import pandas as pd import pysal as ps import seaborn as sns from scipy.stats import stats np.random.seed(0) """ Explanation: Spatial Analysis "Everything is related to everything else, but near things are more related than distant things." -W...
mediagit2016/workcamp-maschinelles-lernen-grundlagen
19-04-10-ml-workcamp/credit_data_work-10.ipynb
gpl-3.0
# hier Ihren Code einfügen und aufüühren """ Explanation: Beispiel Credit Data - Aufgabe - Klassifikation: AI, Machine Learning & Data Science Author list: Ramon Rank Die in KNIME durchgeführte Klassifikation der Kreditdaten soll mit Python umgesetzt werden. Die Zellen für die Klassifikation sind bereits vorbereitet...
nikitaswinnen/model-for-predicting-rapid-response-team-events
model/model/modeling_base.ipynb
apache-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy as sp # import datetime as datetime import cPickle as pickle %matplotlib inline plt.style.use('ggplot') from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import train_test_split, KFold...
watsonyanghx/CS231n
assignment2/FullyConnectedNets.ipynb
mit
# As usual, a bit of setup import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solver import Solver %matplotlib inline ...
Jim00000/Numerical-Analysis
3_Interpolation.ipynb
unlicense
# Import modules import sys import math import numpy as np from matplotlib import pyplot as plt from scipy import linalg """ Explanation: ★ Interpolation ★ End of explanation """ def newton_divided_diff(X, Y, n): V = {} for j in range(n): V[j, 0] = Y[j] for i in range(1,n): for j in ...
fggp/ctcsound
cookbook/06-csoundmagics.ipynb
lgpl-2.1
%load_ext csoundmagics """ Explanation: Magic Commands and Syntax highlighting for Csound Once the csoundmagic extension is installed (see the 05-installingCsoundmagics notebook), one can use the Csound magics and functions by loading the extension: End of explanation """ %%csd crossfm <CsoundSynthesizer> <CsOption...
bgroveben/python3_machine_learning_projects
learn_kaggle/deep_learning/coding_in_tensorflow_and_keras.ipynb
mit
from os.path import join hot_dog_image_dir = 'inputs/seefood/train/hot_dog' hot_dog_paths = [join(hot_dog_image_dir, filename) for filename in ['1000288.jpg', '127117.jpg']] not_hot_dog_image_dir = 'inputs/seefood/train/not_hot_dog' not_hot_dog_paths = [join(not_hot_dog_image_dir, fil...
bbfamily/abu
abupy_lecture/18-自定义裁判决策交易(ABU量化使用文档).ipynb
gpl-3.0
# 基础库导入 from __future__ import print_function from __future__ import division import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import os import sys # 使用insert 0即只使用github,避免交叉使用了pip安装的abupy,导致的版本不一致问题 sys.path.insert(0, os.path.abspath('../')) import abupy # 使用沙盒数据,目的是和书中一样的...
hadim/public_notebooks
Analysis/MSD_Analyzer/notebook.ipynb
mit
# Some classic Python modules import %matplotlib inline import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (15, 10) import pandas as pd import numpy as np from scipy import optimize """ Explanation: How to analyze particle motion with MSD (Mean Square Displacement) Note that this notebook is largely i...
amitkaps/hackermath
Module_2a_Basic_Stat_Metrics.ipynb
mit
#Import the required libraries import numpy as np import pandas as pd from datetime import datetime as dt from scipy import stats """ Explanation: Basic Metrics When we think about summarizing data, what are the metrics that we look at? In this notebook, we will look at the car dataset To read how the data was acquire...
junhwanjang/DataSchool
Lecture/14. 선형 회귀 분석/3) 레버리지와 아웃라이어.ipynb
mit
from sklearn.datasets import make_regression X0, y, coef = make_regression(n_samples=100, n_features=1, noise=20, coef=True, random_state=1) # add high-leverage points X0 = np.vstack([X0, np.array([[4],[3]])]) X = sm.add_constant(X0) y = np.hstack([y, [300, 150]]) plt.scatter(X0, y) plt.show() model = sm.OLS(pd.Data...
dafrie/lstm-load-forecasting
notebooks/6_all_features.ipynb
mit
# Model category name used throughout the subsequent analysis model_cat_id = "06" # Which features from the dataset should be loaded: # ['all', 'actual', 'entsoe', 'weather_t', 'weather_i', 'holiday', 'weekday', 'hour', 'month'] features = ['all'] # LSTM Layer configuration # ======================== # Stateful True ...
CivicTechTO/ttc_subway_times
doc/filtering_observed_arrivals.ipynb
gpl-3.0
import datetime from psycopg2 import connect import configparser import pandas as pd import pandas.io.sql as pandasql import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns import matplotlib.ticker as ticker con = connect(user='rad', database='ttc') CONFIG = configparser.ConfigParser(interpola...
seg/2016-ml-contest
esaTeam/esa_Submission01c_VALIDATION.ipynb
apache-2.0
# Import from __future__ import division get_ipython().magic(u'matplotlib inline') import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['figure.figsize'] = (20.0, 10.0) inline_rc = dict(mpl.rcParams) from classification_utilities import make_facies_log_plot import pandas as pd import numpy as np impo...
Kaggle/learntools
notebooks/python/raw/tut_3.ipynb
apache-2.0
x = True print(x) print(type(x)) """ Explanation: Booleans Python has a type of variable called bool. It has two possible values: True and False. End of explanation """ def can_run_for_president(age): """Can someone of the given age run for president in the US?""" # The US Constitution says you must be at le...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/explanations/ai-explanations-tabnet-algorithm.ipynb
apache-2.0
PROJECT_ID = "[<your-project-id>]" """ Explanation: TabNet: Attentive Interpretable Tabular Learning <table align="left"> <td> <a href="https://colab.research.google.com/github/GoogleCloudPlatform/ml-on-gcp/blob/master/tutorials/explanations/ai-explanations-tabnet-algorithm.ipynb"> <img src="https://cloud....
jrbourbeau/cr-composition
notebooks/anisotropy_random_trials.ipynb
mit
%load_ext watermark %watermark -u -d -v -p numpy,matplotlib,scipy,pandas,sklearn,mlxtend """ Explanation: <a id='top'> </a> End of explanation """ %matplotlib inline from __future__ import division, print_function from collections import defaultdict import os import numpy as np import pandas as pd import matplotlib....
josePhoenix/wfirst-tools
notebooks/Pandeia-WFIRST Imaging.ipynb
bsd-3-clause
%matplotlib inline %config InlineBackend.figure_format = 'svg' import sys import os import numpy as np import matplotlib from matplotlib import style style.use('ggplot') # see http://matplotlib.org/users/style_sheets.html # for info on matplotlib styles matplotlib.rcParams['axes.grid'] = False mat...
quantopian/research_public
notebooks/lectures/Fundamental_Factor_Models/notebook.ipynb
apache-2.0
import pandas as pd import numpy as np from quantopian.pipeline import Pipeline from quantopian.pipeline.data import Fundamentals from quantopian.pipeline.factors import CustomFactor, Returns, Latest from quantopian.pipeline.classifiers import Classifier from quantopian.pipeline.filters import QTradableStocksUS from qu...
jasontlam/snorkel
tutorials/workshop/Workshop_4_Discriminative_Model_Training.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import os import numpy as np # Connect to the database backend and initalize a Snorkel session from lib.init import * from snorkel.annotations import load_marginals from snorkel.models import candidate_subclass Spouse = candidate_subclass('Spouse', ['person1', 'pe...
ahmadpgh/deepSimDEF
data/sequence_homology_data_prepration.ipynb
mit
import pandas as pd import numpy as np import os import requests import easydict import linecache import pprint import random pp = pprint.PrettyPrinter(indent=4) """ Explanation: Sequence Homology Data Prepration<a id='top'></a> Sections:<br> 0) Description<br> 1) BLAST<br> 2) Importing Modules and Packages<br> 3) Co...
opalytics/opalytics-ticdat
examples/expert_section/notebooks/pandas_and_ticdat_2.ipynb
bsd-2-clause
from diet import input_schema dat = input_schema.sql.create_tic_dat_from_sql("diet_sample_data.sql") dat.nutrition_quantities pan_dat = input_schema.copy_to_pandas(dat) pan_dat.nutrition_quantities {pan_dat.nutrition_quantities.__class__, pan_dat.categories.__class__, pan_dat.foods.__class__} """ Explanation: pand...
rashikaranpuria/Machine-Learning-Specialization
Regression/Assignment_two/week-2-multiple-regression-assignment-2-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 2: Multiple Regression (gradient descent) In the first notebook we explored multiple regression using graphlab create. Now we will use graphlab along with numpy to solve for the regression weights with gradient descent. In this notebook we will cover estimating multiple...
GoogleCloudPlatform/tensorflow-without-a-phd
tensorflow-rnn-tutorial/old-school-tensorflow/tutorial/02_RNN_generator_temperatures_playground.ipynb
apache-2.0
import math import sys import time import numpy as np import utils_batching import utils_args import tensorflow as tf from tensorflow.python.lib.io import file_io as gfile print("Tensorflow version: " + tf.__version__) from matplotlib import pyplot as plt import utils_prettystyle import utils_display """ Explanation:...
wikistat/Intro-Python
Cal3-PythonGraphes.ipynb
mit
%matplotlib inline """ Explanation: <center> <a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:left; max-width: 120px; display: inline" alt="INSA"/></a> <a href="http://wikistat.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/...
JaggedParadigm/pairplotr
.ipynb_checkpoints/pairplotr_demo-checkpoint.ipynb
apache-2.0
%matplotlib inline import sys import pairplotr.pairplotr as ppr import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: Pairplotr introduction Here I introduce pairplotr, a tool I developed to do pairwise plots of features, including mixtures of numerical and categorical ones, starti...
ES-DOC/esdoc-jupyterhub
notebooks/cccr-iitm/cmip6/models/sandbox-2/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cccr-iitm', 'sandbox-2', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: CCCR-IITM Source ID: SANDBOX-2 Topic: Ocean Sub-Topics: Timestepping Framework,...
StudyExchange/Udacity
MachineLearning(Advanced)/p5_image_classification/image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' class DLProgress(tqdm): last_block = 0 def hoo...
boffi/boffi.github.io
dati_2020/01/half_power_estimation.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from jupyterthemes import jtplot ; jtplot.style() np.random.seed(1969-7-20) """ Explanation: Half Power Estimation of $\zeta$ End of explanation """ N = 51 b = np.linspace(0.5, 1.5, N) + (np.random.random(N)-0.5)/100 z = 0.035 D = 1/np.sqrt((1-b*...
calebmadrigal/insurance-plan-analysis
fireeye-insurance-individual-2015.ipynb
mit
%matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt class Plan: def __init__(self): pass # Plan 1 = Cigna HDHP/HSA p1 = Plan() p1.family_deductible = 2000.00 # Same deductible for both family and individual p1.individual_deductible = 2000.00 p1.family_oopmax = 3000.00 ...
Dioptas/pymatgen
examples/Basic functionality.ipynb
mit
import pymatgen as mg """ Explanation: Introduction This notebook demostrates the core functionality of pymatgen, including the core objects representing Elements, Species, Lattices, and Structures. By convention, we import pymatgen as mg. End of explanation """ si = mg.Element("Si") print("Atomic mass of Si is {}"...
pmorissette/bt
examples/Strategy_Combination.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import ffn import bt """ Explanation: This notebook creates a parent strategy(combined) with 2 child strategies(Equal Weight, Inv Vol). Alternatively, it creates the 2 child strategies, runs the backtest, combines the results, and creates a paren...
subutai/htmresearch
projects/l2_pooling/notebooks/similar_objects.ipynb
agpl-3.0
import itertools import random from htmresearch.algorithms.column_pooler import ColumnPooler INPUT_SIZE = 10000 def createFeatureLocationPool(size=10): duplicateFound = False for _ in xrange(5): candidateFeatureLocations = [frozenset(random.sample(xrange(INPUT_SIZE), 40)) ...
rusucosmin/courses
ml/ex01/npprimer.ipynb
mit
# Useful starting lines %matplotlib inline import numpy as np import matplotlib.pyplot as plt %load_ext autoreload %autoreload 2 """ Explanation: Welcome to the jupyter notebook! To run any cell, press Shift+Enter or Ctrl+Enter. IMPORTANT : Please have a look at Help-&gt;User Interface Tour and Help-&gt;Keyboard Short...
oscar6echo/ezhc
demo_ezhc_themes_and_global_options.ipynb
mit
th = hc.Theme() th.info() """ Explanation: Themes Directly available in ezhc End of explanation """ hc_global = hc.GlobalOptions({'lang': {'decimalPoint': '.', 'thousandsSep': ','}}) hc_global.inject(verbose=True) """ Explanation: Global Options Can be accessed through the GlobalOptions class See the Highcharts d...
gaufung/PythonStandardLibrary
DataCompression/tarfile.ipynb
mit
import tarfile for filename in ['zlib_server.py', 'example.tar', 'tarfile.ipynb', 'notthere.tar']: try: print('{:>15} {}'.format(filename, tarfile.is_tarfile( filename))) except IOError as err: print('{:>15} {}'.format(filename, err)) """ Explanation: The tarfile...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/commands/linux.ipynb
mit
!df -h """ Explanation: This notebook was prepared by Donne Martin. Source and license info is on GitHub. Linux Commands Disk Usage Splitting Files Grep, Sed Compression Curl View Running Processes Terminal Syntax Highlighting Vim Disk Usage Display human-readable (-h) free disk space: End of explanation """ !du -...
dipanjank/ml
tensorflow/simple_linear_regression_tf_v2.ipynb
gpl-3.0
import tensorflow as tf %matplotlib inline from matplotlib import pyplot as plt import numpy as np """ Explanation: Simple Linear Regression in Tensorflow End of explanation """ x = np.random.rand(100, 3) w = np.array([1.0, 2.0, 3.0]) y = x @ w y.shape """ Explanation: First we make some test data for 100 observa...
AWPorter/aima-python
learning.ipynb
mit
from learning import * """ Explanation: Learning This notebook serves as supporting material for topics covered in Chapter 18 - Learning from Examples , Chapter 19 - Knowledge in Learning, Chapter 20 - Learning Probabilistic Models from the book Artificial Intelligence: A Modern Approach. This notebook uses implementa...
pligor/predicting-future-product-prices
ARIMA/.ipynb_checkpoints/ShampooSales-checkpoint.ipynb
agpl-3.0
import pandas as pd from pandas import read_csv from pandas import datetime from matplotlib import pyplot as plt from pandas.plotting import autocorrelation_plot from statsmodels.tsa.arima_model import ARIMA from pandas import DataFrame from sklearn.metrics import mean_squared_error %matplotlib inline def date_parser...
mbeyeler/opencv-machine-learning
notebooks/10.03-Using-Random-Forests-for-Face-Recognition.ipynb
mit
from sklearn.datasets import fetch_olivetti_faces dataset = fetch_olivetti_faces() X = dataset.data y = dataset.target """ Explanation: <!--BOOK_INFORMATION--> <a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="wi...
jrrembert/cybernetic-organism
dato/recommendations/Song recommender.ipynb
gpl-2.0
import graphlab """ Explanation: Building a song recommender Fire up GraphLab Create End of explanation """ song_data = graphlab.SFrame('song_data.gl/') """ Explanation: Load music data End of explanation """ song_data.head() """ Explanation: Explore data Music data shows how many times a user listened to a song...
quantopian/research_public
notebooks/lectures/Futures_Trading_Considerations/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt from quantopian.research.experimental import continuous_future, history """ Explanation: Futures Trading Considerations by Maxwell Margenot and Delaney Mackenzie Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantop...
scikit-rf/scikit-rf
doc/source/tutorials/Circuit.ipynb
bsd-3-clause
import skrf as rf rf.stylely() Z_0 = 50 Z_L = 75 theta = 0 # the necessary Frequency description freq = rf.Frequency(start=1, stop=2, unit='GHz', npoints=3) # The combination of a transmission line + a load can be created # using the convenience delay_load method # important: all the Network must have the parameter ...
jbcayrou/scapy
doc/notebooks/Scapy in 15 minutes.ipynb
gpl-2.0
send(IP(dst="1.2.3.4")/TCP(dport=502, options=[("MSS", 0)])) """ Explanation: Scapy in 15 minutes (or longer) Guillaume Valadon & Pierre Lalet Scapy is a powerful Python-based interactive packet manipulation program and library. It can be used to forge or decode packets for a wide number of protocols, send them on the...
ES-DOC/esdoc-jupyterhub
notebooks/cccr-iitm/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cccr-iitm', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: CCCR-IITM Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. P...