repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
zsylvester/notebooks | grain_settling.ipynb | apache-2.0 | from math import pi
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
rop = 2650.0 # density of particle in kg/m3
rof = 1000.0 # density of fluid in kg/m3
visc = 1.002*1E-3 #8.9*1E-4 # dynamic viscosity in Pa*s (N*s/m^2)
C1 = 18 # c... |
chseifert/tutorials | nlp-ie/NLTK-Regular-Expressions.ipynb | apache-2.0 | import nltk, re
from nltk import word_tokenize
# NOTE if the data (corpora, example files) is not yet downloaded, this needs to be done first
# nltk.download()
"""
Explanation: NLTK Regular Expressions
Author: Christin Seifert, licensed under the Creative Commons Attribution 3.0 Unported License https://creativecommo... |
mjabri/holoviews | doc/Tutorials/Sampling_Data.ipynb | bsd-3-clause | from itertools import product
import numpy as np
import holoviews as hv
from IPython.display import HTML
%reload_ext holoviews.ipython
%opts Layout [fig_size=125] Points (s=50)
%opts Bounds (linewidth=2 color='k') {+axiswise} Text (fontsize=16 color='k') Image (cmap='Reds')
"""
Explanation: To explain how to select an... |
qinwf-nuan/keras-js | notebooks/layers/convolutional/Conv1D.ipynb | mit | data_in_shape = (5, 2)
conv = Conv1D(4, 3, strides=1, padding='valid', dilation_rate=1, activation='linear', use_bias=True)
layer_0 = Input(shape=data_in_shape)
layer_1 = conv(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights to random (use seed for reproducibility)
weights = []
for w in model.get... |
Neuroglycerin/neukrill-net-work | notebooks/preliminary_data_analysis/Log loss over image size.ipynb | mit | # copying imports from holdout notebook...
import pylearn2.utils
import pylearn2.config
import theano
import neukrill_net.dense_dataset
import neukrill_net.utils
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import holoviews as hl
%load_ext holoviews.ipython
import sklearn.metrics
cd ..
settin... |
eyaltrabelsi/my-notebooks | Lectures/practical_optimisations_for_pandas/EuroPython2020-Optimizing Pandas.ipynb | mit | ! pip install numba numexpr
import math
import time
import warnings
from dateutil.parser import parse
import janitor
import numpy as np
import pandas as pd
from numba import jit
from sklearn import datasets
from pandas.api.types import is_datetime64_any_dtype as is_datetime
warnings.filterwarnings("ignore", category... |
zzsza/Datascience_School | 11. 기초 확률론4 - 상관 관계/01. 결합, 주변, 조건부 확률 밀도 함수.ipynb | mit | mu = [0, 0]
cov = [[2, -1],[-1, 18]]
rv = sp.stats.multivariate_normal(mu, cov)
xx = np.linspace(-5, 5, 100)
yy = np.linspace(-5, 5, 100)
XX, YY = np.meshgrid(xx, yy)
ZZ = rv.pdf(np.dstack([XX, YY]))
plt.contour(XX, YY, ZZ)
plt.xlabel("x")
plt.ylabel("y")
plt.title("Joint Probability Density")
plt.axis("equal")
plt.sho... |
maxvogel/NetworKit-mirror2 | Doc/Notebooks/NetworKit_Tutorial_Part_3.ipynb | mit | from networkit import *
%matplotlib inline
cd ~/workspace/NetworKit
G = readGraph("input/MIT8.edgelist", Format.EdgeListTabZero)
# Code for 3-3) and 3-4)
%matplotlib inline
import matplotlib.pyplot as plt
# def avgFriendDegree(v):
count = 0 # count the number of persons whose friends have on average more friend... |
whitead/numerical_stats | unit_4/hw_2017/problem_set_3.ipynb | gpl-3.0 | sum = 0
for i in range(1,101):
sum += i
print(sum)
import numpy as np
a = np.arange(1,101)
print(np.sum(a))
"""
Explanation: Answer the following questions in Python. Do all calculations in Python. Answer each problem twice: once using a for loop with lists and once using numpy arrays (no for loops). There are tw... |
desihub/desisim | doc/nb/quickcat-calibration.ipynb | bsd-3-clause | # input merged catalog (from simulations for now)
simulation_catalog_filename="/home/guy/Projets/DESI/analysis/quickcat/20180926/zcatalog-redwood-target-truth.fits"
# output quickcat parameter file that this code will write
quickcat_param_filename="/home/guy/Projets/DESI/analysis/quickcat/20180926/quickcat.yaml"
# outp... |
tensorflow/docs-l10n | site/pt-br/tutorials/images/segmentation.ipynb | apache-2.0 | #@title 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 or agreed to in writing, software
# distributed under... |
GLiCom/CorpusAnalysis2016 | notebooks/Simple descriptive statistics.ipynb | apache-2.0 | import nltk
#nltk.download('book')
text = '''Neither a recession nor a collapse in revenue has yet been enough to convince \
Russian President Vladimir Putin that it’s time to join with OPEC and cut oil output to \
boost prices. His reasons may be pragmatic rather than political. Russia’s Energy \
Minister Alexander N... |
dpiparo/swanExamples | notebooks/SimpleFit_py.ipynb | lgpl-2.1 | import ROOT
%jsroot on
"""
Explanation: Fitting
<hr style="border-top-width: 4px; border-top-color: #34609b;">
This ROOTbook shows how to create a histogram, fill it and fit it.
Let's start importing the ROOT module, which gives us access to all ROOT classes, and activate the JSROOT visualisation.
End of explanation
... |
NGSchool2016/ngschool2016-materials | jupyter/slebedeva/NGSchool_python.ipynb | gpl-3.0 | %pylab inline
"""
Explanation: Set the matplotlib magic to notebook enable inline plots
End of explanation
"""
import subprocess
import matplotlib.pyplot as plt
import random
import numpy as np
"""
Explanation: Calculate the Nonredundant Read Fraction (NRF)
SAM format example:
SRR585264.8766235 0 1 ... |
mholtrop/Phys605 | Homework/HW4/RC_Filters_in_Python.ipynb | gpl-3.0 | # Your code here.
# Execute these startup lines so that Numpy and Matplotlib are available to you.
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: RC FILTERS
Numerically calculating the response of an RC filter network
There are two ways to compute the resonse of a circuit that ... |
dvirsamuel/MachineLearningCourses | Visual Recognision - Stanford/assignment3/.ipynb_checkpoints/LSTM_Captioning-checkpoint.ipynb | gpl-3.0 | # As usual, a bit of setup
import time, os, json
import numpy as np
import matplotlib.pyplot as plt
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.rnn_layers import *
from cs231n.captioning_solver import CaptioningSolver
from cs231n.classifiers.rnn import Captioni... |
tensorflow/docs-l10n | site/ko/addons/tutorials/tqdm_progress_bar.ipynb | apache-2.0 | #@title 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 or agreed to in writing, software
# distributed under... |
swails/mdtraj | examples/rmsd-benchmark.ipynb | lgpl-2.1 | t = md.Trajectory(xyz=np.random.randn(1000, 100, 3), topology=None)
print(t)
"""
Explanation: To benchmark the speed of the RMSD calculation, it's not really
necessary to use 'real' coordinates, so let's just generate
some random numbers from a normal distribution for the cartesian
coordinates.
End of explanation
"""
... |
slahmar/a-pokemon-study | Pokemon Analysis.ipynb | apache-2.0 | pk = pd.read_csv("../input/pokemon.csv")
pk.head()
pk.columns
"""
Explanation: Read data from the CSV file
End of explanation
"""
pk = pk[pk["capture_rate"] != "30 (Meteorite)255 (Core)"]
pk.capture_rate = pk.capture_rate.astype(np.int64)
"""
Explanation: Remove invalid data
End of explanation
"""
pk["height_m"... |
DavidObando/carnd | Term1/Labs/CarND-LeNet-Lab/LeNet-Lab.ipynb | apache-2.0 | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_validation, y_validation = mnist.validation.images, mnist.validation.labels
X_test, y_test = mnist.test.images, mn... |
sdpython/pyquickhelper | _unittests/ut_helpgen/notebooks/td2a_cenonce_session_3A.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.ml - Statistiques descriptives avec scikit-learn
ACP, CAH, régression lineaire.
End of explanation
"""
import pandas, numpy, pyensae.datasource
from sklearn.decomposition import PC... |
AlexandruValeanu/365-days-of-algorithms | Day 14 - Forward Euler.ipynb | gpl-3.0 | import math
"""
Explanation: The Forward Euler method for first order differential equations
$$$$
The Euler method (also called forward Euler method) is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value.
End of explanation
"""
def forward_euler(f, x0, y0,... |
mabevillar/rmtk | rmtk/vulnerability/mdof_to_sdof/first_mode/first_mode.ipynb | agpl-3.0 | %matplotlib inline
from rmtk.vulnerability.common import utils
from rmtk.vulnerability.mdof_to_sdof.first_mode import first_mode
pushover_file = "../../../../../rmtk_data/capacity_curves_Vb-dfloor.csv"
idealised_type = 'quadrilinear'; # 'bilinear', 'quadrilinear' or 'none'
capacity_curves = utils.read_capacity_curves... |
sanjaymeena/ProgrammingProblems | python/python-exercises.ipynb | apache-2.0 | import math
import numpy as np
import pandas as pd
import re
from operator import itemgetter, attrgetter
"""
Explanation: Python Exercises
This notebook is for programming exercises in python using :
Statistics
Inbuilt Functions and Libraries
Pandas
Numpy
End of explanation
"""
def median(dataPoints):
"comp... |
YoungKwonJo/mlxtend | docs/examples/regression__linear_regression.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
def lin_regplot(X, y, model):
plt.scatter(X, y, c='blue')
plt.plot(X, model.predict(X), color='red')
return
X = np.array([ 1, 2, 3, 4, 5])[:, np.newaxis]
y = np.array([ 1, 2, 3, 4, 5])
"""
Explanation: Ordinary Least Squares Linear Regression examples... |
simonsfoundation/CaImAn | demos/notebooks/demo_online_cnmfE.ipynb | gpl-2.0 | try:
if __IPYTHON__:
# this is used for debugging purposes only. allows to reload classes when changed
get_ipython().magic('load_ext autoreload')
get_ipython().magic('autoreload 2')
except NameError:
pass
import bokeh.plotting as bpl
import holoviews as hv
import logging
import matplotl... |
iannesbitt/ml_bootcamp | Python-for-Data-Analysis/Pandas/Groupby.ipynb | mit | import pandas as pd
# Create dataframe
data = {'Company':['GOOG','GOOG','MSFT','MSFT','FB','FB'],
'Person':['Sam','Charlie','Amy','Vanessa','Carl','Sarah'],
'Sales':[200,120,340,124,243,350]}
df = pd.DataFrame(data)
df
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Log... |
d-k-b/udacity-deep-learning | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
wanderer2/pymc3 | docs/source/notebooks/NUTS_scaling_using_ADVI.ipynb | apache-2.0 | %matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from scipy import optimize
import pandas as pd
import matplotlib.pyplot as plt
import pymc3 as pm
pd.set_option('display.mpl_style', 'default')
plt.rcParams['figure.figsize'] = 12, 4
rndst = np.random.RandomState(0)
%load_ext wa... |
weleen/mxnet | example/notebooks/tutorials/understanding_vanish_gradient.ipynb | apache-2.0 | def download(data_dir):
if not os.path.isdir(data_dir):
os.system('mkdir ' + data_dir)
os.chdir(data_dir)
if (not os.path.exists('train-images-idx3-ubyte')) or \
(not os.path.exists('train-labels-idx1-ubyte')) or \
(not os.path.exists('t10k-images-idx3-ubyte')) or \
(not os.path... |
muxiaobai/CourseExercises | python/kaggle/competition/house-price/house_price_advanced.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
"""
Explanation: 房价预测案例(进阶版)
这是进阶版的notebook。主要是为了比较几种模型框架。所以前面的特征工程部分内容,我也并没有做任何改动,重点都在后面的模型建造section
Step 1: 检视源数据集
End of explanation
"""
train_df = pd.read_csv('../input/train.csv', index_col=0)
test_df = pd.read_csv('../input/test.csv', index_col=0)
"""
Explanation: 读入数据
... |
napjon/ds-nd | p2-introds/titanic/titanic.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns; sns.set_style('darkgrid')
import numpy as np
import scipy.stats as sp
df = pd.read_csv('dataset/titanic_data.csv')
df.head()
"""
Explanation: In this article, I will try to investigate the following question,
Looking at so... |
petersaints/YanuX-Cruncher | WifiFingerprintingExperiments.ipynb | gpl-3.0 | # Python Standard Library
import getopt
import os
import sys
import math
import time
import collections
import random
# IPython
from IPython.display import display
# pandas
import pandas as pd
pd.set_option("display.max_rows", 10000)
pd.set_option("display.max_columns", 10000)
# Matplotlib
%matplotlib inline
import ... |
alfkjartan/control-computarizado | misc-notebooks/MR2007-final-exam-spring-2017.ipynb | mit | s,z,h = sy.symbols('s,z,h')
sy.apart(1/(s*(s+1)*(s-1)))
num = (0.5 * (sy.exp(h) + sy.exp(-h)) - 1)*(z+1)
den = (z**2 - (sy.exp(h) + sy.exp(-h))*z + 1)
H = num/den
print num
H.subs(h, 0.1)
"""
Explanation: Problem 1
(a)
Zero-order-hold sampling
End of explanation
"""
s,z = sy.symbols('s, z')
h = sy.symbols('h',... |
mpanteli/music-outliers | notebooks/results_classification.ipynb | mit | print "mapping..."
data_list, pcadata_list, ldadata_list, nmfdata_list, ssnmfdata_list, classlabs, audiolabs = mapper.map_and_average_frames(min_variance=0.99)
mapper.write_output(data_list, pcadata_list, ldadata_list, nmfdata_list, ssnmfdata_list, classlabs, audiolabs)
"""
Explanation: Feature learning and write outp... |
landmanbester/fundamentals_of_interferometry | 3_Positional_Astronomy/3_1_Equatorial_Coordinates.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
from IPython.display import HTML
HTML('../style/code_toggle.html')
import healpy as hp
%pylab inline
pylab.rcParams['figure.figsize'] = (15, 10)
import matplotlib
impor... |
nslatysheva/data_science_blogging | model_optimization/polished_prediction.ipynb | gpl-3.0 | import wget
import pandas as pd
# Import the dataset
data_url = 'https://raw.githubusercontent.com/nslatysheva/data_science_blogging/master/datasets/spam/spam_dataset.csv'
dataset = wget.download(data_url)
dataset = pd.read_csv(dataset, sep=",")
# Take a peak at the first few columns of the data
first_5_columns = dat... |
sclereid/epicycles | docs/Fourier_series.ipynb | gpl-3.0 | from __future__ import division
import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
"""
Explanation: Fourier Series
Try to calculate a fourier series in python
End of explanation
"""
class fourier_series :
def __init__(self, f, N, offset=0, period=2*np.pi) :
self.N = N
... |
tritemio/multispot_paper | realtime kinetics/out_notebooks/1-spot bubble-bubble kinetics - Template-out_1.ipynb | mit | measurement_id = 0
windows = (60, 180)
# Cell inserted during automated execution.
windows = (30, 180)
measurement_id = 1
"""
Explanation: Executed: Tue Mar 28 00:43:40 2017
Duration: 41 seconds.
End of explanation
"""
import time
from pathlib import Path
import pandas as pd
from scipy.stats import linregress
from ... |
johnbachman/emcee | docs/_static/notebooks/quickstart.ipynb | mit | import numpy as np
"""
Explanation: Quickstart
The easiest way to get started with using emcee is to use it for a project. To get you started, here’s an annotated, fully-functional example that demonstrates a standard usage pattern.
How to sample a multi-dimensional Gaussian
We’re going to demonstrate how you might dr... |
tensorflow/examples | courses/udacity_intro_to_tensorflow_for_deep_learning/l08c02_naive_forecasting.ipynb | apache-2.0 | #@title 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 or agreed to in writing, software
# distributed under... |
zklgame/CatEyeNets | test/features.ipynb | mit | import os
os.chdir(os.getcwd() + '/..')
# Run some setup code for this notebook
import random
import numpy as np
import matplotlib.pyplot as plt
from utils.data_utils import load_CIFAR10
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = ... |
iamfullofspam/hep_ml | notebooks/sPlot.ipynb | apache-2.0 | import numpy
from matplotlib import pyplot as plt
size = 10000
sig_data = numpy.random.normal(-1, 1, size=size)
bck_data = numpy.random.normal(1, 1, size=size)
"""
Explanation: sPlot
This notebook explains sPlot and how to use hep_ml.splot.
sPlot is a way to reconstruct features of mixture components based on known p... |
ejm553/NUREU17 | LSST/SuperNovaLightCurves/Fit_Errors.ipynb | mit | #Create new supernovae object
SN = Supernovae('../../../OSC_data/JSON_data/sne-2010-2014-master/Gaia14adz.json')
#Load in lightcurve data
SN.load_LightCurves()
"""
Explanation: Adam, the reason Kapernka and Bazin both had less values was that I was restricting only those two fits to 6 or more data points, . If they ... |
dwhswenson/openpathsampling | examples/tests/test_pyemma.ipynb | mit | from __future__ import print_function
import openpathsampling as paths
import numpy as np
# NBVAL_IGNORE_OUTPUT
import pyemma.coordinates as coor
# NBVAL_IGNORE_OUTPUT
ref_storage = paths.Storage('engine_store_test.nc', mode='r')
# NBVAL_IGNORE_OUTPUT
storage = paths.Storage('delete.nc', 'w')
storage.trajectories.s... |
oyamad/theory16 | lemke_howson/lemke_howson_py.ipynb | mit | import numpy as np
np.set_printoptions(precision=5) # Reduce the number of digits printed
A = np.array([[3, 3],
[2, 5],
[0 ,6]])
B_T = np.array([[3, 2, 3],
[2, 6, 1]])
m, n = A.shape # Numbers of actions of the players
"""
Explanation: Implementing Lemke-Howson in Pytho... |
wikistat/Ateliers-Big-Data | MNIST/Atelier-scikit_learn-MNIST.ipynb | mit | # Graphiques dans la fenêtre
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
"""
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; dis... |
facundoq/toys | pca/PCA for reconstruction.ipynb | agpl-3.0 | #mean and std of multivariate normal dist to generate samples
mu=np.array([5,0,-2])
σ=np.array([[9,1, -1],
[1, 3, -2],
[-1, -2,2],])
if not is_covariance(σ):
print("Warning: σ is not a valid covariance matrix (not symmetric or positive definite)")
n=1000 # number of samples
x=np.random.mult... |
walkon302/CDIPS_Recommender | notebooks/Feature_Weights.ipynb | apache-2.0 | import sys
import os
sys.path.append(os.getcwd()+'/../')
# sklearn
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import permutation_test_score
# other
import numpy as np
import glob
import pandas as pd
import ntpath
# plotting
import seaborn as sns
import matplotlib... |
phoebe-project/phoebe2-docs | development/examples/minimal_GPs.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
import matplotlib.pyplot as plt
plt.rc('font', family='serif', size=14, serif='STIXGeneral')
plt.rc('mathtext', fontset='stix')
import phoebe
import numpy as np
logger = phoebe.logger('warning')
# we'll set the random seed so that the noise model is reproducible
np.random.seed(1... |
trungnt13/uef-summerschool2017 | friday_speech_challenge/Fundamentals.ipynb | mit | import pyaudio
import wave
"""
Explanation: Fundamentals of audio and music analysis
Open source libraries
Python
librosa (ISC / MIT licensed)
pyaudio (MIT licensed)
portaudio
Prepare sound for analysis
NOTE: Either record your own voice or import a sample from file
End of explanation
"""
# In this step, find o... |
sjsrey/pysal | notebooks/explore/spaghetti/Network_Usage.ipynb | bsd-3-clause | import os
last_modified = None
if os.name == "posix":
last_modified = !stat -f\
"# This notebook was last updated: %Sm"\
Network_Usage.ipynb
elif os.name == "nt":
last_modified = !for %a in (Network_Usage.ipynb)\
do echo # This notebook was last updat... |
n-witt/MachineLearningWithText_SS2017 | tutorials/2 Matplotlib.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Note: This is a reduced version of this tutorial. You can find the entire material here.
Matplotlib
Introduction
Matplotlib is a library for producing publication-quality figures.
Online Documentation
The matplotlib.org project web... |
Nathx/think_stats | resolved/chap03ex.ipynb | gpl-3.0 | %matplotlib inline
import chap01soln
import thinkstats2
import thinkplot
import nsfg
import numpy as np
import pandas as pd
resp = chap01soln.ReadFemResp()
fem = nsfg.ReadFemPreg()
"""
Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br>
Allen Downey
Read the female respondent file.
End of exp... |
arcyfelix/Courses | 17-09-27-AWS Machine Learning A Complete Guide With Python/05 - Improving the model/03 - ml_underfit_overfit_normal_30samples.ipynb | apache-2.0 | # Function to generate target value for a given x.
true_func = lambda X: np.cos(1.5 * np.pi * X)
np.random.seed(0)
# Training Set: No. of random samples used for training the model
n_samples = 30
x = np.sort(np.random.rand(n_samples))
y = true_func(x) + np.random.randn(n_samples) * 0.1
# Test Set: 100 samples for whi... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/sandbox-2/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-2', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-2
Sub-Topics: Radiative Forcings.
Propertie... |
eds-uga/csci1360-fa16 | assignments/A10/A10_Q1.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import skimage.data
### BEGIN SOLUTION
### END SOLUTION
"""
Explanation: Q1
In this question, you'll be introduced to the scikit-image package. Only a small portion of the package will be explored; you're encouraged to check it out if this interests you!
A
scikit-im... |
konradcybulski/GameTheory1041 | Python_Resources/SimulationOptimization.ipynb | gpl-3.0 | SternJudging = [[1, 0 ],
[0, 1]]
SimpleStanding = [[1, 1],
[0, 1]]
Shunning = [[1, 0],
[0, 1]]
ImageScore = [[1, 1],
[0, 0]]
"""
Explanation: Before looking at the results of each simulation instance, both vectorized and not, let us first define the variables... |
ML4DS/ML4all | R_lab1_ML_Bay_Regresion/old/Pract_regression_professor.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import scipy.io # To read matlab files
from scipy import spatial
imp... |
beangoben/HistoriaDatos_Higgs | Dia1/3_Intro a Matplotlib-Vacio.ipynb | gpl-2.0 | import numpy as np # modulo de computo numerico
import matplotlib.pyplot as plt # modulo de graficas
import pandas as pd # modulo de datos
# esta linea hace que las graficas salgan en el notebook
%matplotlib inline
"""
Explanation: Intro a Matplotlib
Matplotlib = Libreria para graficas cosas matematicas
Que es Matplot... |
echohenry2006/tvb-library | tvb/simulator/demos/region_stochastic_reducedwongwang.ipynb | gpl-2.0 | from tvb.simulator.lab import *
"""
Explanation: Demonstrate using the simulator at the region level, stochastic integration, ReducedWongWang model with default paramters.
The large
speed conduction speed is used to neglect the time-delays as in
[DPA_2013]_
Using the Hagmann 66 ROI connectome, it's possible to obtain... |
heureuxchaquejour/Course_Project_of_Cryptography_HUST_2017 | code/rsaCryptoSystem.ipynb | bsd-2-clause | def gcd(a, b):
# returns GCD with Euclid's Algorithm
while a != 0:
a, b = b % a, a
return b
"""
Explanation: 数论函数
最大公约数
算法
使用欧几里得算法
程序设计
End of explanation
"""
def modInverse(a, m):
# a and m must be relatively prime
if gcd(a, m) != 1:
return None
# Extended Euclidean Algorith... |
hannorein/rebound | ipython_examples/PoincareMap.ipynb | gpl-3.0 | import rebound
import numpy as np
"""
Explanation: Poincare Map
This example shows how to calculate a simple Poincare Map with REBOUND. A Poincare Map (or sometimes called Poincare Section) can be helpful to understand dynamical systems.
End of explanation
"""
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1e-3,... |
ryo8128/study_python | a10_missingvalue.ipynb | mit | import numpy as np
import pandas as pd
import pandas_datareader.data as web#株価など時系列データをwebから取得するパッケージ
from datetime import datetime
ticker = ['AMZN','FB','INTU']
start = '2012-01-01'#datetime(2016,1,1)
end = '2013-12-31'#datetime(2016,12,31)
df = web.DataReader(ticker,'google',start,end)['Close',:,:]
df2 = df.copy()
... |
google/eng-edu | ml/cc/exercises/binary_classification.ipynb | apache-2.0 | #@title Run on TensorFlow 2.x
%tensorflow_version 2.x
"""
Explanation: Binary Classification
So far, you've only created regression models. That is, you created models that produced floating-point predictions, such as, "houses in this neighborhood costs N thousand dollars." In this Colab, you'll create and evaluate a ... |
Oli4/lsi-material | Algorithmic_Basics_of_Bioinformatics/Algorithmic Basics of Bioinformatics Tutorial Sheet 2.ipynb | mit | # The data we compute on.
import pandas as pd
NaN = float('nan')
manhattan = pd.DataFrame({0:[(3,1),(3,4),(0,4),(3,5),(1,NaN)],
1:[(2,0),(2,6),(7,4),(3,6),(3,NaN)],
2:[(4,2),(4,5),(3,5),(0,8),(2,NaN)],
3:[(0,4),(2,2),(4,2),(2,5),(2,NaN)],
... |
rdhyee/ipython-spark | clustering.ipynb | apache-2.0 | from pyspark import (SparkContext, SparkConf)
# http://spark.apache.org/docs/1.2.0/configuration.html
conf = SparkConf()
# https://spark.apache.org/faq.html
# local[N] or local[*]
conf.setMaster("local[10]").setAppName("Simple App")
#conf.set("spark.cores.max", "10")
sc = SparkContext(conf=conf)
#sc = SparkContext(... |
QuantScientist/Deep-Learning-Boot-Camp | day01/otto/models/EDA and classifiers walkthrough - otto competition1.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
from sklearn.model_selection import train_test_split
my_color_map = ['green','aqua','pink','blue','red','black','yellow','teal','orange','grey']
"""
Explanation: Exploratory Data Analysis & classification... |
jrbourbeau/cr-composition | notebooks/sequential-feature-selection.ipynb | mit | %load_ext watermark
%watermark -u -d -v -p numpy,scipy,pandas,sklearn,mlxtend
"""
Explanation: <a id='top'> </a>
Author: James Bourbeau
End of explanation
"""
import sys
sys.path.append('/home/jbourbeau/cr-composition')
print('Added to PYTHONPATH')
from __future__ import division, print_function
import numpy as np
... |
barjacks/foundations-homework | 05/Spotify_Homework_5_Skinner.ipynb | mit | response = requests.get('https://api.spotify.com/v1/search?query=Lil&type=artist&limit=50&market=US')
Lil_data = response.json()
Lil_data.keys()
Lil_data['artists'].keys()
"""
Explanation: These are the search queries for the Spotify Web API
End of explanation
"""
Lil_artists = Lil_data['artists']['items']
for art... |
DavidPowell/openmodes-examples | Constructing Scalar Models.ipynb | gpl-3.0 | # setup 2D plotting
%matplotlib inline
from openmodes.ipython import matplotlib_defaults
matplotlib_defaults()
import matplotlib.pyplot as plt
# the numpy library contains useful mathematical functions
import numpy as np
# import useful python libraries
import os.path as osp
# import the openmodes package
import op... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_eco2/td2a_eco_NLP_tf_idf_ngrams_LDA_word2vec_sur_des_extraits_litteraires.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.eco - Introduction au text mining
Dans ce TD, nous allons voir comment travailler avec du texte, à partir d'extraits de textes de trois auteurs, Edgar Allan Poe, (EAP), HP Lovecraft (HPL), et Mary Wollstonecraft Shelley (MWS).
Les donn... |
musketeer191/job_analytics | connect_jobs.ipynb | gpl-3.0 | import gc
import ja_helpers as ja_helpers; from ja_helpers import *
gc.enable()
HOME_DIR = 'd:/larc_projects/job_analytics/'
DATA_DIR = HOME_DIR + 'data/clean/'; RES_DIR = HOME_DIR + 'results/'
domain_dir = RES_DIR + 'job_prof/by_domain/' + 'new/'
func_dir = RES_DIR + 'job_prof/by_func/' + 'new/'
"""
Explanation: C... |
smillerd/fraud_detection | Credit Card Fraud Detection.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.gridspec as gridspec
import xgboost as xgb
from sklearn.model_selection import train_test_split
transactions = pd.read_csv('creditcard.csv')
"""
Explanation: <h1>**ReadMe**</h1>
An important part in the pr... |
yorkerlin/shogun | doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb | gpl-3.0 | %pylab inline
%matplotlib inline
from scipy.io import loadmat
from modshogun import RealFeatures, MulticlassLabels, Math
# load the dataset
dataset = loadmat('../../../data/multiclass/usps.mat')
Xall = dataset['data']
# the usps dataset has the digits labeled from 1 to 10
# we'll subtract 1 to make them in the 0-9 r... |
gambitproject/gambit-site | games2016/poker.ipynb | gpl-2.0 | import gambit
"""
Explanation: <h1>Getting started with the computational analysis of games:</h1>
<h2>Playing "stripped down" poker</h2>
<i>Theodore L. Turocy</i><br/>
<i>University of East Anglia</i>
<br/><br/>
<h3>EC'16 Workshop
24 July 2016</h3>
End of explanation
"""
gambit.__version__
"""
Explanation: Gambit v... |
apryor6/apryor6.github.io | visualizations/seaborn/notebooks/.ipynb_checkpoints/countplot-checkpoint.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.rcParams['figure.figsize'] = (20.0, 10.0)
plt.rcParams['font.family'] = "serif"
df = pd.read_csv('../../../datasets/movie_metadata.csv')
df.head()
"""
Explanation: seaborn.countplot
Bar graphs are useful for displaying ... |
PyDataMadrid2016/Conference-Info | workshops_materials/20160408_1100_Pandas_for_beginners/tutorial/EN - Tutorial 01 - Data structures.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(19760812)
%matplotlib inline
s = pd.Series()
df = pd.DataFrame()
p = pd.Panel()
print(s, df, p, sep = '\n' * 2)
"""
Explanation: New data structures
PANDAs = PANel DAta Structure
pandas adds three new data structures into the Py... |
HaoMood/cs231n | assignment2/assignment2/FullyConnectedNets.ipynb | gpl-3.0 | # 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
... |
iAInNet/tensorflow_in_action | _auto_encoder.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
from sklearn import preprocessing
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials import mnist
from __future__ import division
"""
Explanation: 深度学习在早期一度被认为是无监督的特征学习。
1. 无监督学习,即不需要标注数据就可以对数据进行一定程度的学习,这种学习是对数据内容的组织形式的学习,提取的是频繁出现的特征;
2. 逐层... |
NYUDataBootcamp/Projects | UG_S17/Lopez Giraldo - Cosmetics.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
%matplotlib inline
import matplotlib as mpl
import sys
url = 'https://chhs.data.ca.gov/api/views/7kri-yb7t/rows.csv?accessType=DOWNLOAD'
CosmeticsData = pd.read_csv(url)
CosmeticsData.head()
"""
Explanation: Chemicals in Cosm... |
turbomanage/training-data-analyst | quests/serverlessml/02_bqml/solution/first_model.ipynb | apache-2.0 | %%bash
export PROJECT=$(gcloud config list project --format "value(core.project)")
echo "Your current GCP Project Name is: "$PROJECT
import os
PROJECT = "qwiklabs-gcp-bdc77450c97b4bf6" # REPLACE WITH YOUR PROJECT NAME
REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
# Do not change these
os.... |
Hvass-Labs/TensorFlow-Tutorials | 20_Natural_Language_Processing.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from scipy.spatial.distance import cdist
"""
Explanation: TensorFlow Tutorial #20
Natural Language Processing
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
This tutorial is about a basic form of Natu... |
lin99/NLPTM-2016 | 4.Docs/assign2.ipynb | mit | def next_word(word):
# Su código aquí
return ''
"""
Explanation: NLP and TM Módulo 4
Taller 2: recurrent neural networks
Nombres:
Cargue el modelo de RNN entrenado con la Biblia: https://github.com/lin99/NLPTM-2016/blob/gh-pages/4.Docs/grnn_best.tar
1. Calculando la siguiente palabra más probable
Construya una... |
sibis-platform/ncanda-data-integration | scripts/dashboards/OneLinePerForm.ipynb | bsd-3-clause | site: str
arm: str
form: str
"""
Explanation: RedCap Status Dashboard - One Line Per Form
Creating a dashboard of one form per line
Parametrization
End of explanation
"""
from IPython.display import display, Markdown, Latex
import pandas as pd
from pathlib import Path
import sys
sys.path.append('/sibis-software/ncan... |
gfabieno/SeisCL | docs/notebooks/examples/Marmousi.ipynb | gpl-3.0 | import os
from urllib.request import urlretrieve
import numpy as np
import matplotlib.pyplot as plt
from SeisCL import SeisCL
url = "http://sw3d.cz/software/marmousi/little.bin/velocity.h@"
if not os.path.isfile("velocity.h@"):
urlretrieve(url, filename="velocity.h@")
vel = np.fromfile("velocity.h@", dtype=np.floa... |
saashimi/code_guild | wk3/notebooks/wk3.1.ipynb | mit |
myfile = open("test.txt", "w")
myfile.write("My first file written from Python\n")
myfile.write("---------------------------------\n")
myfile.write("Hello, world!\n")
myfile.write("Did it work?\n")
myfile.close()
"""
Explanation: Lecture 3
I/O and exceptions
About Files
RAM and volatility.
Files and non-volatility
... |
BitTiger-MP/DS502-AI-Engineer | DS502-1704/MXNet-week1-part1/gluon-MNIST/Deep Learning Fundamentals-Gluon.ipynb | apache-2.0 | import mxnet as mx
from mxnet import nd
import numpy as np
mx.random.seed(1)
x = nd.empty((3, 4))
print(x)
x = nd.ones((3, 4))
x
y = nd.random_normal(0, 1, shape=(3, 4))
print y
print y.shape
print y.size
x * y
nd.exp(y)
nd.dot(x, y.T)
# Memory Host
print "The current mem host y is {}".format(id(y))
y[:] = x +... |
developerator/Maturaarbeit | MNIST-Digit Recognition/Feedforward_Recog.ipynb | mit | import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.utils import np_utils
# Fix random seed for reproducibility
seed = 7
np.random.seed(seed)
# Load data
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# Flatten 28*28 images to a ... |
swails/mdtraj | examples/clustering.ipynb | lgpl-2.1 | from __future__ import print_function
%matplotlib inline
import mdtraj as md
import numpy as np
import matplotlib.pyplot as plt
import scipy.cluster.hierarchy
from scipy.spatial.distance import squareform
"""
Explanation: In this example, we cluster our alanine dipeptide trajectory using the RMSD distance metric and h... |
pdwyys20/deep-learning | intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
walmartlabs/lovebeat | docs/Lovebeat Auto Algorithm.ipynb | apache-2.0 | def constant(v, count = 100):
return [v] * count
def jitter(v, amplitude):
return [y + random.randint(0, amplitude) - amplitude * 0.5 for y in v]
def increasing(from_, to_, count = 100):
return list(np.arange(from_, to_, (to_ - from_) / count))
def sin(base, amplitude, count = 100):
return [base + am... |
chengsoonong/crowdastro | notebooks/101_everybody_loves_venn_diagrams.ipynb | mit | import astropy.io.ascii as asc
table = asc.read('one-table-to-rule-them-all.tbl')
table
# Venn diagram time!
rgz = {i['Key'] for i in table if i['Component Zooniverse ID (RGZ)']}
norris = {i['Key'] for i in table if i['Component # (Norris)']}
franzen = {i['Key'] for i in table if i['Component ID (Franzen)']}
import m... |
chseifert/tutorials | data-science/K-means_Clustering.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import pylab as plt
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
import sklearn.metrics as sm
"""
Explanation: K-means clustering
Authors
Ndèye Gagnessiry Ndiaye and Christin Seifert
License
This work is licensed under the Creative Commons Attribution 3.0 ... |
mne-tools/mne-tools.github.io | 0.23/_downloads/a495a43b643e9ccca7a738dba79df263/find_ref_artifacts.ipynb | bsd-3-clause | # Authors: Jeff Hanna <jeff.hanna@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import refmeg_noise
from mne.preprocessing import ICA
import numpy as np
print(__doc__)
data_path = refmeg_noise.data_path()
"""
Explanation: Find MEG reference channel artifacts
Use ICA decompos... |
desihub/qlf | jupyter/xsigma.ipynb | bsd-3-clause | import urllib.request
import json
job = urllib.request.urlopen("http://ql.linea.gov.br/dashboard/api/job/?process=1").read()
api = json.loads(job)
mergedqa = api['results'][0]['output']
print('mergedQA loaded!')
"""
Explanation: XSIGMA Plots Example
This is an example on how to make xsigma plots using Jupyter Notebook... |
SciTools/courses | course_content/iris_course/7.Advanced_Concepts.ipynb | gpl-3.0 | import iris
import iris.quickplot as qplt
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Iris introduction course
7. Advanced Concepts
Learning Outcome: by the end of this section, you will be able to utilise some more advanced parts of Iris's functionality.
Duration: 1 hour
Overview:<br>
7.1 Load... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/values-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
rdhyee/diversity-census-calc | 02_Calculating_Diversity_Answer.ipynb | apache-2.0 | pops = [14956253, 2163804, 4775070, 14013719, 1345110]
CA_pop = 37253956
sum(pops) == CA_pop
"""
Explanation: population of California in 2010: https://github.com/rdhyee/diversity-census-calc/blob/0.0.1/census_2010_sf1/state_five_categories.csv#L6
End of explanation
"""
import math
s = 0.0
pop_total = sum(pops)
... |
tensorflow/docs-l10n | site/ja/guide/keras/transfer_learning.ipynb | apache-2.0 | #@title 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 or agreed to in writing, software
# distributed under... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.