repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
smorton2/think-stats | code/pandas_examples.ipynb | gpl-3.0 | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import nsfg
import first
import analytic
import thinkstats2
import seaborn
"""
Explanation: Pandas Examples
http://thinkstats2.com
Copyright 2017 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of explanatio... |
Kaggle/learntools | notebooks/geospatial/raw/ex5.ipynb | apache-2.0 | import math
import geopandas as gpd
import pandas as pd
from shapely.geometry import MultiPolygon
import folium
from folium import Choropleth, Marker
from folium.plugins import HeatMap, MarkerCluster
from learntools.core import binder
binder.bind(globals())
from learntools.geospatial.ex5 import *
"""
Explanation: In... |
mdbecker/daa_philly_2015 | DataPhilly_Analysis.ipynb | mit | %matplotlib inline
import seaborn as sns
import pandas as pd
from matplotlib import rcParams
# Modify aesthetics for visibility during presentation
sns.set_style('darkgrid', {'axes.facecolor': '#C2C2C8'})
sns.set_palette('colorblind')
# Make everything bigger for visibility during presentation
rcParams['figure.figsiz... |
CamDavidsonPilon/lifelines | examples/Proportional hazard assumption.ipynb | mit | from lifelines.datasets import load_rossi
rossi = load_rossi()
cph = CoxPHFitter()
cph.fit(rossi, 'week', 'arrest')
cph.print_summary(model="untransformed variables", decimals=3)
"""
Explanation: Testing the proportional hazard assumptions
This Jupyter notebook is a small tutorial on how to test and fix proportional... |
mdeff/ntds_2017 | projects/reports/brain_network/1_ntds_project.ipynb | mit | ##force not printing
%%capture
%matplotlib inline
!pip install h5py
import numpy as np
import h5py
from scipy import sparse
import IPython.display as ipd
import matplotlib.pyplot as plt
import re
import networkx as nx
import scipy as sp
import scipy.sparse as sps
##read .h5 file format containing the information ab... |
bioe-ml-w18/bioe-ml-winter2018 | homeworks/Week1-Introduction.ipynb | mit | %matplotlib inline
import numpy as np
from sklearn.datasets import load_boston
import matplotlib.pyplot as plt
"""
Explanation: Week 1 - Introduction
Due January 18 at 8 PM
A quick introduction to git and python.
Please run through this tutorial on how git functions. Further reading on git exists here.
For an introduc... |
bmorris3/boyajian_star_arces | kic8462852.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.time import Time
from toolkit import EchelleSpectrum
"""
Explanation: KIC 8462852 (Boyajian's Star) spectroscopic follow up
Brett Morris and Jim Davenport
Apache Point Observatory ARC 3.5 m telescope, ARCES ech... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MIROC
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propertie... |
SteveDiamond/cvxpy | examples/notebooks/WWW/fir_chebychev_design.ipynb | gpl-3.0 | import numpy as np
import cvxpy as cp
#********************************************************************
# Problem specs.
#********************************************************************
# Number of FIR coefficients (including the zeroth one).
n = 20
# Rule-of-thumb frequency discretization (Cheney's Approx. ... |
claudiuskerth/PhDthesis | Data_analysis/SNP-indel-calling/dadi/DEDUPLICATED/deduplicated_spectra.ipynb | mit | # load dadi module
import sys
sys.path.insert(0, '/home/claudius/Downloads/dadi')
import dadi
% ll
! cat ERY.unfolded.sfs.dadi
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a data-toc-modified-id="Plot-the-spectra-1" href="#Plot-the-spectra"><span class="toc-item-num">1 </span>Plot ... |
ledrui/Regression | week2/week-2-multiple-regression-assignment-1-blank.ipynb | mit | import graphlab
"""
Explanation: Regression Week 2: Multiple Regression (Interpretation)
The goal of this first notebook is to explore multiple regression and feature engineering with existing graphlab functions.
In this notebook you will use data on house sales in King County to predict prices using multiple regressi... |
mne-tools/mne-tools.github.io | 0.23/_downloads/eb0c29f55af0173daab811d4f4dc2f40/simulated_raw_data_using_subject_anatomy.ipynb | bsd-3-clause | # Author: Ivana Kojcic <ivana.kojcic@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Kostiantyn Maksymenko <kostiantyn.maksymenko@gmail.com>
# Samuel Deslauriers-Gauthier <sam.deslauriers@gmail.com>
# License: BSD (3-clause)
import os.path as op
import numpy as np
import mne
from mne.da... |
bmeaut/python_nlp_2017_fall | course_material/12_Semantics_1/12_Semantics_1_lab.ipynb | mit | !pip install nltk
"""
Explanation: 11. Semantics 1: words - Lab excercises
11.E1 Accessing WordNet using NLTK
11.E2 Using word embeddings
11.E3 Comparing WordNet and word embeddings
11.E1 Accessing WordNet using NLTK
<a id='11.E1'></a>
NLTK (Natural Language Toolkit) is a python library for accessing many NLP tools an... |
tuanavu/coursera-university-of-washington | machine_learning/4_clustering_and_retrieval/assigment/week5/.ipynb_checkpoints/module-8-boosting-assignment-1-graphlab-checkpoint.ipynb | mit | import sys
sys.path.append('C:\Anaconda2\envs\dato-env\Lib\site-packages')
import graphlab
"""
Explanation: Exploring Ensemble Methods
In this assignment, we will explore the use of boosting. We will use the pre-implemented gradient boosted trees in GraphLab Create. You will:
Use SFrames to do some feature engineerin... |
ray-project/ray | doc/source/tune/examples/tune-comet.ipynb | apache-2.0 | import numpy as np
from ray import tune
def train_function(config, checkpoint_dir=None):
for i in range(30):
loss = config["mean"] + config["sd"] * np.random.randn()
tune.report(loss=loss)
"""
Explanation: (tune-comet-ref)=
Using Comet with Tune
Comet is a tool to manage and optimize the
entire M... |
zauonlok/cs231n | 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
... |
galtay/keras_examples | examples_1.ipynb | gpl-3.0 | # set some constants
RAND_SEED_1 = 3826204
import numpy as np
np.random.seed(RAND_SEED_1)
import os
import pandas
import sklearn.datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import keras
from keras.models import Sequential
from keras.layers import Inp... |
yw-fang/readingnotes | machine-learning/Caicloud-book2017/tensorflow-note1.ipynb | apache-2.0 | import tensorflow as tf
a = tf.constant([1.0,2.0], name = "a")
b = tf.constant([1.0,2.0], name = "b")
c = a + b
with tf.Session() as sess:
sess.run(c)
print(c)#
"""
Explanation: Head First TensorFlow
Author: Yue-Wen FANG,
Contact: fyuewen@gmail.com
Revision history: created in late August 2017, at New York Uniersi... |
IanHawke/maths-with-python | 09-exceptions-testing.ipynb | mit | from __future__ import division
def divide(numerator, denominator):
"""
Divide two numbers.
Parameters
----------
numerator: float
numerator
denominator: float
denominator
Returns
-------
fraction: float
numerator / denominator
""... |
PySCeS/PyscesToolbox | documentation/notebooks/RateChar.ipynb | bsd-3-clause | mod = pysces.model('lin4_fb.psc')
rc = psctb.RateChar(mod)
"""
Explanation: RateChar
RateChar is a tool for performing generalised supply-demand analysis (GSDA) [5,6]. This entails the generation data needed to draw rate characteristic plots for all the variable species of metabolic model through parameter scans and t... |
ecell/ecell4-notebooks | en/tests/Homodimerization_and_Annihilation.ipynb | gpl-2.0 | %matplotlib inline
from ecell4.prelude import *
"""
Explanation: Homodimerization and Annihilation
This is for an integrated test of E-Cell4. Here, we test homodimerization and annihilation.
End of explanation
"""
D = 1
radius = 0.005
N_A = 60
ka_factor = 0.1 # 0.1 is for reaction-limited
N = 30 # a number of sam... |
parrt/msan501 | notes/files.ipynb | mit | f = open("data/prices.txt") # or just "prices.txt"
print(type(f))
print(f)
f.close()
print(f.closed)
"""
Explanation: Loading files
The goal of this lecture-lab is to learn how to extract data from files on your laptop's disk. We'll load words from a text file and numbers from data files. Along the way, we'll learn m... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_ml/td2a_correction_cl_reg_anomaly.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.data - Classification, régression, anomalies - correction
Le jeu de données Wine Quality Data Set contient 5000 vins décrits par leurs caractéristiques chimiques et évalués par un exp... |
arcyfelix/Courses | 18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/05-Miscellaneous-Topics/00-Deep-Nets-with-TF-Abstractions.ipynb | apache-2.0 | from sklearn.datasets import load_wine
wine_data = load_wine()
type(wine_data)
wine_data.keys()
print(wine_data.DESCR)
feat_data = wine_data['data']
labels = wine_data['target']
"""
Explanation: Deep Nets with TF Abstractions
Let's explore a few of the various abstractions that TensorFlow offers. You can check o... |
kaushik94/tardis | docs/research/code_comparison/plasma_compare/plasma_compare.ipynb | bsd-3-clause | from tardis.simulation import Simulation
from tardis.io.config_reader import Configuration
from IPython.display import FileLinks
"""
Explanation: Plasma comparison
End of explanation
"""
config = Configuration.from_yaml('tardis_example.yml')
sim = Simulation.from_config(config)
"""
Explanation: The example tardis_e... |
tensorflow/tflite-micro | third_party/xtensa/examples/pytorch_to_tflite/pytorch_to_tflite_converter/pytorch_to_onnx_to_tflite_int8.ipynb | apache-2.0 | !pip install onnx
!pip install onnxruntime
# Some standard imports
import numpy as np
import torch
import torch.onnx
import torchvision.models as models
import onnx
import onnxruntime
"""
Explanation: <a href="https://colab.research.google.com/github/nyadla-sys/pytorch_2_tflite/blob/main/pytorch_to_onnx_to_tflite(quan... |
kpolimis/kpolimis.github.io-src | output/downloads/notebooks/nba_mvp_comparisons-part_1.ipynb | gpl-3.0 | import os
import urllib
import webbrowser
import pandas as pd
from datetime import datetime
from bs4 import BeautifulSoup
"""
Explanation: NBA MVP Comparisons
Part 1
25 <sup>th</sup> December 2018
It's Christmas and that means a full slate of NBA games. This time of year also provokes some great NBA discussions and ... |
samstav/scipy_2015_sklearn_tutorial | notebooks/01.3 Data Representation for Machine Learning.ipynb | cc0-1.0 | from sklearn.datasets import load_iris
iris = load_iris()
"""
Explanation: Representation and Visualization of Data
Machine learning is about creating models from data: for that reason, we'll start by
discussing how data can be represented in order to be understood by the computer. Along
with this, we'll build on our... |
jupyter/nbgrader | nbgrader/docs/source/user_guide/downloaded/ps1/archive/ps1_hacker_attempt_2016-01-30-20-30-10_problem1.ipynb | bsd-3-clause | NAME = "Alyssa P. Hacker"
COLLABORATORS = "Ben Bitdiddle"
"""
Explanation: Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill i... |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/talks/GlobalDataScience/Mar272017-SantaClara-Deploy-SparkML-TensorflowAI/GlobalDataScience-SparkMLTensorflowAI-HybridCloud-ContinuousDeployment.ipynb | apache-2.0 | import numpy as np
import os
import tensorflow as tf
from tensorflow.contrib.session_bundle import exporter
import time
# make things wide
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
from IPython.display import clear_output, Image, display, HTML... |
Nozdi/first-steps-with-pandas-workshop | first-steps-with-pandas-with-solutions.ipynb | mit | import platform
print('Python: ' + platform.python_version())
import numpy as np
print('numpy: ' + np.__version__)
import pandas as pd
print('pandas: ' + pd.__version__)
import scipy
print('scipy: ' + scipy.__version__)
import sklearn
print('scikit-learn: ' + sklearn.__version__)
import matplotlib as plt
print('ma... |
Naereen/notebooks | simus/Naive_simulations_of_the_Monty-Hall_paradox.ipynb | mit | import random
M = 3
allocation = [False] * (M - 1) + [True] # Only 1 treasure!
assert set(allocation) == {True, False} # Check: only True and False
assert sum(allocation) == 1 # Check: only 1 treasure!
"""
Explanation: Numerical simulations of the Monty-Hall "paradox"
This short notebook aims at simula... |
sbu-python-summer/python-tutorial | day-1/python-advanced-datatypes.ipynb | bsd-3-clause | from __future__ import print_function
"""
Explanation: These notes follow the official python tutorial pretty closely: http://docs.python.org/3/tutorial/
End of explanation
"""
a = [1, 2.0, "my list", 4]
print(a)
"""
Explanation: Lists
Lists group together data. Many languages have arrays (we'll look at those in ... |
tensorflow/docs | site/en/tutorials/estimator/linear.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... |
apark263/tensorflow | tensorflow/contrib/eager/python/examples/generative_examples/image_captioning_with_attention.ipynb | apache-2.0 | # Import TensorFlow and enable eager execution
# This code requires TensorFlow version >=1.9
import tensorflow as tf
tf.enable_eager_execution()
# We'll generate plots of attention in order to see which parts of an image
# our model focuses on during captioning
import matplotlib.pyplot as plt
# Scikit-learn includes ... |
wonkoderverstaendige/RattusExMachina | doc/Playtesting.ipynb | mit | result_path = '../src/USB_Virtual_Serial_Rcv_Speed_Test/usb_serial_receive/host_software/'
print [f for f in os.listdir(result_path) if f.endswith('.txt')]
def read_result(filename):
results = {}
current_blocksize = None
with open(os.path.join(result_path, filename)) as f:
for line in f.readlines()... |
Aniruddha-Tapas/Applied-Machine-Learning | Machine Learning using GraphLab/Predicting House Prices using GraphLab Create.ipynb | mit | import graphlab
"""
Explanation: Predicting House Prices using GraphLab Create
Install GraphLab Create using the official guide
Fire up graphlab create
End of explanation
"""
sales = graphlab.SFrame('home_data.gl/')
sales
"""
Explanation: Load some house sales data
Dataset is from house sales in King County, the... |
metpy/MetPy | v1.1/_downloads/cdca3e0cb8a2930cccab0e29b97ef52a/upperair_soundings.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import Hodograph, SkewT
from metpy.units import units
"""
Explanation: Upper Air Sounding Tutorial
Upper air analysis is a... |
y2ee201/Deep-Learning-Nanodegree | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
satishgoda/learning | prg/web/javascript/libs/d3/d3_1_intro.ipynb | mit | %%javascript
require.config({
paths: {
d3: '//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min',
}
});
"""
Explanation: View this document in jupyter nbviewer
References
http://blog.thedataincubator.com/2015/08/embedding-d3-in-an-ipython-notebook
https://github.com/cmoscardi/embedded_d3_example/blob/maste... |
DwangoMediaVillage/pqkmeans | tutorial/2_image_clustering.ipynb | mit | import numpy
import pqkmeans
import tqdm
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Chapter 2: Image clustering
This chapter contains the followings:
Read images from the CIFAR10 dataset
Extract a deep feature (VGG16 fc6 activation) from each image using Keras
Run clustering on deep features
... |
jpopham91/nhl15-analytics | Untitled.ipynb | mit | ## import statements
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
## set up plotting aesthetics
sns.set(rc={'axes.facecolor' : '#202020',
'axes.labelcolor' : '#e0e0e0',
'axes.edgecolor' : '#e0e0e0'... |
gganssle/dB-vs-perc | dB-vs-perc.ipynb | mit | # percentage function, v = new value, r = reference value
def perc(v,r):
return 100 * (v / r)
"""
Explanation: Decibels vs. Percentages
Percentages are simple, right? I bought four oranges. I ate two. What percentage of the original four do I have left? 50%. Easy.
How many decibels down in oranges am I? Not so eas... |
dtamayo/reboundx | ipython_examples/ParameterInterpolation.ipynb | gpl-3.0 | import numpy as np
data = np.loadtxt('m.txt') # return (N, 2) array
mtimes = data[:, 0] # return only 1st col
masses = data[:, 1] # return only 2nd col
data = np.loadtxt('r.txt')
rtimes = data[:, 0]
Rsuns = data[:, 1] # data in Rsun units
# convert Rsun to AU
radii = np.zeros(Rsuns.size)
for i,... |
lfz/Guided-Denoise | prepare_data.ipynb | apache-2.0 | imagenet_path = '/work/imagenet/train/'
path2 = './Originset/'
n_per_class = 4 # train
n_per_class_test = [10,40] # test
n_train = int(n_per_class*0.75 )
subdirs = os.listdir(imagenet_path)
subdirs = np.sort(subdirs)
label_mapping={}
example = pandas.read_csv('./sample_dev_dataset.csv')
for id,name in enumerate(subdi... |
xlbaojun/Note-jupyter | 05其他/pandas文档-zh-master/.ipynb_checkpoints/数据结构的内置方法-checkpoint.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
index = pd.date_range('1/1/2000', periods=8)
s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])
df = pd.DataFrame(np.random.randn(8, 3), index=index, columns=['A', 'B', 'C'])
wp = pd.Panel(np.random.randn(2,5,4), items=['Item1', 'Item2'], major_axis=pd.date_range... |
peap/notebooks | pycon-2015/d01t01.minecraft.ipynb | mit | from mcpi import minecraft
mc = minecraft.Minecraft.create(ip, port, my_name)
# send a chat message
mc.....
# teleport
mc.player.getPos() # returns a Vec3 instance; could also get pitch/orientation of player
mv.player.setPos(pos_vector)
# place blocks
from mcpi import block
mc.setBlock(x, y, z, block.STONE)
mv.se... |
mne-tools/mne-tools.github.io | 0.20/_downloads/caf43e32a02942fa21bbe6ad66eceb14/plot_label_from_stc.ipynb | bsd-3-clause | # Author: Luke Bloy <luke.bloy@gmail.com>
# Alex Gramfort <alexandre.gramfort@inria.fr>
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.minimum_norm import read_inverse_operator, apply_inverse
from mne.datasets import sample
print(__doc__)
data_path = sample.... |
stubz/deep-learning | embeddings/Skip-Grams-Solution.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
Kaggle/learntools | notebooks/deep_learning_intro/raw/ex1.ipynb | apache-2.0 | # Setup plotting
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
# Set Matplotlib defaults
plt.rc('figure', autolayout=True)
plt.rc('axes', labelweight='bold', labelsize='large',
titleweight='bold', titlesize=18, titlepad=10)
# Setup feedback system
from learntools.core import binder
binder.... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/SDK_AutoML_Video_Action_Recognition.ipynb | apache-2.0 | !pip3 uninstall -y google-cloud-aiplatform
!pip3 install google-cloud-aiplatform
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(True)
"""
Explanation: Feedback or issues?
For any feedback or questions, please open an issue.
Vertex SDK for Python: AutoML Video Action Recognition Example
To ... |
tensorflow/docs-l10n | site/en-snapshot/probability/examples/Multiple_changepoint_detection_and_Bayesian_model_selection.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
jarrison/trEFM-learn | Examples/demo.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from trEFMlearn import data_sim
%matplotlib inline
"""
Explanation: Welcome!
Let's start by assuming you have downloaded the code, and ran the setup.py . This demonstration will show the user how predict the time constant of their trEFM data using the methods of stati... |
mne-tools/mne-tools.github.io | 0.17/_downloads/96cf5c207119de22548efa8f14198f9e/plot_artifacts_correction_rejection.ipynb | bsd-3-clause | # sphinx_gallery_thumbnail_number = 3
import numpy as np
import mne
from mne.datasets import sample
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(raw_fname) # already has an EEG ref
"""
Explanation: Rejecting bad data (channels and seg... |
UltronAI/Deep-Learning | CS231n/assignment2/ConvolutionalNetworks.ipynb | mit | # As usual, a bit of setup
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.cnn import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
fro... |
tensorflow/docs-l10n | site/ko/tutorials/distribute/custom_training.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... |
NSLS-II-HXN/PyXRF | examples/Batch_mode_fit.ipynb | bsd-3-clause | param_file = '2468_fitting.json' # parameter file to fit all the data
for fname in filelist:
fit_pixel_data_and_save(wd, fname, param_file_name=param_file)
"""
Explanation: Batch mode to fit spectrum from detector sum
if the detector is well aligned, you can fit the summed spectrum from each detector
End of... |
adrn/TriandRRLyrae | notebooks/Target selection.ipynb | mit | d = triand['dh'].data
d_cut = (d > 15) & (d < 21)
triand_dist = triand[d_cut]
c_triand = _c_triand[d_cut]
print(len(triand_dist))
plt.hist(triand_dist['<Vmag>'].data)
"""
Explanation: Now a distance cut:
End of explanation
"""
ptf_triand = ascii.read("/Users/adrian/projects/streams/data/observing/triand.txt")
ptf_... |
NYUDataBootcamp/Projects | UG_S16/Breitstone-Patel-NLTK.ipynb | mit | import nltk
#nltk.download()
"""
Explanation: Estimating Sentiment Orientation with SKLearn
Jason Brietstone jb4562@nyu.edu & Amar Patel acp455@stern.nyu.edu
Natural language processsing is a booming field in the finance industry because of the massive amounts of user generated data that has recently become avaiable f... |
antoniomezzacapo/qiskit-tutorial | community/teach_me_qiskit_2018/e91_qkd/e91_quantum_key_distribution_protocol.ipynb | apache-2.0 | # useful additional packages
import numpy as np
import random
# regular expressions module
import re
# importing the QISKit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer
# import basic plot tools
from qiskit.tools.visualization import circuit_drawer, plot_histogram
"""
Explanat... |
fionapigott/Data-Science-45min-Intros | python-decorators-101/python-decorators-101.ipynb | unlicense | def duplicator(str_arg):
"""Create a string that is a doubling of the passed-in arg."""
# use the passed arg to create a larger string (double it, with a space between)
internal_variable = ' '.join( [str_arg, str_arg] )
return internal_variable
# print (don't call) the function
print( duplicator... |
mbeyeler/opencv-machine-learning | notebooks/06.02-Detecting-Pedestrians-in-the-Wild.ipynb | mit | datadir = "data/chapter6"
dataset = "pedestrians128x64"
datafile = "%s/%s.tar.gz" % (datadir, dataset)
"""
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="width: 76px; height... |
mguerrap/tydal | Module2.ipynb | mit | import tydal.module2_utils as tide
import tydal.quiz2
stationmap = tide.add_station_maps()
stationmap
"""
Explanation: Module 2: Tides in the Puget Sound
Learning Objectives
I. Tidal Movement
II. Tidal Cycle and Connection to Sea Surface Elevation
Let's take a closer look at the movement of tides through the Strait ... |
kit-cel/wt | mloc/ch1_Preliminaries/Newton_method.ipynb | gpl-2.0 | import importlib
autograd_available = True
# if automatic differentiation is available, use it
try:
import autograd
except ImportError:
autograd_available = False
pass
if autograd_available:
import autograd.numpy as np
from autograd import grad, hessian
else:
import numpy as np
import matp... |
paultheastronomer/OAD-Data-Science-Toolkit | Teaching Materials/Machine Learning/ml-training-intro/notebooks/07 - Trees.ipynb | gpl-3.0 | from sklearn.tree import DecisionTreeClassifier, export_graphviz
tree = DecisionTreeClassifier(max_depth=2)
tree.fit(X_train, y_train)
tree_dot = export_graphviz(tree, out_file=None, feature_names=cancer.feature_names, filled=True)
print(tree_dot)
import graphviz
graphviz.Source(tree_dot)
"""
Explanation: tree visu... |
Naereen/notebooks | agreg/Algorithme de Cocke-Kasami-Younger (python3).ipynb | mit | # On a besoin de listes et de tuples
from typing import List, Tuple # Module disponible en Python version >= 3.5
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Table-des-matières" data-toc-modified-id="Table-des-matières-1"><span class="toc-item-num">1 </span>Table des matières<... |
tensorflow/privacy | tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/codelabs/word2vec_codelab.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... |
lisa-1010/smart-tutor | code/experiment_setup_step_by_step.ipynb | mit | n_students = 10000
seqlen = 100
concept_tree = cdg.ConceptDependencyGraph()
concept_tree.init_default_tree(n=N_CONCEPTS)
print ("Initializing synthetic data sets...")
for policy in ['random', 'expert', 'modulo']:
filename = "{}stud_{}seq_{}.pickle".format(n_students, seqlen, policy)
dgen.generate_data(concept_t... |
tuanavu/coursera-university-of-washington | machine_learning/4_clustering_and_retrieval/assigment/week6/6_hierarchical_clustering_blank.ipynb | mit | import graphlab
import matplotlib.pyplot as plt
import numpy as np
import sys
import os
import time
from scipy.sparse import csr_matrix
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances
%matplotlib inline
'''Check GraphLab Create version'''
from distutils.version import StrictVersion
as... |
pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/examples/IPython Kernel/Cell Magics.ipynb | gpl-2.0 | %lsmagic
"""
Explanation: Cell Magics in IPython
IPython has a system of commands we call 'magics' that provide a mini command language that is orthogonal to the syntax of Python and is extensible by the user with new commands. Magics are meant to be typed interactively, so they use command-line conventions, such as ... |
ireapps/cfj-2017 | completed/05. pandas? pandas! (Part 1).ipynb | mit | import pandas as pd
"""
Explanation: Automate your analysis with pandas
Automating your data analysis is one of the most powerful things you can do with Python in a newsroom. We're going to use a library called pandas that will leave a replicable, transparent script for others to follow.
Warmup: MLB salary data
Rememb... |
ledeprogram/algorithms | class10/donow/Lee_Dongjin_10_donow.ipynb.ipynb | gpl-3.0 | import pg8000
conn = pg8000.connect(host='training.c1erymiua9dx.us-east-1.rds.amazonaws.com', database="training", port=5432, user='dot_student', password='qgis')
cursor = conn.cursor()
database=cursor.execute("SELECT * FROM winequality")
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd... |
JohnGriffiths/ConWhAt | docs/examples/assessing_the_network_impact_of_lesions.ipynb | bsd-3-clause | # ConWhAt stuff
from conwhat import VolConnAtlas,StreamConnAtlas,VolTractAtlas,StreamTractAtlas
from conwhat.viz.volume import plot_vol_scatter
# Neuroimaging stuff
import nibabel as nib
from nilearn.plotting import (plot_stat_map,plot_surf_roi,plot_roi,
plot_connectome,find_xyz_cut_coords... |
wakkadojo/OperationPeanut | oldModels/AlmondNut_PreMomentum.ipynb | gpl-3.0 | def attach_ratings_diff_stats(df, ratings_eos, season):
out_cols = list(df.columns) + ['mean_rtg_1', 'std_rtg_1', 'num_rtg_1', 'mean_rtg_2', 'std_rtg_2', 'num_rtg_2']
rtg_1 = ratings_eos.rename(columns = {'mean_rtg' : 'mean_rtg_1', 'std_rtg' : 'std_rtg_1', 'num_rtg' : 'num_rtg_1'})
rtg_2 = ratings_eos.renam... |
tensorflow/docs-l10n | site/zh-cn/guide/saved_model.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... |
mpanteli/music-outliers | notebooks/sensitivity_experiment_outliers.ipynb | mit | results_file = '../data/lda_data_8.pickle'
n_iters = 10
for n in range(n_iters):
print "iteration %d" % n
print results_file
X, Y, Yaudio = classification.load_data_from_pickle(results_file)
# get only 80% of the dataset.. to vary the choice of outliers
X, _, Y, _ = train_test_split(X, Y, train_size... |
ssunkara1/bqplot | examples/Marks/Object Model/Lines.ipynb | apache-2.0 | import numpy as np #For numerical programming and multi-dimensional arrays
from pandas import date_range #For date-rate generation
from bqplot import * #We import the relevant modules from bqplot
"""
Explanation: The Lines Mark
Lines is a Mark object that is primarily used to visualize quantitative data. It works part... |
parrt/msan501 | notes/aliasing.ipynb | mit | x = y = 7
print(x,y)
"""
Explanation: Data aliasing
One of the trickiest things about programming is figuring out exactly what data a variable refers to. Remember that we use names like data and salary to represent memory cells holding data values. The names are easier to remember than the physical memory addresses, b... |
DallasTrinkle/Onsager | examples/GF-convergence.ipynb | mit | import sys
sys.path.extend(['../'])
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
%matplotlib inline
import onsager.crystal as crystal
import onsager.GFcalc as GFcalc
"""
Explanation: Convergence of Green function calculation
We check the convergence with $N_\text{kpt}$ for the ... |
molgor/spystats | notebooks/Analysis of spatial models using systematic and random samples.ipynb | bsd-2-clause | #new_data = prepareDataFrame("/RawDataCSV/idiv_share/plotsClimateData_11092017.csv")
## En Hec
#new_data = prepareDataFrame("/home/hpc/28/escamill/csv_data/idiv/plotsClimateData_11092017.csv")
## New "official" dataset
new_data = prepareDataFrame("/RawDataCSV/idiv_share/FIA_Plots_Biomass_11092017.csv")
#IN HEC
#new_da... |
sserkez/ocelot | test/workshop/2_tracking.ipynb | gpl-3.0 | # the output of plotting commands is displayed inline within frontends,
# directly below the code cell that produced it
%matplotlib inline
# this python library provides generic shallow (copy) and deep copy (deepcopy) operations
from copy import deepcopy
# import from Ocelot main modules and functions
from ocelot i... |
alasdairtran/mclearn | projects/alasdair/notebooks/02_exploratory_analysis.ipynb | bsd-3-clause | # remove after testing
%load_ext autoreload
%autoreload 2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from urllib.request import urlopen
from sklearn.decomposition import PCA
from mclearn.viz import (plot_class_distribution,
plot_hex_map,
... |
gdementen/larray | doc/source/tutorial/tutorial_combine_arrays.ipynb | gpl-3.0 | from larray import *
# load the 'demography_eurostat' dataset
demography_eurostat = load_example_data('demography_eurostat')
# load 'gender' and 'time' axes
gender = demography_eurostat.gender
time = demography_eurostat.time
# load the 'population' array from the 'demography_eurostat' dataset
population = demography... |
irsisyphus/machine-learning | 4 Data Processing.ipynb | apache-2.0 | import pandas as pd
wine_data_remote = 'https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data'
wine_data_local = '../datasets/wine/wine.data'
df_wine = pd.read_csv(wine_data_remote,
header=None)
df_wine.columns = ['Class label', 'Alcohol', 'Malic acid', 'Ash',
... |
probml/pyprobml | notebooks/misc/linreg_hierarchical_pymc3.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pymc3 as pm
import pandas as pd
url = "https://github.com/twiecki/WhileMyMCMCGentlySamples/blob/master/content/downloads/notebooks/radon.csv?raw=true"
data = pd.read_csv(url)
county_names = data.county.unique()
county_idx = data["county_cod... |
keras-team/keras-io | examples/vision/ipynb/vit_small_ds.ipynb | apache-2.0 | import math
import numpy as np
import tensorflow as tf
from tensorflow import keras
import tensorflow_addons as tfa
import matplotlib.pyplot as plt
from tensorflow.keras import layers
# Setting seed for reproducibiltiy
SEED = 42
keras.utils.set_random_seed(SEED)
"""
Explanation: Train a Vision Transformer on small da... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Distribution Plots.ipynb | mit | import seaborn as sns
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Distribution Plots
Let's discuss some plots that allow us to visualize the distribution of a data set. These plots are:
distplot
jointplot
pairplot
rugplot
kdeplot
Imports
End ... |
DS-100/sp17-materials | sp17/hw/hw2/hw2.ipynb | gpl-3.0 | import math
import numpy as np
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('hw2.ok')
"""
Explanation: Homework 2: Language in the 2016 Presidential Election
Popular figures often have help managing their media presenc... |
brsaylor/atn-tools | notebooks/parameter-space-coverage-3d.ipynb | gpl-3.0 | import random
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.offline as offline
offline.init_notebook_mode(connected=True)
"""
Explanation: Parameter space coverage 3D graphs
See the parameter-space-coverage notebook for more information.
End of explanation
"""
sample_si... |
xunilrj/sandbox | courses/IMTx-Queue-Theory/Week1_Lab_Random_Variables.ipynb | apache-2.0 | %matplotlib inline
from pylab import *
N = 10**5
lambda_ = 2.0
########################################
# Supply the missing coefficient herein below
V1 = -1.0/lambda_
data = V1*log(rand(N))
########################################
m = mean(data)
v = var(data)
print("\u03BB={0}: m=... |
IS-ENES-Data/submission_forms | test/forms/test/.ipynb_checkpoints/test_ki_12345-checkpoint.ipynb | apache-2.0 | # please edit the (red) information below: Name, email and project the data belongs to
from dkrz_forms import form_handler
my_project = "DKRZ_CDP"
my_first_name = "...." # example: sf.first_name = "Harold"
my_last_name = "...." # example: sf.last_name = "Mitty"
my_email = "...." # example: sf.email = "Mr.Mitt... |
mne-tools/mne-tools.github.io | 0.24/_downloads/b6ccbb801939862ed915d2c7295ac245/sensor_permutation_test.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne import io
from mne.stats import permutation_t_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Permutation T-test on sensor data
One tests if the signal significantly devi... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/ml_fairness_explainability/explainable_ai/labs/xai_image_caip.ipynb | apache-2.0 | from datetime import datetime
TIMESTAMP = datetime.now().strftime("%Y%m%d%H%M%S")
import os
PROJECT_ID = "" # TODO: your PROJECT_ID here.
os.environ["PROJECT_ID"] = PROJECT_ID
BUCKET_NAME = PROJECT_ID # TODO: replace your BUCKET_NAME, if needed
REGION = "us-central1"
os.environ["BUCKET_NAME"] = BUCKET_NAME
os.en... |
dbkinghorn/blog-jupyter-notebooks | ML-Logistic-Regression-theory.ipynb | gpl-3.0 | import numpy as np # numeriacal computing
import matplotlib.pyplot as plt # plotting core
import seaborn as sns # higher level plotting tools
%matplotlib inline
sns.set()
def g(z) : # sigmoid function
return 1/(1 + np.exp(-z))
z = np.linspace(-10,10,100)
plt.plot(z, g(z))
plt.title("Sigmoid Function g(z) = 1... |
kit-cel/wt | ccgbc/Guest_Lecture_Coding_Learning/Neural_decoding_Deep_Unfolding.ipynb | gpl-2.0 | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import tensorflow as tf
import numpy as np
from pprint import pprint
%matplotlib inline
import matplotlib.pyplot as plt
seed = 1337
tf.set_random_seed(seed)
np.random.seed(seed)
"""
Explanation: Deep Learning for Communications
By Jakob Hoydis,
Contact jakob.hoydis... |
prk327/CoAca | 2_Indexing_and_Selecting_Data.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
market_df = pd.read_csv("../global_sales_data/market_fact.csv")
market_df.head()
"""
Explanation: Indexing and Selecting Data
In this section, you will:
Select rows from a dataframe
Select columns from a dataframe
Select subsets of dataframes
Selecting Rows
Selecting rows in d... |
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part07-e01_sequence_analysis/src/project_notebook_sequence_analysis.ipynb | gpl-3.0 | from collections import defaultdict
from itertools import product
import numpy as np
from numpy.random import choice
"""
Explanation: Sequence Analysis with Python
Contact: Veli Mäkinen veli.makinen@helsinki.fi
The following assignments introduce applications of hashing with dict() primitive of Python. While doing so... |
datamicroscopes/release | examples/normal-inverse-wishart.ipynb | bsd-3-clause | import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_context('talk')
sns.set_style('darkgrid')
"""
Explanation: Real Valued Data and the Normal Inverse-Wishart Distribution
One of the most common forms of data is real valued data
Let's set up our envi... |
mne-tools/mne-tools.github.io | 0.20/_downloads/ae8fb158e1a8fbcc6dff5d3e55a698dc/plot_30_filtering_resampling.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
raw.crop(0, ... |
agushman/coursera | src/cours_3/week_4/edit_CookingLDA_PA.ipynb | mit | import json
with open("recipes.json") as f:
recipes = json.load(f)
print(recipes[0])
"""
Explanation: Programming Assignment:
Готовим LDA по рецептам
Как вы уже знаете, в тематическом моделировании делается предположение о том, что для определения тематики порядок слов в документе не важен; об этом гласит гипоте... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.