repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Seeliglab/2017---Deep-learning-yeast-UTRs | Jupyter_notebooks/Notebook_1_CNN_Model_Training_with_Hyperparameter_Search.ipynb | mit | plt.rcParams["patch.force_edgecolor"] = True
sns.set_style('whitegrid',
{'axes.grid': True,
'grid.linestyle': u'--',
'axes.edgecolor': '0.1',
'axes.labelcolor': '0',
'axes.labelsize': 15,
'axes.titlesize': 15,
'legen... |
rohitbahl1986/TrafficSignClassifier | Traffic_Sign_Classifier.ipynb | mit | # Import all the relevant modules.
import cv2
import csv
import matplotlib.image as mpimg
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pickle
from random import randint
import seaborn as sns
from sklearn.utils import shuffle
import tensorflow as tf
from te... |
rishizek/deep-learning | language-translation/dlnd_language_translation.ipynb | mit | """
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... |
kubeflow/examples | natural-language-processing-with-disaster-tweets-kaggle-competition/natural-language-processing-with-disaster-tweets-orig.ipynb | apache-2.0 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from nltk.corpus import stopwords
from nltk.util import ngrams
from sklearn.feature_extraction.text import CountVectorizer
from collections import defaultdict
from collections import Counter
plt.style.use('ggplot')
stop=set(st... |
sony/nnabla | tutorial/multi_device_training.ipynb | apache-2.0 | import ipyparallel as ipp
rc = ipp.Client(profile='mpi')
"""
Explanation: Data Parallel Distributed Training
DataParallelCommunicator enables to train your neural network using
multiple devices. It is normally used for gradients exchange in data
parallel distributed training. Basically, there are two types of distri... |
moonbury/pythonanywhere | github/MasteringMatplotlib/mmpl-high-level.ipynb | gpl-3.0 | import matplotlib
matplotlib.use('nbagg')
%matplotlib inline
"""
Explanation: High-level Plotting and Data Analysis
In the following sections of this IPython Notebook we be looking at the following:
High-level plotting
Historical background
matplotlib
NetworkX
Pandas
Grammar of graphics
New styles in matplotlib
Bokeh... |
bashtage/statsmodels | examples/notebooks/statespace_varmax.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
dta = sm.datasets.webuse('lutkepohl2', 'https://www.stata-press.com/data/r12/')
dta.index = dta.qtr
dta.index.freq = dta.index.inferred_freq
endog = dta.loc['1960-04-01':'1978-10-01', ['dln_inv', 'dl... |
gsvijayraajaa/workshop | 2.DataPreprocessing.ipynb | mit | # Import the libraries we need, which is Pandas and Numpy
import pandas as pd
import numpy as np
df1 = pd.read_csv('data/drinks2000.csv')
df1.head()
df1.shape
"""
Explanation: 1. Frame the Problem
"I think, therefore I am"
What type of questions can be answered?
Developing a hypothesis drive approach.
Making the... |
jchodera/assaytools | examples/ipynbs/models/competition-assay-modeling/modelling-CompetitiveBinding-AnalyticalSolution.ipynb | lgpl-2.1 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from IPython.display import display, Math, Latex #Do we even need this anymore?
%pylab inline
"""
Explanation: Calculation of Equilibrium Concentrations in Competitive Binding Experiment
This notebook uses analytical solution of equilibrium expre... |
barjacks/pythonrecherche | 03 intro python II/02 Python II Hausaugaben.ipynb | mit | double(5)
"""
Explanation: Python II Hausaufgaben
1.Baue eine Funktion mit dem Namen 'double', der die Zahl 5 vedoppelt:
End of explanation
"""
lst = list(range(1,5))
"""
Explanation: 2.Baue einen for-loop, der durch vordefinierte Zahlen-list geht, und mithilfe der eben kreierten eigenen Funktion, alle Resultate ve... |
biothings/biothings_explorer | jupyter notebooks/TIDBIT 02 Finding New Uses for Existing Drugs to Treat Parkinson’s Disease.ipynb | apache-2.0 | !pip install git+https://github.com/biothings/biothings_explorer#egg=biothings_explorer
"""
Explanation: Introduction
<img src="img/tidbit2.png" width=300 style="float: right;"/>
This notebook demonstrates how BioThings Explorer can be used to answer the following query:
 ... |
yw-fang/readingnotes | machine-learning/McKinney-pythonbook2013/chapter07-note.ipynb | apache-2.0 | import pandas as pd
def special_sign(sign, times):
# sign is string, times is integer
str_list = sign*times
new_str = ''.join([i for i in str_list])
return(new_str)
df1 = pd.DataFrame({'key':list('bbacaab'),
'data1': range(7)})
df2 = pd.DataFrame({'key': list('abd'),
... |
tuanavu/coursera-university-of-washington | machine_learning/2_regression/lecture/week1/PhillyCrime.ipynb | mit | import sys
sys.path.append('C:\Anaconda2\envs\dato-env\Lib\site-packages')
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 Philadelp... |
moagstar/puzzles | Array/Rotate Array.ipynb | mit | import sys; sys.path.append('../..')
from puzzles import leet_puzzle
leet_puzzle('rotate-array')
n, k = 7, 4
example_array = list(range(n))
example_array
"""
Explanation: Rotate Array
End of explanation
"""
def rotate_simple(input_array, order):
order %= len(input_array)
return input_array[order:] + input_a... |
masasin/spirit | notebooks/01_parameter-selection.ipynb | mit | def combos(combo_min, combo_max, combo_len):
for combo in it.product(xrange(combo_min, combo_max + 1),
repeat=combo_len):
yield combo
def combo_dicts(param_names, combo_min, combo_max, combo_len):
for d in (OrderedDict(it.izip(param1_names, combo)) for combo in combo... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/td2a_cenonce_session_5_donnees_non_structurees_et_programmation_fonctionnelle.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.i - Données non structurées et programmation fonctionnelle
Calculs de moyennes et autres statistiques sur une base twitter au format JSON avec de la programmation fonctionnelle (module cytoolz).
End of explanation
"""
import pyensae.... |
erolkavvas/tb_pangenome_workflow | iEK1020/SUPP_reproducible_modeling.ipynb | mit | print cobra.__version__
"""
Explanation: This notebook was run using cobra version 0.5.11
End of explanation
"""
model_iEK = cobra.io.load_json_model("iEK1020.json")
print "# of reactions", len(model_iEK.reactions)
print "# of metabolites", len(model_iEK.metabolites)
print "# of genes", len(model_iEK.genes)
# for ... |
SanPen/GridCal | src/Tutorials/defining_a_grid_from_scratch.ipynb | lgpl-3.0 | import pandas as pd
import numpy as np
from GridCal.Engine import *
%matplotlib inline
"""
Explanation: Defining a grid from scratch
In this example we are going to create a grid just by using GrdiCal's comands and we will run a power flow study.
End of explanation
"""
grid = MultiCircuit(name='lynn 5 bus')
"""
E... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/td_note_2013_bout_de_code_coloriage.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.e - TD noté, 27 novembre 2012 (éléments de code pour le coloriage)
Coloriage d'une image, dessin d'une spirale avec matplotlib : éléments de code données avec l'énoncé.
End of explana... |
chrlttv/Teaching | Session4/DataViz_keys.ipynb | mit | # Import all three librairies
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
# For displaying the plots inside Notebook
%matplotlib inline
"""
Explanation: Data Visualization with Python
The following notebook serves as an introduction to data visualization with Python for the course "Data... |
MaayanLab/clustergrammer-widget | Running_clustergrammer_widget.ipynb | mit | # import widget classes and instantiate Network instance
from clustergrammer_widget import *
net = Network(clustergrammer_widget)
# load matrix file
net.load_file('rc_two_cats.txt')
# cluster using default parameters
net.cluster(enrichrgram=True)
# make interactive widget
net.widget()
"""
Explanation: Clustergramme... |
UltronAI/Deep-Learning | CS231n/reference/CS231n-master/assignment2/BatchNormalization.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
... |
has2k1/onelib | examples/loess-basic-usage.ipynb | bsd-3-clause | np.random.seed(123)
n = 100
x = np.linspace(-2*np.pi, 2*np.pi, n)
y = np.sin(x)
y2 = y + 0.1*np.random.randn(n) # additive noise
lo = loess(x, y)
# fit
lo.fit()
# Predict
prediction = lo.predict(x, stderror=True)
# Compute confidence intervals
ci = prediction.confidence(0.05)
# Helper function
def loess_fit(x, y... |
mne-tools/mne-tools.github.io | 0.24/_downloads/c69e0120935518121b8298ecac72eed8/35_dipole_orientations.ipynb | bsd-3-clause | import mne
import numpy as np
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
data_path = sample.data_path()
evokeds = mne.read_evokeds(data_path + '/MEG/sample/sample_audvis-ave.fif')
left_auditory = evokeds[0].apply_baseline()
fwd = mne.read_forward_solution(
dat... |
paris-saclay-cds/python-workshop | Day_1_Scientific_Python/scikit-learn/02.1-Machine-Learning-Intro.ipynb | bsd-3-clause | %matplotlib inline
# Import the example plot from the figures directory
from fig_code import plot_sgd_separator
plot_sgd_separator()
"""
Explanation: Introduction to Scikit-Learn: Machine Learning with Python
This session will cover the basics of Scikit-Learn, a popular package containing a collection of tools for ma... |
joommf/tutorial | workshops/Durham/tutorial1_geometry.ipynb | bsd-3-clause | import discretisedfield as df
%matplotlib inline
"""
Explanation: Tutorial 1 - Geometry
In this tutorial we explore how simulated geometries can be defined and initial magnetisation states specified. The package we use to define finite difference meshes and fields is discretisedfield.
End of explanation
"""
L = 100e... |
poppy-project/poppy-ergo-jr | software/samples/notebooks/Discover your Poppy Ergo Jr.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Discover your Poppy Ergo Jr
This notebook will guide you in your very first steps with Poppy Ergo Jr in Python.
What you will see in this notebook:
Instantiate your robot
Access motors, send motor commands
Read sensor value
Start ... |
gully/PyKE | docs/source/tutorials/ipython_notebooks/whatsnew31.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
from matplotlib import rcParams
rcParams["figure.figsize"] = (14, 5)
"""
Explanation: What's new in PyKE 3?
Developed since 2012, PyKE offers a user-friendly way to inspect and analyze the pixels and lightcurves obtained by NASA's Kepler and K2.
The latest version ... |
kevinjliang/Duke-Tsinghua-MLSS-2017 | 03B_Generative_Adversarial_Network.ipynb | apache-2.0 | %matplotlib inline
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import time
# Use if running on a GPU
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.log_device_placement = True
"""
Explanation: Generative Adversarial Network in Tensorflow
Genera... |
datastax-demos/Muvr-Analytics | ipython-analysis/artificial-signal-mlp.ipynb | bsd-3-clause | %matplotlib inline
import logging
logging.basicConfig(level=40)
logger = logging.getLogger()
"""
Explanation: MLP learning experiments on artificial generated signals
Multilayer perceptrons are a great way to classify data into multiple classes. They are simple, fast and still they are able to find non linear decisi... |
anhquan0412/deeplearning_fastai | deeplearning2/tiramisu-keras.ipynb | apache-2.0 | %matplotlib inline
import importlib
import utils2; importlib.reload(utils2)
from utils2 import *
# import warnings
# warnings.filterwarnings("ignore",category=DeprecationWarning)
limit_mem()
"""
Explanation: This notebook contains an implementation of the One Hundred Layers Tiramisu as described in Simon Jegou et ... |
mohanbolisetty/JAX-NeuroGeneticsSClDataAnalysis | .ipynb_checkpoints/AnalysisNotebook-checkpoint.ipynb | mit | counts, featuredata=read10X('Data/')
"""
Explanation: Read Input data
End of explanation
"""
counts.shape
"""
Explanation: Shape of dataset: Genes, Cells
End of explanation
"""
cpt=normalize(counts)
"""
Explanation: Normalize data
Since number of genes and transcipts detected is directly dependent on read depth,... |
asche1/LongHCPulse | NonPPMS/Non-PPMS_HeatCapacity.ipynb | gpl-3.0 | # import libraries
%matplotlib notebook
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import matplotlib.lines as mlines
from matplotlib.ticker import FuncFormatter
from matplotlib.ticker import ScalarFormatter
import sys
from LongHCPulse_NonPPMS import LongHC... |
aaossa/Dear-Notebooks | More/DefaultParametersInPython_ES.ipynb | gpl-3.0 | def funcion(lista=[]):
lista.append(1)
print("La lista vale: {}".format(lista))
"""
Explanation: El "problema"
Es posible que al usar funciones con parámetros por defecto se encuentren con cierto comportamiento inesperado o poco intuitivo de Python. Por estas cosas siempre hay que revisar el código, conocerlo ... |
jennybrown8/python-notebook-coding-intro | lesson6exercises.ipynb | apache-2.0 | # For loop example
for counter in range(3, 7):
print counter
print "Whee!"
print "Done."
# Arrays example
children = ["Sally", "Bobby", "Tommy", "Tonya"]
ages = [12, 9, 7, 5]
print "Sally's age is ", ages[0]
print "Bobby's age is ", ages[1]
print "Tommy's age is ", ages[2]
print "Tonya's age is ", ages[3]
f... |
tanghaibao/goatools | notebooks/relatonships_in_the_go.ipynb | bsd-2-clause | import os
from goatools.obo_parser import GODag
if not os.path.exists('go-basic.obo'):
!wget http://geneontology.org/ontology/go-basic.obo
go = GODag('go-basic.obo', optional_attrs=['relationship'])
"""
Explanation: Relationships in the GO
Alex Warwick Vesztrocy, March 2016
For some analyses, it is possible to on... |
Upward-Spiral-Science/ugrad-data-design-team-0 | reveal/notebooks/Kalman Filter tutorial.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
def kalman_filter_univariate(Z, R, u, Q, p0, x0):
# access important dimensions
t = Z.shape[0]
series_length = (t,)
#allocate space for arrays
X = np.zeros(series_length) #estimate of X
P = np.zeros(series_length) #process covariance matrix
K = np.zeros(series... |
metabolite-atlas/metatlas | notebooks/reference/Workflow_Notebook_VS_Auto_RT_Predict.ipynb | bsd-3-clause | from IPython.core.display import Markdown, display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
%matplotlib notebook
%matplotlib inline
%env HDF5_USE_FILE_LOCKING=FALSE
import sys, os
#### add a path to your private code if not using production code ####
#print ('point path to metatlas... |
hannorein/rebound | ipython_examples/SimulationArchiveRestart.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.integrator = "whfast"
sim.dt = 2.*3.1415/365.*6 # 6 days in units where G=1
sim.add(m=1.)
sim.add(m=1e-3,a=1.)
sim.add(m=5e-3,a=2.25)
sim.move_to_com()
"""
Explanation: Using the Simulation Archive to restart a simulation
The Simulation Archive (SA) is a binary file that ... |
dsacademybr/PythonFundamentos | Cap06/Notebooks/DSA-Python-Cap06-05-Update e Delete no SQLite.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 6</font>
Download: http://github.com/dsacademybr
End of explanation
"""
import ... |
evanmiltenburg/python-for-text-analysis | Chapters-colab/Chapter_07_Sets.ipynb | apache-2.0 | %%capture
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip
!unzip Data.zip -d ../
!unzip images.zip -d ./
!unzip Ext... |
EmuKit/emukit | notebooks/Emukit-tutorial-bayesian-optimization-integrating-model-hyperparameters.ipynb | apache-2.0 | import numpy as np
%pylab inline
"""
Explanation: Bayesian optimization integrating model hyper-parameters
In this notebook we are going to see how to use Emukit to solve optimization problems when the acquisition function is integrated with respect to the hyper-parameters of the model.
To show this with an example, ... |
h2oai/h2o-3 | h2o-py/demos/gbm_pojo_splits.ipynb | apache-2.0 | import numpy as np
f32 = np.float32("25.695312")
f32
f64 = np.float64("25.695312")
f64
"""
Explanation: Interpreting numeric split points in H2O POJO tree based models
This notebook explains how to correctly interpret split points that you might see in POJOs of H2O tree based models.
Motivation: we had seen there ar... |
bmeaut/python_nlp_2017_fall | course_material/02_Types_Operators_Strings/02_Types_Operators_Strings_errata.ipynb | mit | l1 = sorted(['b', 'c', 'a']) # a list
l2 = sorted(('b', 'c', 'a')) # a tuple
l3 = sorted('bca') # a string
print(l1, l1 == l2 == l3)
print(type(l1) == type(l2) == type(l3) == list)
"""
Explanation: Introduction to Python and Natural Language Technologies
Type system and built-in types
Errata and Q&A
19 September 2... |
samuelshaner/openmc | docs/source/pythonapi/examples/mgxs-part-iii.ipynb | mit | import math
import pickle
from IPython.display import Image
import matplotlib.pyplot as plt
import numpy as np
import openmc
import openmc.mgxs
import openmoc
import openmoc.process
from openmoc.opencg_compatible import get_openmoc_geometry
from openmoc.materialize import load_openmc_mgxs_lib
%matplotlib inline
"""... |
GoogleCloudDataproc/spark-bigquery-connector | examples/notebooks/Advanced ML Pipelines.ipynb | apache-2.0 | from IPython.display import Image
Image(url='https://spark.apache.org/docs/3.0.0-preview/img/ml-Pipeline.png')
"""
Explanation: <h3>Problem: As a PM, I write lots of blogs. How do I know if they will be received well by readers?</h3>
<table>
<tr>
<td><img src="https://jayclouse.com/wp-content/uploads/20... |
ivergara/science_notebooks | Apendix.ipynb | gpl-3.0 | initial = [1, 0, 0, 0, 1, 0, 0, 0]
final = [0, 0, 0, 0, 1, 0, 1, 0]
"""
Explanation: Apendix
Here we compute the transition matrix elements of a $d^4$ system like the one explored in chapter 5 for the ruthenate Ca$_2$RuO$_4$ (CRO). We compute the possible transitions of the type $d^4d^4\rightarrow d^3d^5$, applying so... |
nwhidden/ND101-Deep-Learning | intro-to-rnns/Anna_KaRNNa_Exercises.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is bas... |
ocefpaf/whoi_talk | index.ipynb | artistic-2.0 | HTML(ids)
"""
Explanation: A tour of the ~~Scientific~~ Oceanographic Python stack
End of explanation
"""
!head -n 5 ./data/dados_pirata.csv
"""
Explanation: Before we begin some FAQ
How to install Python?
Should I use a distribution?
Python 2 or 3?
Why we cannot have a single installer like MatlabTM!?
One answer... |
tpin3694/tpin3694.github.io | machine-learning/impute_missing_values_with_means.ipynb | mit | import pandas as pd
import numpy as np
from sklearn.preprocessing import Imputer
"""
Explanation: Title: Impute Missing Values With Means
Slug: impute_missing_values_with_means
Summary: Impute Missing Values With Means.
Date: 2016-11-28 12:00
Category: Machine Learning
Tags: Preprocessing Structured Data
Authors... |
dwhswenson/openpathsampling | examples/alanine_dipeptide_mstis/AD_mstis_4_analysis.ipynb | mit | from __future__ import print_function
%matplotlib inline
import matplotlib.pyplot as plt
import openpathsampling as paths
import numpy as np
"""
Explanation: Analyzing the MSTIS simulation
Included in this notebook:
Opening files for analysis
Rates, fluxes, total crossing probabilities, and condition transition proba... |
Wei1234c/Elastic_Network_of_Things_with_MQTT_and_MicroPython | notebooks/tools/上傳檔案 - MQTT.ipynb | gpl-3.0 | import os, sys
sys.path.append(os.path.join('..', '..', '..', '..', '..', ))
import ampy_utils
# with open(os.path.join('..', '..', '..', '..', '..', 'ampy_utils.py'), 'r') as f:
# print(f.read())
"""
Explanation: 上傳檔案 - MQTT
需先安裝 ampy ( Adafruit MicroPython Tool )
pip install adafruit-ampy
https://github.com/ada... |
dwillcox/pyreaclib | pyreaclib-examples.ipynb | bsd-3-clause | r = reaclib.Rate("reaclib-rates/c13-pg-n14-nacr")
"""
Explanation: Loading a single rate
End of explanation
"""
print(r.original_source)
"""
Explanation: the original reaclib source
End of explanation
"""
r.eval(1.e9)
"""
Explanation: evaluate the rate at a given temperature (in K)
End of explanation
"""
print... |
vadim-ivlev/STUDY | handson-data-science-python/DataScience-Python3/MatPlotLib.ipynb | mit | %matplotlib inline
from scipy.stats import norm
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-3, 3, 0.01)
plt.plot(x, norm.pdf(x))
plt.show()
"""
Explanation: MatPlotLib Basics
Draw a line graph
End of explanation
"""
plt.plot(x, norm.pdf(x))
plt.plot(x, norm.pdf(x, 1.0, 0.5))
plt.show()
"""
E... |
eblur/newdust | examples/giant_grains.ipynb | bsd-2-clause | ABIG = 1.0
big_sil = SingleGrainPop('Grain', 'Silicate', 'Mie', amax=ABIG, md=MD)
big_gra = SingleGrainPop('Grain', 'Graphite', 'Mie', amax=ABIG, md=MD)
%%time
big_sil.calculate_ext(EVALS, unit='kev', theta=THVALS)
%%time
big_gra.calculate_ext(EVALS, unit='kev', theta=THVALS)
ax = plt.subplot(111)
big_sil.plot_ext(... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/06_structured/6_deploy.ipynb | apache-2.0 | # change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
os.environ['TFVERSION'] = '1.13'
%%bash
if ! gsutil ls | grep -q gs://${BUCKET}/bab... |
jjpr/anethole | Equation_To_Object_Instructions.ipynb | mit | from xvfbwrapper import Xvfb
vdisplay = Xvfb(width=1920, height=1080)
vdisplay.start()
from numpy import pi, sin, cos, mgrid
from mayavi import mlab
import pymeshlab
mlab.init_notebook()
"""
Explanation: Turning An Equation Into An Object
A description of the series of steps I used to successfully turn a set of param... |
atlury/deep-opencl | cs480/17 Analysis of Neural Network Classifiers and Bottleneck Networks.ipynb | lgpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
!wget http://www.cs.colostate.edu/~anderson/cs480/notebooks/nn2.tar
!tar xvf nn2.tar
import neuralnetworks as nn
import qdalda
import mlutils as ml
"""
Explanation: $$\newcommand{\xv}{\mathbf{x}}
\newcommand{\Xv}{\mathbf{X}}
\newcommand{\yv}{\math... |
arcyfelix/Courses | 17-09-27-AWS Machine Learning A Complete Guide With Python/06 - Kaggle's Bike Sharing Demand Challenge/ml_bike_train.ipynb | apache-2.0 | data_path = r'..\Data\RegressionExamples\BikeTrain'
df = pd.read_csv(os.path.join(data_path,'train.csv'),
parse_dates = ['datetime'])
df.head()
# Add some additional features to look at data
df['month'] = df.datetime.dt.month
df['day'] = df.datetime.dt.day
df['hour'] = df.datetime.dt.hour
df['dayof... |
sebastiandres/mat281 | clases/Unidad3-ModelamientoyError/Clase02-HoldoutSet/HoldoutSet.ipynb | cc0-1.0 | import numpy as np
from mat281_code import model
# Load data
data = model.load_data("data/dataN5000.txt") # Change here
N = data.shape[0]
split = int(0.7*N) # Change here
# Permute the data
np.random.seed(23) # Change here
data = np.random.permutation(data)
# Do the split
training_data = data[:split,:]
testing_... |
Kaggle/learntools | notebooks/python/raw/tut_5.ipynb | apache-2.0 | planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune']
for planet in planets:
print(planet, end=' ') # print all on same line
"""
Explanation: Loops
Loops are a way to repeatedly execute some code. Here's an example:
End of explanation
"""
multiplicands = (2, 2, 2, 3, 3, 5)
pro... |
InsightSoftwareConsortium/SimpleITK-Notebooks | Python/05_Results_Visualization.ipynb | apache-2.0 | %matplotlib notebook
import numpy as np
import itertools
import SimpleITK as sitk
# Utility method that either downloads data from the Girder repository or
# if already downloaded returns the file name for reading from disk (cached data).
%run update_path_to_download_script
from downloaddata import fetch_data as fdat... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 2 Supervised learning/Homework/3 linear regression and overfitting and regularization/OverfittingTask.ipynb | mit | import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Практическое задание к уроку 1 (2 неделя).
Линейная регрессия: переобучение и регуляризация
В этом задании мы на примерах увидим, как переобучаются линейные модели, разберем, почему так происходит, и выясним... |
geoneill12/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
----------
... |
shengshuyang/StanfordCNNClass | assignment3/RNN_Captioning.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... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-mh/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mh', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-MH
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
computational-class/cjc2016 | code/04.PythonCrawler_selenium.ipynb | mit | !pip install selenium
"""
Explanation: 数据抓取
使用Selenium操纵浏览器
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
Selenium 是一套完整的web应用程序测试系统,包含了
- 测试的录制(selenium IDE)
- 编写及运行(Selenium Remote Control)
- 测试的并行处理(Selenium Grid)。
Selenium的核心Selenium Core基于JsUnit,完全由JavaScript编写,因此可以用于任何支持JavaScript... |
fonnesbeck/scientific-python-workshop | notebooks/Resampling Methods and Missing Data.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
salmon = pd.read_table("../data/salmon.dat", delim_whitespace=True, index_col=0)
plt.scatter(x=salmon.spawners, y=salmon.recruits)
"""
Explanation: Resampling Methods
Resampling is the process of ... |
rjurney/Agile_Data_Code_2 | ch02/Introduction_to_PySpark.ipynb | mit | from pyspark.sql import SparkSession
# Initialize PySpark with MongoDB support
APP_NAME = "Introducing PySpark"
spark = (
SparkSession.builder.appName(APP_NAME)
# Load support for MongoDB and Elasticsearch
.config("spark.jars.packages", "org.mongodb.spark:mongo-spark-connector_2.12:3.0.1,org.elasticsearch... |
google/applied-machine-learning-intensive | content/04_classification/05_introduction_to_image_classification/colab.ipynb | apache-2.0 | # 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 the L... |
google/timesketch | notebooks/Stolen_Szechuan_Sauce_Analysis.ipynb | apache-2.0 | # @markdown Only execute if not already installed and running a cloud runtime
!pip install -q timesketch_api_client
!pip install -q vt-py nest_asyncio pandas
!pip install -q picatrix
# @title Import libraries
# @markdown This cell will import all the libraries needed for the running of this colab.
import re
import re... |
petebachant/reverse-fd-heat-eq | notebook.ipynb | mit | import numpy as np
from numpy.testing import assert_almost_equal
# Specify diffusion coefficient
nu = 0.1
def analytical_soln(xmax=1.0, tmax=0.2, nx=1000, nt=1000):
"""Compute analytical solution."""
x = np.linspace(0, xmax, num=nx)
t = np.linspace(0, tmax, num=nt)
u = np.zeros((len(t), len(x))) # ro... |
arisbw/fastai-part-1 | Lesson1_Aris.ipynb | mit | !pip2 install keras==1.2.2
"""
Explanation: Using Convolutional Neural Networks (VGG16)
By: Aris Budi Wibowo
Basic Setup
First, we need to install Keras.
End of explanation
"""
!mkdir -p ~/.keras
!echo '{"epsilon":1e-07,"floatx":"float32","backend":"theano","img_dim_ordering":"th"}' > ~/.keras/keras.json
"""
Explan... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/interro_rapide_20_minutes_2014_11.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.e - Correction de l'interrogation écrite du 14 novembre 2014
coût algorithmique, calcul de séries mathématiques
End of explanation
"""
nbs = [ 1, 5, 4, 7 ] #
for n in nbs: #
s += n #
"""
Explanation: Enonc... |
ImAlexisSaez/deep-learning-specialization-coursera | course_1/week_4/assignment_2/deep_neural_network_application_v1.ipynb | mit | import time
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
from dnn_app_utils import *
%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['im... |
xpharry/Udacity-DLFoudation | tutorials/reinforcement/Q-learning-cart.ipynb | mit | import gym
import tensorflow as tf
import numpy as np
# Create the Cart-Pole game environment
env = gym.make('CartPole-v0')
"""
Explanation: Deep Q-learning
In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an a... |
LimeeZ/phys292-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
print (a+b)
"""
Explanation: Interact basics
Writ... |
mnschmit/LMU-Syntax-nat-rlicher-Sprachen | 11-notebook-solution.ipynb | apache-2.0 | test_sentences = [
"the men saw a car .",
"the woman gave the man a book .",
"she gave a book to the man .",
"yesterday , all my trouble seemed so far away ."
]
import nltk
from nltk.corpus import treebank
from nltk.grammar import ProbabilisticProduction, PCFG
# Production count: the number of times a... |
mas-dse-greina/neon | neon Iris.ipynb | apache-2.0 | from sklearn import datasets
iris = datasets.load_iris()
X = iris.data
Y = iris.target
nClasses = len(iris.target_names) # Setosa, Versicolour, and Virginica iris species
"""
Explanation: Using sklearn's Iris Dataset with neon
Tony Reina<br>
28 JUNE 2017
Here's an example of how we can load one of the standard sk... |
stsouko/CGRtools | doc/tutorial/3_standardization.ipynb | lgpl-3.0 | import pkg_resources
if pkg_resources.get_distribution('CGRtools').version.split('.')[:2] != ['4', '0']:
print('WARNING. Tutorial was tested on 4.0 version of CGRtools')
else:
print('Welcome!')
# load data for tutorial
from pickle import load
from traceback import format_exc
with open('molecules.dat', 'rb') a... |
quantopian/research_public | notebooks/lectures/Variance/questions/notebook.ipynb | apache-2.0 | # Useful Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Exercises: Variance
By Christopher van Hoecke, Maxwell Margenot, and Delaney Mackenzie
Lecture Link :
https://www.quantopian.com/lectures/variance
IMPORTANT NOTE:
This lecture corresponds to the Variance lecture,... |
deepmind/deepmind-research | rl_unplugged/dmlab_r2d2.ipynb | apache-2.0 | !apt-get install libsdl2-dev
!apt-get install libosmesa6-dev
!apt-get install libffi-dev
!apt-get install gettext
!apt-get install python3-numpy-dev python3-dev
"""
Explanation: Copyright 2021 DeepMind Technologies Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file excep... |
computational-class/computational-communication-2016 | code/05.PythonCrawler_tianya_threads.ipynb | mit | import urllib2
from bs4 import BeautifulSoup
"""
Explanation: 数据抓取:
使用Python编写网络爬虫
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
需要解决的问题
页面解析
获取Javascript隐藏源数据
自动翻页
自动登录
连接API接口
End of explanation
"""
from IPython.display import display_html, HTML
HTML('<iframe src=http://bbs.tianya.cn... |
mgeplf/NeuroM | tutorial/neurom_tutorial.ipynb | bsd-3-clause | %matplotlib inline
# Import neurom module
import neurom as nm
# Import neurom visualization module
from neurom import viewer
"""
Explanation: NeuroM Tutorial Notebook
NeuroM contains helper functions that allow to easily load neuronal morphologies from files into NeuroM data structures. It also provides convenient me... |
Lukx19/UvA-ML1 | 10158006_10185453_11896493_lab1.ipynb | mit | NAME = "Laura Ruis"
NAME2 = "Fredie Haver"
NAME3 = "Lukás Jelínek"
EMAIL = "lauraruis@live.nl"
EMAIL2 = "frediehaver@hotmail.com"
EMAIL3 = "lukas.jelinek1@gmail.com"
"""
Explanation: Save this file as studentid1_studentid2_lab#.ipynb
(Your student-id is the number shown on your student card.)
E.g. if you work with 3 p... |
Kaggle/learntools | notebooks/time_series/raw/tut3.ipynb | apache-2.0 | #$HIDE_INPUT$
import numpy as np
def fourier_features(index, freq, order):
time = np.arange(len(index), dtype=np.float32)
k = 2 * np.pi * (1 / freq) * time
features = {}
for i in range(1, order + 1):
features.update({
f"sin_{freq}_{i}": np.sin(i * k),
f"cos_{freq}_{i}":... |
AllenDowney/ThinkBayes2 | examples/urns.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import classes from thinkbayes2
from thinkbayes2 import Pmf, Suite
import thinkplot as tplt
"""
Expla... |
ajkerr0/kappa | tutorial/general.ipynb | mit | #put matplotlib plots in the notebook, then import the package
%matplotlib inline
import kappa
"""
Explanation: General Tutorial
This is an introductory tutorial for the python package currently called kappa. We will build molecules, draw them, and look at their attributes.
First we must import the package.
End of e... |
gregcaporaso/cual-id | assets/Figure-3.ipynb | bsd-3-clause | %matplotlib inline
from cualid import create_ids
import numpy as np
from difflib import get_close_matches
import pandas as pd
import seaborn as sns
import uuid
import itertools
def mutate_id(id_, n_mutations=3):
cols = np.random.choice(range(len(id_)), size=(n_mutations), replace=False)
mutated_id = list(id_)... |
jakeret/tf_unet | demo/demo_radio_data.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import glob
plt.rcParams['image.cmap'] = 'gist_earth'
"""
Explanation: Radio Frequency Interference mitigation using deep convolutional neural networks
This example demonstrates how tf_unet is trained on the 'Bleien Galactic Survey... |
rrbb014/data_science | fastcampus_dss/2016_05_25/0525_03__디리클레 분포.ipynb | mit | from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
fig = plt.figure()
ax = Axes3D(fig)
x = [1,0,0]
y = [0,1,0]
z = [0,0,1]
verts = [zip(x, y,z)]
ax.add_collection3d(Poly3DCollection(verts, edgecolor="k", lw=5, alpha=0.4))
ax.text(1, 0, 0, "(1,0,0)", position=(0.7,0.1))
ax.t... |
folivetti/BIGDATA | Spark/.ipynb_checkpoints/Lab03-Resposta-checkpoint.ipynb | mit | # Data for manual OHE
# Note: the first data point does not include any value for the optional third feature
sampleOne = [(0, 'mouse'), (1, 'black')]
sampleTwo = [(0, 'cat'), (1, 'tabby'), (2, 'mouse')]
sampleThree = [(0, 'bear'), (1, 'black'), (2, 'salmon')]
sampleDataRDD = sc.parallelize([sampleOne, sampleTwo, sampl... |
alistairwalsh/nefarious-meow | simplify clustering_example.ipynb | mit | from sklearn.ensemble import RandomForestClassifier
"""
Explanation: Random Forest classifier example
End of explanation
"""
from IPython.display import YouTubeVideo, HTML
YouTubeVideo("XOEN9W05_4A")
#The Donald Bren School of Information and Computer Sciences - University of California, Irvine
info_file = 'http:/... |
mne-tools/mne-tools.github.io | 0.18/_downloads/50f27a42fcbd35f08d90ddc7386b7140/plot_compute_raw_data_spectrum.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io, read_proj, read_selection
from mne... |
ireapps/cfj-2017 | exercises/04. Let's write a cleaning function-working.ipynb | mit | # first line defines the function and the argument
# ("row" is an arbitrary variable name)
"""
For the bank and institution name:
- strip whitespace
- uppercase the name
- replace '&' with 'AND'
n.b.: you can chain string methods together
"""
# strip whitespa... |
OpenWeavers/openanalysis | doc/Langauge/05-Functions.ipynb | gpl-3.0 | def fibonacci_first(n):
first,second = 0,1
while n != 0:
n, first, second = n - 1, second, first + second
return first
fibonacci_first(10) # Function call
"""
Explanation: Functions
If a task has to be performed in a program many times, it is better to code that task as a function. Function ... |
gfeiden/Notebook | Projects/upper_sco_age/isochrone_comparison.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Mass Track & Isochrone Comparisons
Comparing standard and magnetic isochrones at 10 Myr.
End of explanation
"""
std = np.genfromtxt('/Users/grefe950/evolve/dmestar/iso/gs98/p000/a0/amlt1884/dmestar_00010.0myr_z+0.00_a+0.00_phx.iso... |
tensorflow/hub | examples/colab/object_detection.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
amkatrutsa/MIPT-Opt | Fall2020/03-MatrixCalculus/jax_autodiff_tutorial.ipynb | mit | import jax
import jax.numpy as jnp
"""
Explanation: Automatic differentiation with JAX
Main features
Numpy wrapper
Auto-vectorization
Auto-parallelization (SPMD paradigm)
Auto-differentiation
XLA backend and JIT support
How to compute gradient of your objective?
Define it as a standard Python function
Call jax.grad... |
adrn/TwoFace | notebooks/figures/HighK-unimodal.ipynb | mit | unimodal_thejoker = []
with h5py.File(samples_file, 'r') as f:
for star in tqdm.tqdm(high_K_stars):
samples = JokerSamples.from_hdf5(f[star.apogee_id])
data = star.apogeervdata()
unimodal_thejoker.append(unimodal_P(samples, data))
unimodal_thejoker = np.array(unimodal_thejoker)
unimodal_th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.