repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
OpenBookProjects/ipynb | _data-sci-cases/PyData2015Paris-pandas_introduction.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
pd.options.display.max_rows = 8
"""
Explanation: <CENTER>
<img src="img/PyDataLogoBig-Paris2015.png" width="50%">
<header>
<h1>Introduction to Pandas</h1>
<h3>April 3rd, 2015</h3>
<h2>Joris Van den Bos... |
arsenovic/clifford | docs/tutorials/cga/clustering.ipynb | bsd-3-clause | from clifford.g3c import *
print('e1*e1 ', e1*e1)
print('e2*e2 ', e2*e2)
print('e3*e3 ', e3*e3)
print('e4*e4 ', e4*e4)
print('e5*e5 ', e5*e5)
"""
Explanation: This notebook is part of the clifford documentation: https://clifford.readthedocs.io/.
Example 2 Clustering Geometric Objects
In this example we will look at a ... |
volodymyrss/3ML | examples/MULTINEST parallel demo.ipynb | bsd-3-clause | from ipyparallel import Client
rc = Client(profile='mpi')
# Grab a view
view = rc[:]
# Activate parallel cell magics
view.activate()
"""
Explanation: Parallel MULTINEST with 3ML
J. Michael Burgess
MULTINEST
MULTINEST is a Bayesian posterior sampler that has two distinct advantages over traditional MCMC:
* Recovering ... |
patrick-kidger/diffrax | examples/latent_ode.ipynb | apache-2.0 | import time
import diffrax
import equinox as eqx
import jax
import jax.nn as jnn
import jax.numpy as jnp
import jax.random as jrandom
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import optax
matplotlib.rcParams.update({"font.size": 30})
"""
Explanation: Latent ODE
This example trains a Late... |
YAtOff/python0-reloaded | week5/Booleans and if.ipynb | mit | seconds = 30
0 <= seconds <= 59
seconds = -1
0 <= seconds <= 59
"""
Explanation: Изразът 0 <= seconds <= 59 e булев и има стойност True или False.
End of explanation
"""
def valid_seconds(seconds):
if True:
return True
else:
return False
"""
Explanation: Т. е. горната функция е еквива... |
as595/AllOfYourBases | MISC/NVSS_selection.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: [171009 - AMS] Original script written
This script illustrates the obervational selection bias in the P-D diagram distribution of radio galaxies shown in Fig. 7 of https://arxiv.org/abs/1704.00516.
We want our plots to appear in line with the script rather than as separate windows:... |
mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.01 - Functional Programming/01_01_Functional_Programming_Introduction.ipynb | gpl-3.0 | # not so functional function
a = 0
def global_sum(x):
global a
x += a
return x
print(global_sum(1))
print(a)
a = 11
print(global_sum(1))
print(a)
# not so functional function
a = 0
def global_sum(x):
global a
return x + a
print(global_sum(x=1))
print(a)
a = 11
print(global_sum(x=1))
print(a)
"... |
letsgoexploring/linearsolve-package | docs/source/examples.ipynb | mit | # Import numpy, pandas, linearsolve, matplotlib.pyplot
import numpy as np
import pandas as pd
import linearsolve as ls
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
# Input model parameters
parameters = pd.Series(dtype=float)
parameters['alpha'] = .35
parameters['beta'] = 0.99
parameter... |
yw-fang/readingnotes | machine-learning/GitHub/Git_in_pycharm.ipynb | apache-2.0 | ssh-keygen -t rsa -b 4096 -C "fyuewen@hotmail.com"
"""
Explanation: 1. version control using git built in pycharm
When using pycharm in Ubuntu, I got an error associated id_rsa. I was clear that this error must be caused by my settings on the shsh keys. In this ubuntu, I have generated muliple ssh private/public key p... |
Kaggle/learntools | notebooks/nlp/raw/ex3.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import spacy
# Set up code checking
from learntools.core import binder
binder.bind(globals())
from learntools.nlp.ex3 import *
print("\nSetup complete")
# Load the large model to get the vectors
nlp = spacy.load('en_core_web_lg... |
zklgame/CatEyeNets | test/two_layer_net.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'] = ... |
natashabatalha/PandExo | notebooks/HST_WFC3.ipynb | gpl-3.0 | import sys
sys.path.append('..')
import pandexo.engine.justdoit as jdi
"""
Explanation: HST's Tranisting Exoplanet Noise Simulator
This file demonstrates how to predict the:
1. Transmission/emission spectrum S/N ratio
2. Observation start window
for any system observed with WFC3/IR.
Background information
Pand... |
bioinf-jku/SNNs | TF_1_x/SelfNormalizingNetworks_MLP_MNIST.ipynb | gpl-3.0 | import tensorflow as tf
import numpy as np
from sklearn.preprocessing import StandardScaler
import numbers
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_util
from tensorflow.python.ops import math_ops
from tensorflow.pyth... |
jlgelpi/BioPhysics | Notebooks/6m0j_check.ipynb | mit | %load_ext autoreload
%autoreload 2
"""
Explanation: Structure checking tutorial
A complete checking analysis of a single structure follows.
use .revert_changes() at any time to recover the original structure
Structure checking is a key step before setting up a protein system for simulations.
A number of normal issues... |
eford/rebound | ipython_examples/Testparticles.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1e-3, a=1, e=0.05)
sim.move_to_com()
sim.integrator = "whfast"
sim.dt = 0.05
sim.status()
"""
Explanation: Test particles
In this tutorial, we run a simulation with many test particles. A simulation with test particles can be much faster, because it sc... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_brainstorm_auditory.ipynb | bsd-3-clause | # Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
import os.path as op
import pandas as pd
import numpy as np
import mne
from mne import combine_evoked
from mne.minimum_norm impor... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/03_model_performance/c_custom_keras_estimator.ipynb | apache-2.0 | import tensorflow as tf
import numpy as np
import shutil
print(tf.__version__)
"""
Explanation: Custom Estimator with Keras
Learning Objectives
- Learn how to create custom estimator using tf.keras
Introduction
Up until now we've been limited in our model architectures to premade estimators. But what if we want more c... |
stubz/deep-learning | 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... |
jphall663/GWU_data_mining | 10_model_interpretability/src/mono_xgboost.ipynb | apache-2.0 | # imports
import h2o
from h2o.estimators.xgboost import H2OXGBoostEstimator
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import pandas as pd
import xgboost as xgb
# start h2o
h2o.init()
h2o.remove_all()
"""
Explanation: License
Copyright 2017 J. Patrick Hall, jphall@gwu.edu
Permission is her... |
ktmud/deep-learning | IMDB-keras/IMDB_In_Keras.ipynb | mit | # Imports
import numpy as np
import keras
from keras.datasets import imdb
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.preprocessing.text import Tokenizer
import matplotlib.pyplot as plt
%matplotlib inline
np.random.seed(42)
"""
Explanation: Analyzing IMDB Data in... |
Kaggle/learntools | notebooks/sql_advanced/raw/ex2.ipynb | apache-2.0 | # Set up feedback system
from learntools.core import binder
binder.bind(globals())
from learntools.sql_advanced.ex2 import *
print("Setup Complete")
"""
Explanation: Introduction
Here, you'll use window functions to answer questions about the Chicago Taxi Trips dataset.
Before you get started, run the code cell below ... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/dev/n02_separating_the_test_set.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10.0)
%load_ext autoreload
%autoreload 2
sys.path.append('../')
"""
Explanation: ... |
SinaraGharibyan/SinaraGharibyan.github.io | CB/Appendix2.ipynb | mit | from BeautifulSoup import *
import requests
url = "https://careercenter.am/ccidxann.php"
response = requests.get(url)
page = response.text
soup = BeautifulSoup(page)
tables = soup.findAll("table")
my_table = tables[0]
rows = my_table.findAll('tr')
data_list = []
for i in rows:
columns = i.findAll('td')
for j ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/7aed4bc8cd1643f9a23125c34f543ae6/plot_59_head_positions.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from os import path as op
import mne
print(__doc__)
data_path = op.join(mne.datasets.testing.data_path(verbose=True), 'SSS')
fname_raw = op.join(data_path, 'test_move_anon_raw.fif')
raw = mne.io.read_raw_fif(fname_raw, allow_maxshield='yes... |
DS-100/sp17-materials | sp17/labs/lab11/lab11_solution.ipynb | gpl-3.0 | !pip install -U sklearn
import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn as skl
import sklearn.linear_model as lm
import scipy.io as sio
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('lab11.ok')
"""
Explanatio... |
compmech/meshless | notebooks/example_buckling_composite_plate.ipynb | bsd-2-clause | a = 0.5
b = 0.5
E1 = 49.627e9
E2 = 15.43e9
nu12 = 0.38
G12 = 4.8e9
G13 = 4.8e9
G23 = 4.8e9
laminaprop = (E1, E2, nu12, G12, G13, G23)
tmap = {
45: 0.143e-3,
-45: 0.143e-3,
0: 1.714e-3
}
X = 4
angles = [-45, +45, 0, +45, -45, 0]*X + [0, -45, +45, 0, +45, -45]*X
plyts = [tmap[angle] for angle in a... |
LDSSA/learning-units | units/11-validation-metrics/practice/Exercise - Validation Metrics for Classification.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, precision_score, \
recall_score, f1_score, roc_auc_score, roc_curve, confusion_matrix
from sklearn.model_selection import train_test_split
%matplot... |
nipunsadvilkar/ProbabilityForHackers | Introducing Random Variables.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
from itertools import product
# from IPython.core.display import HTML
# css = open('media/style-table.css').read() + open('media/style-notebook.css').read()
# HTML('<style>{}</style>'.format(css))
one_toss = np.array(['H', 'T'])
two_tosses = list(product(one_t... |
michrawson/nyu_ml_lectures | notebooks/03.1 Case Study - Supervised Classification of Handwritten Digits.ipynb | cc0-1.0 | from sklearn.datasets import load_digits
digits = load_digits()
"""
Explanation: Supervised Learning: Classification of Handwritten Digits
In this section we'll apply scikit-learn to the classification of handwritten
digits. This will go a bit beyond the iris classification we saw before: we'll
discuss some of the me... |
jseabold/statsmodels | examples/notebooks/markov_autoregression.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
import requests
from io import BytesIO
# NBER recessions
from pandas_datareader.data import DataReader
from datetime import datetime
usrec = DataReader('USREC', 'fred', start=datetime(1947, 1, 1), en... |
xmnlab/pywim | notebooks/WeightEstimation.ipynb | mit | from IPython.display import display
from matplotlib import pyplot as plt
from scipy import integrate
import numpy as np
import pandas as pd
import peakutils
import sys
# local
sys.path.insert(0, '../')
from pywim.estimation.speed import speed_by_peak
from pywim.utils import storage
from pywim.utils.dsp import wave_c... |
chrisbarnettster/cfg-analysis-on-heroku-jupyter | notebooks/notebooks/othernotebook.ipynb | mit | import numpy as np
np.random.seed(data_id)
data = np.random.randn(100)
"""
Explanation: Notebook arguments
data_id (int): Select which data file to load. Valid values: 0, 1, 2.
analysis_type (string): Which analysis type to perform. Valid valuse 'a', 'b' and 'c'
Template Notebook
<p class=lead>This notebook (prete... |
arcyfelix/Courses | 18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/04-Recurrent-Neural-Networks/02-Time-Series-Exercise.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Time Series Exercise -
Follow along with the instructions in bold. Watch the solutions video if you get stuck!
The Data
Source: https://datamarket.com/data/set/22ox/monthly-milk-production-pounds-per-cow-jan-62-... |
boffi/boffi.github.io | dati_2015/01/.ipynb_checkpoints/Resonance-checkpoint.ipynb | mit | def x_2z_over_dst(z):
w = 2*pi
# beta = 1, wn =w
wd = w*sqrt(1-z*z)
# Clough Penzien p. 43
A = z/sqrt(1-z*z)
def f(t):
return (cos(wd*t)+A*sin(wd*t))*exp(-z*w*t)-cos(w*t)
return pl.vectorize(f)
"""
Explanation: Resonant excitation
We want to study the behaviour of an undercritically... |
ProfessorKazarinoff/staticsite | content/code/pint/diffusion_problem_with_python_pint.ipynb | gpl-3.0 | import pint
from math import exp, sqrt
u = pint.UnitRegistry()
"""
Explanation: I was working through a diffusion problem and thought that Python and a package for dealing with units and unit conversions called pint would be usefull.
I'm using the Anaconda distribution of Python, which comes with the Anaconda Prompt a... |
irazhur/StatisticalMethods | examples/SDSScatalog/FirstLook.ipynb | gpl-2.0 | %load_ext autoreload
%autoreload 2
import numpy as np
import SDSS
import pandas as pd
import matplotlib
%matplotlib inline
objects = "SELECT top 10000 \
ra, \
dec, \
type, \
dered_u as u, \
dered_g as g, \
dered_r as r, \
dered_i as i, \
petroR50_i AS size \
FROM PhotoObjAll \
WHERE \
((type = '3' OR type = '6') AND ... |
aschaffn/phys202-2015-work | assignments/assignment05/InteractEx02.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 2
Imports
End of explanation
"""
def plot_sine1(a,b):
x = np.arange(0, 4*np.pi,.01)
plt.plot(x, np.s... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_03_Complete.ipynb | mit | # Create a variable that stores the strong called 'apple'
a = 'apple'
# Create a copy of a with the ps removed and reassign the value of a
a = a.replace('p','')
print(a)
"""
Explanation: Class 3: NumPy (and a quick string example)
Brief introduction to the NumPy module.
Preliminary example
I recently found myself nee... |
mhdella/scipy_2015_sklearn_tutorial | notebooks/05.3 In Depth - Trees and Forests.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Estimators In Depth: Trees and Forests
End of explanation
"""
from figures import make_dataset
x, y = make_dataset()
X = x.reshape(-1, 1)
from sklearn.tree import DecisionTreeRegressor
reg = DecisionTreeRegressor(max_depth=5)
re... |
MegaShow/college-programming | Homework/Principles of Artificial Neural Networks/Week 5 CNN 1/Week5.ipynb | mit | import numpy as np
def convolution(img, kernel, padding=1, stride=1):
"""
img: input image with one channel
kernel: convolution kernel
"""
h, w = img.shape
kernel_size = kernel.shape[0]
# height and width of image with padding
ph, pw = h + 2 * padding, w + 2 * padding
pad... |
obulpathi/datascience | scikit/titanic/notebooks/Section 1-1 - Filling-in Missing Values.ipynb | apache-2.0 | import pandas as pd
import numpy as np
df = pd.read_csv('../data/train.csv')
"""
Explanation: Section 1-1 - Filling-in Missing Values
In the previous section, we ended up with a smaller set of predictions because we chose to throw away rows with missing values. We build on this approach in this section by filling in ... |
tpin3694/tpin3694.github.io | python/parallel_processing.ipynb | mit | from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool
"""
Explanation: Title: Parallel Processing
Slug: parallel_processing
Summary: Lightweight Parallel Processing in Python.
Date: 2016-01-23 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
This tutorial is inspired by C... |
azhurb/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
TomTranter/OpenPNM | examples/io_and_visualization/Quick Plotting in OpenPNM.ipynb | mit | import warnings
import scipy as sp
import numpy as np
import openpnm as op
%matplotlib inline
np.random.seed(10)
ws = op.Workspace()
ws.settings['loglevel'] = 40
np.set_printoptions(precision=4)
net = op.network.Cubic(shape=[5, 5, 1])
"""
Explanation: Producing Quick and Easy Plots of Topology within OpenPNM
The main ... |
PythonFreeCourse/Notebooks | week02/4_Lists.ipynb | mit | prime_ministers = ['David Ben-Gurion', 'Moshe Sharett', 'David Ben-Gurion', 'Levi Eshkol', 'Yigal Alon', 'Golda Meir']
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומ... |
christofs/jupyter | .ipynb_checkpoints/compare-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: (Dieses Jupyter Notebook ist live unter: http://mybinder.org/repo/christofs/jupyter.)
Korpora vergleichen
Dieses Jupyter Notebook erläutert einige Aspekte des Vergleichs von Korpora.
End of explanation
"""
loc ... |
ucsd-ccbb/jupyter-genomics | notebooks/crispr/Dual CRISPR 5-Count Plots.ipynb | mit | g_timestamp = ""
g_dataset_name = "20160510_A549"
g_count_alg_name = "19mer_1mm_py"
g_fastq_counts_dir = '/Users/Birmingham/Repositories/ccbb_tickets/20160210_mali_crispr/data/interim/20160510_D00611_0278_BHK55CBCXX_A549'
g_fastq_counts_run_prefix = "19mer_1mm_py_20160615223822"
g_collapsed_counts_dir = "/Users/Birming... |
planetlabs/notebooks | jupyter-notebooks/tasking-api/planet_tasking_api_order_edit_and_cancel.ipynb | apache-2.0 | # Import the os module in order to access environment variables
import os
#If you are running this notebook outside of the docker environment that comes with the repo, you can uncomment the next line to provide your API key
#os.environ['PL_API_KEY']=input('Please provide your API Key')
# Setup the API Key from the `P... |
bsafdi/NPTFit | examples/Example10_HighLat_Analysis.ipynb | mit | # Import relevant modules
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import corner
import matplotlib.pyplot as plt
from NPTFit import nptfit # module for performing scan
from NPTFit import create_mask as cm # module for creating the mask
from NPTFit import dnds_analysis # module for ana... |
prasants/pyds | 06.List_it_out.ipynb | mit | final = "It is with a heavy heart that I take up my pen to write these the last words in which I shall ever record the singular gifts by which my friend Mr. Sherlock Holmes was distinguished."
final = final.replace(".", "")
final = final.split(" ")
final
type(final)
"""
Explanation: Table of Contents
<p><div class="... |
kubeflow/pipelines | components/gcp/dataflow/launch_template/sample.ipynb | apache-2.0 | %%capture --no-stderr
!pip3 install kfp --upgrade
"""
Explanation: Name
Data preparation by using a template to submit a job to Cloud Dataflow
Labels
GCP, Cloud Dataflow, Kubeflow, Pipeline
Summary
A Kubeflow Pipeline component to prepare data by using a template to submit a job to Cloud Dataflow.
Details
Intended us... |
sspickle/sci-comp-notebooks | P05-DemonAlgorithm.ipynb | mit | import matplotlib.pyplot as pl
import numpy as np
#
# rand() returns a single random number:
#
print(np.random.rand())
#
# hist plots a histogram of an array of numbers
#
print(pl.hist(np.random.normal(size=1000)))
m=28*1.67e-27 # mass of a molecule (e.g., Nitrogen)
g=9.8 # grav field strength
kb=1.67e-2... |
quantopian/research_public | notebooks/data/quandl.bundesbank_bbk01_wt5511/notebook.ipynb | apache-2.0 | # import the dataset
from quantopian.interactive.data.quandl import bundesbank_bbk01_wt5511 as dataset
# Since this data is public domain and provided by Quandl for free, there is no _free version of this
# data set, as found in the premium sets. This import gets you the entirety of this data set.
# import data operat... |
PythonFreeCourse/Notebooks | week08/4_Exceptions_Part_2.ipynb | mit | import os
import zipfile
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית.">
<span style="tex... |
andres-root/AIND | Therm2/dog-breed/dog_app.ipynb | mit | from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
# define function to load train, test, and validation datasets
def load_dataset(path):
data = load_files(path)
dog_files = np.array(data['filenames'])
dog_targets = np_utils.to_categoric... |
AustinACM-SigKDD/SciKit_2015_11 | Pre-Model Workflow.ipynb | gpl-2.0 | %install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
%load_ext watermark
%watermark -a "Jaya Zenchenko" -n -t -z -u -h -m -w -v -p scikit-learn,matplotlib,pandas,seaborn,numpy,scipy,conda
"""
Explanation: ACM SIGKDD Austin
Advanced Machine Learning with Python
Class 1: Pre-Model Workflow... |
CNR-Engineering/TelTools | notebook/Handle Serafin files.ipynb | gpl-3.0 | from pyteltools.slf import Serafin
with Serafin.Read('../scripts_PyTelTools_validation/data/Yen/fis_yen-exp.slf', 'en') as resin:
# Read header (SerafinHeader is stored in `header` attribute of `Serafin` class)
resin.read_header()
# Display a summary
print(resin.header.summary())
# Get ti... |
rldotai/rlbench | rlbench/off_policy_comparison-short.ipynb | gpl-3.0 | def compute_value_dct(theta_lst, features):
return [{s: np.dot(theta, x) for s, x in features.items()} for theta in theta_lst]
def compute_values(theta_lst, X):
return [np.dot(X, theta) for theta in theta_lst]
def compute_errors(value_lst, error_func):
return [error_func(v) for v in value_lst]
def rmse_f... |
antoniomezzacapo/qiskit-tutorial | community/terra/qis_intro/entanglement_testing.ipynb | apache-2.0 | # Imports
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
from qiskit.tools.visualization import matplotlib_circuit_drawer as circuit_drawer
from qiskit.tools.visualization import plot_histogram, qx_color_scheme
from q... |
wcmckee/wcmckee | artcgallery.ipynb | mit | import os
import arrow
import getpass
raw = arrow.now()
myusr = getpass.getuser()
galpath = ('/home/{}/git/artcontrolme/galleries/'.format(myusr))
galpath = ('/home/{}/git/artcontrolme/galleries/'.format(myusr))
popath = ('/home/{}/git/artcontrolme/posts/'.format(myusr))
class DayStuff():
def getUsr():
... |
mdiaz236/DeepLearningFoundations | sentiment-rnn/.ipynb_checkpoints/Sentiment RNN-checkpoint.ipynb | mit | import numpy as np
import tensorflow as tf
from collections import Counter
with open('../sentiment_network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment_network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you... |
rflamary/POT | docs/source/auto_examples/plot_otda_mapping_colors_images.ipynb | mit | # Authors: Remi Flamary <remi.flamary@unice.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
#
# License: MIT License
import numpy as np
from scipy import ndimage
import matplotlib.pylab as pl
import ot
r = np.random.RandomState(42)
def im2mat(I):
"""Converts and image to matrix (one pixel per line)"""... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-2/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-2', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-2
Topic: Ocnbgchem
Sub-Topic... |
dlsun/symbulate | tutorial/gs_rv.ipynb | mit | from symbulate import *
%matplotlib inline
"""
Explanation: Getting Started with Symbulate
Section 2. Random Variables
<a id='contents'></a>
<Probability Spaces | Contents | Multiple random variables and joint distributions>
Every time you start Symbulate, you must first run (SHIFT-ENTER) the following commands.
End o... |
edhenry/notebooks | Breadth First Search.ipynb | mit | class Vertex:
def __init__(self, key):
# unique ID for vertex
self.id = key
# dict of connected nodes
self.connected_to = {}
def add_neighbor(self, neighbor, weight=0):
# Add an entry to the connected_to dict with a given
# weight
self.connected_to[n... |
mrustl/flopy | examples/Notebooks/flopy3_multi-component_SSM.ipynb | bsd-3-clause | import os
import numpy as np
from flopy import modflow, mt3d, seawat
"""
Explanation: FloPy
Using FloPy to simplify the use of the MT3DMS SSM package
A multi-component transport demonstration
End of explanation
"""
nlay, nrow, ncol = 10, 10, 10
perlen = np.zeros((10), dtype=np.float) + 10
nper = len(perlen)
ibound ... |
agile-geoscience/striplog | docs/tutorial/01_Basics.ipynb | apache-2.0 | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import striplog
striplog.__version__
# If you get a lot of warnings here, try running this block again.
from striplog import Legend, Lexicon, Interval, Component
legend = Legend.builtin('NSDOE')
lexicon = Lexicon.default()
"""
Explanation: Stri... |
angelmtenor/data-science-keras | simple_tickets.ipynb | mit | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import helper
import keras
helper.info_gpu()
helper.reproducible(seed=9) # setup reproducible results from run to run using Keras
%matplotlib inline
"""
Explanation: Simple Tickets prediction with DNN
Predicting th... |
diegocavalca/Studies | books/deep-learning-with-python/2.1-a-first-look-at-a-neural-network.ipynb | cc0-1.0 | from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
"""
Explanation: A first look at a neural network
This notebook contains the code samples found in Chapter 2, Section 1 of Deep Learning with Python. Note that the original text features far more content, in ... |
Alexoner/mooc | cs231n/assignment3/q3.ipynb | apache-2.0 | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from time import time
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading extenrnal modules
# see http:/... |
willettk/insight | notebooks/Probability tutorial.ipynb | apache-2.0 | def compare(analytic,N,f):
errval = err(f,N)
successes = sum(f)
print "Analytic prediction: {:.0f}%.".format(analytic*100.)
print "Monte Carlo: {:.0f} +- {:.0f}%.".format(successes/float(N)*100.,errval*100.)
def err(fx,N):
# http://www.northeastern.edu/afeiguin/phys5870/phys5870/node71.html
f2 ... |
DJCordhose/ai | notebooks/talks/2017_mcubed/nn-intro.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import matplotlib.pylab as plt
import numpy as np
from distutils.version import StrictVersion
import sklearn
print(sklearn.__version__)
assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1')
import tensorflow as tf
t... |
mediagit2016/workcamp-maschinelles-lernen-grundlagen | wc-arbeiten-tf-10-aufgabe.ipynb | gpl-3.0 | #importieren sie die Bibliothek pandas
#importieren sie matplotlib.pyplot as plt
#laden Sie die Datei "daten.csv" auf Ihren Hub
#laden Sie die Datei "daten.csv" in einen Datframe df
#Einlesen der Dateien
#Betrachten Sie die ersten Daten des Dataframes df
#Erzeugen Sie einen Scatterplot
#importieren Sie tensorflow ... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/mpi-esm-1-2-hr/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'mpi-esm-1-2-hr', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MPI-M
Source ID: MPI-ESM-1-2-HR
Sub-Topics: Radiative Forcings.
Propert... |
jeffcarter-github/MachineLearningLibrary | MachineLearningLibrary/Cluster/kmeans_example.ipynb | mit | from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
from KMeans import KMeans
"""
Explanation: This notebook is designed for the exploration of the K-Means algorithm...
1. Arbitrary data sets can be created...
2. K-Means algo can be run with differen... |
Biles430/FPF_PIV | PIV_092117.ipynb | mit | import pandas as pd
import numpy as np
import PIV as piv
import time_series as ts
import time
import sys
import h5py
from scipy.signal import medfilt
import matplotlib.pyplot as plt
import hotwire as hw
import imp
from datetime import datetime
%matplotlib inline
now = datetime.now()
#for setting movie
import time
impo... |
robertoalotufo/ia898 | deliver/tutorial-python.ipynb | mit | a = 3
print (type(a) )
b = 3.14
print (type(b) )
c = 3 + 4j
print (type(c) )
d = False
print (type(d) )
print (a + b )
print (b * c )
print (c / a )
"""
Explanation: Introdução ao Python
Python é uma linguagem muito poderosa bastante utilizada em processamento de imagens e aprendizado de máquina. A maioria das bibliot... |
jwjohnson314/data-801 | notebooks/stay_classy.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
dir(list)
class Rectangle(object):
"""
retangular objects - requires a 2 x 5 np.array corresponding to points in the plane
traversed counterclockwise - first same as last
"""
def __init__(self, coords=None):
"""
... |
GoogleCloudPlatform/analytics-componentized-patterns | retail/recommendation-system/bqml-mlops/kfp_tutorial.ipynb | apache-2.0 | # CHANGE the following settings
BASE_IMAGE='gcr.io/your-image-name'
MODEL_STORAGE = 'gs://your-bucket-name/folder-name' #Must include a folder in the bucket, otherwise, model export will fail
BQ_DATASET_NAME="hotel_recommendations" #This is the name of the target dataset where you model and predictions will be stored
P... |
jdhp-docs/python-notebooks | ai_ml_multilayer_perceptron_fr.ipynb | mit | STR_CUR = r"i" # Couche courante
STR_PREV = r"j" # Couche immédiatement en amont de la courche courrante (i.e. vers la couche d'entrée du réseau)
STR_NEXT = r"k" # Couche immédiatement en aval de la courche courrante (i.e. vers la couche de sortie du réseau)
STR_EX = r"\eta" # Exemple (*sample* ou *... |
robertoalotufo/ia898 | dev/2017-02-28-RAL-Revisao-de-Algebra-Linear.ipynb | mit | import numpy as np
from numpy.random import randn
"""
Explanation: Revisão de Álgebra Linear
End of explanation
"""
A = np.array([[123, 343, 100],
[ 33, 0, -50]])
print (A )
print (A.shape )
print (A.shape[0] )
print (A.shape[1] )
B = np.array([[5, 3, 2, 1, 4],
[0, 2, 1, 3, 8]])
print ... |
DominikDitoIvosevic/Uni | STRUCE/2018/SU-2018-LAB02-0036477171.ipynb | mit | # Učitaj osnovne biblioteke...
import sklearn
import mlutils
import matplotlib.pyplot as plt
%pylab inline
"""
Explanation: Sveučilište u Zagrebu
Fakultet elektrotehnike i računarstva
Strojno učenje 2018/2019
http://www.fer.unizg.hr/predmet/su
Laboratorijska vježba 2: Linearni diskriminativni modeli
Verzija: 1.2
Za... |
bobmyhill/burnman | tutorial/tutorial_02_composition_class.ipynb | gpl-2.0 | from burnman import Composition
olivine_composition = Composition({'MgO': 1.8,
'FeO': 0.2,
'SiO2': 1.}, 'weight')
"""
Explanation: <h1>The BurnMan Tutorial</h1>
Part 2: The Composition Class
This file is part of BurnMan - a thermoelastic and therm... |
ML4DS/ML4all | P2.Numpy/P2_Numpy_basics_student.ipynb | mit | # Import numpy library
import numpy as np
"""
Explanation: Exercises about Numpy
Notebook version:
* 1.0 (Mar 15, 2016) - First version - UTAD version
* 1.1 (Sep 12, 2017) - Python3 compatible
* 1.2 (Sep 3, 2018) - Adapted to TMDE (only numpy exercises)
* 1.3 (Sep 4, 2019) - Spelling and structure revisi... |
statsmodels/statsmodels.github.io | v0.13.0/examples/notebooks/generated/rolling_ls.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pandas_datareader as pdr
import seaborn
import statsmodels.api as sm
from statsmodels.regression.rolling import RollingOLS
seaborn.set_style("darkgrid")
pd.plotting.register_matplotlib_converters()
%matplotlib inline
"""
Explanation: Rolli... |
aattaran/Machine-Learning-with-Python | Mini Project Student Admissions in Keras/imdb/Student_Admissions.ipynb | bsd-3-clause | import pandas as pd
data = pd.read_csv('student_data.csv')
data.head(5)
"""
Explanation: Predicting Student Admissions
In this notebook, we predict student admissions to graduate school at UCLA based on three pieces of data:
- GRE Scores (Test)
- GPA Scores (Grades)
- Class rank (1-4)
The dataset originally came from... |
mne-tools/mne-tools.github.io | stable/_downloads/e1c3654f77f904db443b548e9d93b8f9/50_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import mne
from mne.datasets import sample
from mne.decoding import (SlidingEstimator, GeneralizingEstimator, Scaler,
... |
HazyResearch/snorkel | tutorials/advanced/Structure_Learning.ipynb | apache-2.0 | from snorkel.learning import GenerativeModelWeights
from snorkel.learning.structure import generate_label_matrix
weights = GenerativeModelWeights(10)
for i in range(10):
weights.lf_accuracy[i] = 1.0
weights.dep_similar[0, 1] = 0.5
weights.dep_similar[2, 3] = 0.5
y, L = generate_label_matrix(weights, 10000)
"""
E... |
NathanYee/ThinkBayes2 | code/blaster.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from thinkbayes2 import Hist, Pmf, Cdf, Suite, Beta
import thinkplot
"""
Explanation: The Alien Blaster problem
This notebook presents solutions to exercises in Think Bayes.
Copyr... |
faneshion/MatchZoo | tutorials/model_tuning.ipynb | apache-2.0 | import matchzoo as mz
train_raw = mz.datasets.toy.load_data('train')
dev_raw = mz.datasets.toy.load_data('dev')
test_raw = mz.datasets.toy.load_data('test')
"""
Explanation: Model Tuning
End of explanation
"""
preprocessor = mz.models.DenseBaseline.get_default_preprocessor()
train = preprocessor.fit_transform(train_... |
infilect/ml-course1 | keras-notebooks/RNN/6.3-advanced-usage-of-recurrent-neural-networks.ipynb | mit | import os
data_dir = '/home/ubuntu/data/'
fname = os.path.join(data_dir, 'jena_climate_2009_2016.csv')
f = open(fname)
data = f.read()
f.close()
lines = data.split('\n')
header = lines[0].split(',')
lines = lines[1:]
print(header)
print(len(lines))
"""
Explanation: Advanced usage of recurrent neural networks
This ... |
jorisvandenbossche/2015-EuroScipy-pandas-tutorial | solved - 02 - Data structures.ipynb | bsd-2-clause | df = pd.read_csv("data/titanic.csv")
df.head()
"""
Explanation: Tabular data
End of explanation
"""
df['Age'].hist()
"""
Explanation: Starting from reading this dataset, to answering questions about this data in a few lines of code:
What is the age distribution of the passengers?
End of explanation
"""
df.groupb... |
tbphu/fachkurs_master_2016 | 07_modelling/20151201_ZombieApocalypse-Assignment.ipynb | mit | import numpy as np
# 1. initial conditions
# initial population
# initial zombie population
# initial death population
# initial condition vector
# 2. parameter values
# birth rate
# 'natural' death percent (per day)
# transmission per... |
google/jax-md | notebooks/minimization.ipynb | apache-2.0 | #@title Imports & Utils
!pip install jax-md
import numpy as onp
import jax.numpy as np
from jax.config import config
config.update('jax_enable_x64', True)
from jax import random
from jax import jit
from jax_md import space, smap, energy, minimize, quantity, simulate
from jax_md.colab_tools import renderer
import ... |
tensorflow/docs-l10n | site/pt-br/r1/tutorials/keras/basic_text_classification.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... |
fastai/course-v3 | nbs/dl2/11a_transfer_learning.ipynb | apache-2.0 | path = datasets.untar_data(datasets.URLs.IMAGEWOOF_160)
size = 128
bs = 64
tfms = [make_rgb, RandomResizedCrop(size, scale=(0.35,1)), np_to_float, PilRandomFlip()]
val_tfms = [make_rgb, CenterCrop(size), np_to_float]
il = ImageList.from_files(path, tfms=tfms)
sd = SplitData.split_by_func(il, partial(grandparent_split... |
moonbury/pythonanywhere | github/RegressionAnalysisWithPython/Chap_6_ Achieving Generalization.ipynb | gpl-3.0 | import pandas as pd
from sklearn.datasets import load_boston
boston = load_boston()
dataset = pd.DataFrame(boston.data, columns=boston.feature_names)
dataset['target'] = boston.target
observations = len(dataset)
variables = dataset.columns[:-1]
X = dataset.ix[:,:-1]
y = dataset['target'].values
from sklearn.cross_val... |
machinelearningnanodegree/stanford-cs231 | solutions/kvn219/assignment2/ConvolutionalNetworks.ipynb | mit | 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 *
from cs231n.fast_layers import *
from cs231n.solver import Solver
%... |
makism/dyfunconn | tutorials/EEG - 3 - Dynamic Connectivity.ipynb | bsd-3-clause | import numpy as np
import scipy
from scipy import io
eeg = np.load("data/eeg_eyes_opened.npy")
num_trials, num_channels, num_samples = np.shape(eeg)
eeg_ts = np.squeeze(eeg[0, :, :])
"""
Explanation: In this short tutorial, we will build and expand on the previous tutorials by computing the dynamic connectivity, u... |
cesarcontre/Simulacion2017 | Modulo3/Clase22_ClasificacionBinaria.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def fun_log(z):
return 1/(1+np.exp(-z))
z = np.linspace(-5, 5)
plt.figure(figsize = (8,6))
plt.plot(z, fun_log(z), lw = 2)
plt.xlabel('$z$')
plt.ylabel('$\sigma(z)$')
plt.grid()
plt.show()
"""
Explanation: Clasificación binaria
<img style="f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.