repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
SATHVIKRAJU/Inferential_Statistics
Hospital_readmit.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import bokeh.plotting as bkp from mpl_toolkits.axes_grid1 import make_axes_locatable # read in readmissions data provided hospital_read_df = pd.read_csv('data/cms_hospital_readmissions.csv') hospital_read_df.head() """ Explanat...
jdossgollin/CWC_ANN
Week02/03-MNIST_CNN.ipynb
mit
import numpy as np from IPython.display import SVG from keras.utils.vis_utils import model_to_dot """ Explanation: MNIST CNN You should already have gone through the GettingStartedSequentialModels notebook -- if not you'll be lost here! End of explanation """ import keras from keras.datasets import mnist # load up t...
phoebe-project/phoebe2-docs
development/tutorials/alternate_backends.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" import phoebe from phoebe import u # units logger = phoebe.logger() b = phoebe.default_binary() """ Explanation: Advanced: Alternate Backends Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook sessi...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/matching_engine/two-tower-model-introduction.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" ! pip3 install {...
landmanbester/fundamentals_of_interferometry
3_Positional_Astronomy/3_3_Horizontal_Coordinates.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary Positional Astronomy Previous: 3.2 Hour Angle (HA) and Local Sidereal Time (LST) Next: 3.4 Direction Cosine Coordinates ($l,m,n$) ...
benvanwerkhoven/kernel_tuner
tutorial/convolution.ipynb
apache-2.0
%%writefile convolution_naive.cu __global__ void convolution_kernel(float *output, float *input, float *filter) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int i, j; float sum = 0.0; if (y < image_height && x < image_width) { for (j = 0...
CalPolyPat/phys202-2015-work
assignments/midterm/InteractEx06.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from IPython.display import Image from IPython.html.widgets import interact, interactive, fixed """ Explanation: Interact Exercise 6 Imports Put the standard imports for Matplotlib, Numpy and the IPython widgets in the following cell. End of explan...
mathinmse/mathinmse.github.io
Lecture-15-Separation-of-Variables.ipynb
mit
%matplotlib notebook import sympy as sp # You may have to comment out the init_sesison() line if you have not used my session.py file. sp.init_session(quiet=True) sp.init_printing() dum = sp.symbols('dum') def initial_condition(x): return x def b_m_amplitudes(m, funToProject, center=0.5, width=1.0): return (2...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/machine_learning_in_the_enterprise/solutions/sdk-custom-image-classification-batch.ipynb
apache-2.0
# Setup your dependencies import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = ...
JerryKurata/MachineLearningWithPython
Notebooks/Pima-Prediction-with-reload.ipynb
gpl-3.0
import pandas as pd # pandas is a dataframe library import matplotlib.pyplot as plt # matplotlib.pyplot plots data %matplotlib inline """ Explanation: Pima Indian Diabetes Prediction ### Update History 2021-04-15 Added bypass of imputation of Num of Pregnancies field, switched to using only trans...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/theta-model.ipynb
bsd-3-clause
import numpy as np import pandas as pd import pandas_datareader as pdr import matplotlib.pyplot as plt import seaborn as sns plt.rc("figure",figsize=(16,8)) plt.rc("font",size=15) plt.rc("lines",linewidth=3) sns.set_style("darkgrid") """ Explanation: The Theta Model The Theta model of Assimakopoulos & Nikolopoulos (20...
tensorflow/docs-l10n
site/ja/r1/tutorials/load_data/tf_records.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...
anshbansal/anshbansal.github.io
udacity_data_science_notes/Data_Wrangling_with_MongoDB/lesson_01/Lesson1.ipynb
mit
import os DATA_FILE_CSV = "beatles-diskography.csv" def parse_file(data_file): data = [] row_count = 0 with open(data_file) as f: header = f.readline().split(',') for line in f: if row_count >= 10: break fields = line.strip().split('...
icrtiou/coursera-ML
ex8-anomaly detection and recommendation/1- Anomaly detection.ipynb
mit
%reload_ext autoreload %autoreload 2 %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set(context="notebook", style="white", palette=sns.color_palette("RdBu")) import numpy as np import pandas as pd import scipy.io as sio from scipy import stats import sys sys.path.append('..') from help...
tensorflow/federated
docs/tutorials/building_your_own_federated_learning_algorithm.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...
GoogleCloudPlatform/asl-ml-immersion
notebooks/building_production_ml_systems/labs/1_training_at_scale.ipynb
apache-2.0
from google import api_core from google.cloud import bigquery """ Explanation: Training at scale with AI Platform Training Service Learning Objectives: 1. Learn how to organize your training code into a Python package 1. Train your model using cloud infrastructure via Google Cloud AI Platform Training Service 1....
ajgpitch/qutip-notebooks
docs/guide/Parallel.ipynb
lgpl-3.0
import numpy as np from qutip import * """ Explanation: Running Computations in Parallel Contents Introduction Single-Variable Functions Multi-Variable Functions IPython Based Parallel Processing End of explanation """ def func1(x): return x, x**2, x**3 a, b, c = parfor(func1, range(10)) print(a) print(b) pri...
saketkc/notebooks
python/Kneedle Algorithm.ipynb
bsd-2-clause
%matplotlib inline import numpy as np import scipy as sp import seaborn as sns from scipy.interpolate import UnivariateSpline import matplotlib.pyplot as plt sns.set_style('white') np.random.seed(42) def draw_plot(X, Y, knee_point=None): plt.plot(X, Y) if knee_point: plt.axvline(x=knee_point, color='k...
chongyangma/python-machine-learning-book
code/bonus/softmax-regression.ipynb
mit
%load_ext watermark %watermark -a 'Sebastian Raschka' -u -d -v -p matplotlib,numpy,scipy # to install watermark just uncomment the following line: #%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py %matplotlib inline """ Explanation: Sebastian Raschka, 2016 https://github.com/rasbt/p...
jbpoline/cnv_analysis
CNV_guillaume_huguet.ipynb
artistic-2.0
CWD = osp.join(osp.expanduser('~'), 'documents','grants_projects','roberto_projects', \ 'guillaume_huguet_CNV','File_OK') filename = 'Imagen_QC_CIA_MMAP_V2_Annotation.tsv' fullfname = osp.join(CWD, filename) arr = np.loadtxt(fullfname, dtype='str', comments=None, delimiter='\Tab', conv...
myuuuuun/RepeatedMatrixGame
PrisonersDilemma/.ipynb_checkpoints/ts_length-checkpoint.ipynb
mit
#-*- encoding: utf-8 -*- %matplotlib inline # 日本語対応 import matplotlib matplotlib.rcParams['font.family'] = 'Osaka' import math import numpy as np import pandas as pd import functools import matplotlib.pyplot as plt import scipy.stats as stats np.set_printoptions(precision=3) np.set_printoptions(linewidth=400) np.set_pr...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/talks/DataWeekends/SparkMLDeployment/DataWeekends-Mar182017-SparkMLDeployment.ipynb
apache-2.0
# You may need to Reconnect (more than Restart) the Kernel to pick up changes to these sett import os master = '--master spark://spark-master-2-1-0:7077' conf = '--conf spark.cores.max=1 --conf spark.executor.memory=512m' packages = '--packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1' jars ...
cathalmccabe/PYNQ
boards/Pynq-Z1/base/notebooks/microblaze/microblaze_programming.ipynb
bsd-3-clause
from pynq.overlays.base import BaseOverlay base = BaseOverlay('base.bit') """ Explanation: Programming Microblaze Subsystems from Jupyter In the Base I/O overlays that accompany the PYNQ release Microblazes are used to control peripherals attached to the various connectors. These can either be programmed with existin...
LukasMosser/Jupetro
notebooks/Casing Seat Depth Determination - Part 1.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Simple Bottom Up Casing Seat Design - Part 1 Created by Lukas Mosser, 2016 Introduction We will look at how we can use python and related libraries to estimate casing setting depths. We will derive a simplified methodology to determ...
Hvass-Labs/TensorFlow-Tutorials
13B_Visual_Analysis_MNIST.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import confusion_matrix import math # Use TensorFlow v.2 with this old v.1 code. # E.g. placeholder variables and sessions have changed in TF2. import tensorflow.compat.v1 as tf tf.disable_v2_behavior() """ Explanation: TensorF...
mne-tools/mne-tools.github.io
stable/_downloads/6d98b103d247000f4433763dd76607c0/25_background_filtering.ipynb
bsd-3-clause
import numpy as np from numpy.fft import fft, fftfreq from scipy import signal import matplotlib.pyplot as plt from mne.time_frequency.tfr import morlet from mne.viz import plot_filter, plot_ideal_filter import mne sfreq = 1000. f_p = 40. flim = (1., sfreq / 2.) # limits for plotting """ Explanation: Background in...
ageron/ml-notebooks
extra_capsnets.ipynb
apache-2.0
from IPython.display import IFrame IFrame(src="https://www.youtube.com/embed/pPN8d0E3900", width=560, height=315, frameborder=0, allowfullscreen=True) """ Explanation: Capsule Networks (CapsNets) Based on the paper: Dynamic Routing Between Capsules, by Sara Sabour, Nicholas Frosst and Geoffrey E. Hinton (NIPS 2017). I...
awadalaa/DataSciencePractice
practice/04.model_evaluation.ipynb
mit
# read in the iris data from sklearn.datasets import load_iris iris = load_iris() # create X (features) and y (response) X = iris.data y = iris.target """ Explanation: Comparing machine learning models in scikit-learn Agenda How do I choose which model to use for my supervised learning task? How do I choose the bes...
ehrlinger/MachineLearningSamples-PredictiveMaintenance
Code/3_model_building.ipynb
mit
# import the libraries import os import glob import time # for creating pipelines and model from pyspark.ml.feature import StringIndexer, OneHotEncoder, VectorAssembler, VectorIndexer from pyspark.ml import Pipeline, PipelineModel from pyspark.ml.classification import RandomForestClassifier from pyspark.ml.classificat...
google/neural-tangents
notebooks/phase_diagram.ipynb
apache-2.0
!pip install --upgrade pip !pip install --upgrade jax[cuda11_cudnn805] -f https://storage.googleapis.com/jax-releases/jax_releases.html !pip install -q git+https://www.github.com/google/neural-tangents import jax.numpy as np from jax.example_libraries import optimizers from jax import grad, jit, vmap from jax import ...
opensanca/trilha-python
02-python-oo/aula-02/Aula 02.ipynb
mit
class Cão: qtd_patas = 4 carnívoro = True nervoso = False def __init__(self, nome): self.nome = nome def latir(self, vezes=1): """ Latir do cão. Quanto mais nervoso mais late. """ vezes += self.nervoso * vezes latido = 'Au! ' * vezes pri...
bumblebeefr/poppy_rate
[startup] Poppy primitives.ipynb
gpl-2.0
from pprint import pprint #imports and initilaize virutal poppy using vrep from pypot.vrep import from_vrep from poppy.creatures import PoppyHumanoid robot = PoppyHumanoid(simulator='vrep') #import and initialize physical poppy from poppy.creatures import PoppyHumanoid robot = PoppyHumanoid() #Rend le robot mou et ...
mnishida/RII_Pandas
docs/notebooks/03_Material.ipynb
mit
import riip rid = riip.RiiDataFrame() water = riip.Material({'id': 428}, rid) print(f"{water.catalog['book']} {water.catalog['page']}") print(f"{water.catalog['wl_min']} <= λ <= {water.catalog['wl_max']}") """ Explanation: Material Material(params: Dict, rid: RiiDataFrame) This class provides the dielectric function f...
datactive/bigbang
examples/experimental_notebooks/List Correlation.ipynb
mit
%matplotlib inline """ Explanation: TO DO: move most of this to the libraries order groups reliably by time in data in plot summarize groups convolve the time series with a declining 'response time' End of explanation """ from bigbang.archive import Archive arx = Archive("ipython-dev",archive_dir="../archives") "...
agicquel/dut
M4107C/TP1.ipynb
gpl-3.0
import numpy as np import keras from keras.datasets import mnist # fix random seed for reproducibility np.random.seed(7) # load data (x_train,y_train), (x_test,y_test) = mnist.load_data() # show the training size, test size, number of class print("train size : ",x_train.shape) print("test size : ",x_test.shape) prin...
smousavi05/EQTransformer
EQTransformerviaGoogleColab.ipynb
mit
!pip install obspy """ Explanation: <a href="https://colab.research.google.com/github/maihao14/EQTransformer/blob/colab/EQTransformerviaGoogleColab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> EQTransformer via Google Colab Author: Hao Mai<br> Da...
sameersingh/ml-discussions
week7/ensembles_and_boosting.ipynb
apache-2.0
# Import all required libraries from __future__ import division # For python 2.* import numpy as np import matplotlib.pyplot as plt import mltools as ml np.random.seed(0) %matplotlib inline """ Explanation: In this discussion notebook we will cover the material from lecture 12 abour ensambles and boosting. For consi...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_linear_model_patterns.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Romain Trachel <trachelr@gmail.com> # # License: BSD (3-clause) import mne from mne import io from mne.datasets import sample from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression # impor...
ocefpaf/secoora
notebooks/timeSeries/sst/01-skill_score.ipynb
mit
import os try: import cPickle as pickle except ImportError: import pickle run_name = '2014-07-07' fname = os.path.join(run_name, 'config.pkl') with open(fname, 'rb') as f: config = pickle.load(f) import numpy as np from pandas import DataFrame, read_csv from utilities import (load_secoora_ncs, to_html, ...
JeffAbrahamson/MLWeek
practicum/02_pandas/pandas.ipynb
gpl-3.0
import matplotlib %matplotlib inline """ Explanation: Introduction à Python pour Data Science et ML Ceci suppose que vous avez déjà fait un tutoriel sur les principes de base de la langue. Nous allons parler ici de pandas. Les données ne servent à rien si on ne peut pas les lire. Heureusement, on a déjà pensé à ça....
mne-tools/mne-tools.github.io
0.19/_downloads/99730d9046b115c3e40e7e01cb975635/plot_50_artifact_correction_ssp.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt import mne from mne.preprocessing import (create_eog_epochs, create_ecg_epochs, compute_proj_ecg, compute_proj_eog) """ Explanation: Repairing artifacts with SSP This tutorial covers the basics of signal-space projection (SSP) ...
FederatedAI/FATE
doc/tutorial/pipeline/pipeline_tutorial_hetero_sbt.ipynb
apache-2.0
!pipeline --help """ Explanation: Pipeline Tutorial with HeteroSecureBoost install Pipeline is distributed along with fate_client. bash pip install fate_client To use Pipeline, we need to first specify which FATE Flow Service to connect to. Once fate_client installed, one can find an cmd enterpoint name pipeline: End ...
gmckercher/2015-TTU-SWC
pythonic-data-analysis/pythonic-data-analysis.ipynb
mit
from netCDF4 import Dataset, num2date data = Dataset('data/model-gfs.nc', 'r') # Convert the array of time numbers to datetimes time_var = data['time'] time = num2date(time_var[:], time_var.units).squeeze() """ Explanation: Pythonic Data Analysis One of the nice aspects of Python is that it contains many powerful too...
vatsan/gp_jupyter_notebook_templates
notebooks/00_database_connectivity_setup.ipynb
apache-2.0
%matplotlib inline import psycopg2 import pandas as pd import pandas.io.sql as psql import ConfigParser import os import IPython from IPython.display import display from IPython.display import HTML #Maximum height of a result set pd.set_option('display.max_rows', 500) #Maximum number of rows to display in a cell. pd.se...
adrianstaniec/deep-learning
11_sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../02_sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../02_sentiment-network/labels.txt', 'r') as f: labels = f.read() (type(reviews), type(labels)) reviews[:2000] labels[:200] """ Explanation: Sentiment Analysis with an RNN In...
axbaretto/beam
examples/notebooks/documentation/transforms/python/elementwise/tostring-py.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License") # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you u...
ioggstream/python-course
connexion-101/notebooks/04-02-connexion-writing-operationid.ipynb
agpl-3.0
# Use this cell to test the output !curl http://localhost:5000/datetime/v1/echo -vk """ Explanation: A new path: /echo Now we're going to write a new path: /echo. Our goal is the following: when invoking /datetime/v1/echo the API will return the current datetime; the response is enveloped in the following example ...
tensorflow/docs-l10n
site/zh-cn/tensorboard/dataframe_api.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...
JannesKlaas/MLiFC
Week 1/Ch. 6 - Minibatch Gradient Descent.ipynb
mit
# Package imports # Matplotlib is a matlab like plotting library import matplotlib import matplotlib.pyplot as plt # Numpy handles matrix operations import numpy as np # SciKitLearn is a useful machine learning utilities library import sklearn # The sklearn dataset module helps generating datasets import sklearn.datase...
muneebalam/scrapenhl2
examples/YTD and ROY CF%.ipynb
mit
import pandas as pd from pylab import * %matplotlib inline from pyarrow import ArrowIOError from scrapenhl2.scrape import teams, team_info, schedules from scrapenhl2.manipulate import manipulate as manip generate = False fname = '/Users/muneebalam/Desktop/team_game_data.csv' if generate: team_dfs = [] for se...
tritemio/multispot_paper
realtime kinetics/out_notebooks/Simulated Kinetic Curve Fit - Template-out-multi-spot-t0_novary.ipynb
mit
sigma = 0.016 time_window = 30 time_step = 5 time_start = -900 time_stop = 900 decimation = 20 t0_vary = True true_params = dict( tau = 60, # time constant init_value = 0.3, # initial value (for t < t0) final_value = 0.8, # final value (for t -> +inf) t0 = 0) # time o...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_read_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) from mne.datasets import sample from mne.minimum_norm import read_inverse_operator print(__doc__) data_path = sample.data_path() fname = data_path fname += '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif' inv = read_...
f-guitart/data_mining
notes/05 - From Raw to Technically Correct Data.ipynb
gpl-3.0
fname = "../data/people.csv" with open(fname) as f: content = f.readlines() print(content[:5]) """ Explanation: From Raw to Technically Correct Data (from de Jonge van der Loo) A data set is a collection of data that describes attribute values (variables) of a number of real-world objects (units). With data that a...
esa-as/2016-ml-contest
esaTeam/esa_Submission01.ipynb
apache-2.0
# Import from __future__ import division get_ipython().magic(u'matplotlib inline') import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['figure.figsize'] = (20.0, 10.0) inline_rc = dict(mpl.rcParams) from classification_utilities import make_facies_log_plot import pandas as pd import numpy as np impo...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/deep-learning/theano-tutorial/theano_mlp/theano_mlp.ipynb
mit
import numpy import theano from theano import tensor # Set lower precision float, otherwise the notebook will take too long to run theano.config.floatX = 'float32' class HiddenLayer(object): def __init__(self, rng, input, n_in, n_out, W=None, b=None, activation=tensor.tanh): """ ...
bjodah/chempy
examples/interactive_kinetic_modelling.ipynb
bsd-2-clause
from collections import defaultdict from ipywidgets import interact, FloatSlider from chempy import ReactionSystem, Substance from chempy.kinetics.ode import get_odesys from chempy.kinetics._native import get_native from chempy.units import SI_base_registry, default_units as u import matplotlib.pyplot as plt %matplotli...
Applied-Groundwater-Modeling-2nd-Ed/Chapter_5_problems-1
P5.1_Flopy_Island_Recharge_grid_sensitivity.ipynb
gpl-2.0
%matplotlib inline import sys import os import shutil import numpy as np from subprocess import check_output # Import flopy import flopy """ Explanation: <img src="AW&H2015.tiff" style="float: left"> <img src="flopylogo.png" style="float: center"> Problem P5.1 Island Recharge Grid Sensitivity In Problem P5.1 from pag...
jphall663/GWU_data_mining
10_model_interpretability/src/sensitivity_analysis.ipynb
apache-2.0
# imports import h2o import numpy as np import pandas as pd from h2o.estimators.gbm import H2OGradientBoostingEstimator # start h2o h2o.init() h2o.remove_all() """ Explanation: License Copyright 2017 J. Patrick Hall, jphall@gwu.edu Permission is hereby granted, free of charge, to any person obtaining a copy of this...
dnc1994/MachineLearning-UW
ml-foundations/backup/image-retrieval/Deep Features for Image Retrieval.ipynb
mit
import graphlab """ Explanation: Building an image retrieval system with deep features Fire up GraphLab Create End of explanation """ image_train = graphlab.SFrame('image_train_data/') """ Explanation: Load the CIFAR-10 dataset We will use a popular benchmark dataset in computer vision called CIFAR-10. (We've red...
cggh/scikit-allel
notebooks/sandbox/dask_bcolz.ipynb
mit
callset = h5py.File('/data/coluzzi/ag1000g/data/phase1/release/AR3/variation/main/hdf5/ag1000g.phase1.ar3.pass.h5', mode='r') callset genotype = allel.model.chunked.GenotypeChunkedArray(callset['3L/calldata/genotype']) genotype """ Explanation: Let's use some real data... End of explanation """ g = genotype.copy(st...
catalyst-cooperative/pudl
notebooks/work-in-progress/explore-CEMS.ipynb
mit
%load_ext autoreload %autoreload 2 # Standard libraries import logging import sys import os import pathlib # 3rd party libraries import geopandas as gpd import dask.dataframe as dd from dask.distributed import Client import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import pandas as pd impor...
OpenAstronomy/workshop_sunpy_astropy
04-Units/Units_Quantities.ipynb
mit
from astropy import units as u # Define a quantity length # print it # Type of quantity # Type of unit # Quantity # value # unit # information """ Explanation: Units and Quantities Objectives Use units Create functions that accept quantities as arguments Create new units Basics How do we define a Quan...
TobiasLe/python-MD
01_python_intro/python_intro.ipynb
gpl-3.0
1 + 1 """ Explanation: What python is Python is an easy to learn, yet powerful programming language. In general, programming languages can be divided into low-level and high-level languages. In a low-level language you have to tell the computer very detailed and specific what to do. These very specific commands can be...
a-slide/pycoQC
docs/Barcode_split/API_usage.ipynb
gpl-3.0
# Run cell with Ctrl + Enter # Import main pycoQC module from pycoQC.Barcode_split import Barcode_split # Import helper functions from pycoQC from pycoQC.common import jhelp, head, ls """ Explanation: Barcode_split API Usage Running Jupyter notebook If you want to run pycoQC interactively in Jupyter you need to inst...
jdhp-docs/python_notebooks
nb_sci_ai/ai_ml_perceptron_fr.ipynb
mit
%matplotlib inline #x = np.linspace(-5, 5, 300) #y = np.array([-1 if xi < 0 else 1 for xi in x]) #plt.plot(x, y) plt.hlines(y=-1, xmin=-5, xmax=0, color='red') plt.hlines(y=1, xmin=0, xmax=5, color='red') plt.hlines(y=0, xmin=-5, xmax=5, color='gray', linestyles='dotted') plt.vlines(x=0, ymin=-2, ymax=2, color='gray...
xtr33me/deep-learning
sentiment-rnn/Sentiment_RNN_Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_dfnp/td1a_correction_session_10.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.data - DataFrame et Matrice (correction) Correction. End of explanation """ from pyquickhelper.loghelper import get_url_content import pandas, io from ensae_teaching_cs.data import donnees_enquete_2003_television text = donnees_enque...
mimoralea/applied-reinforcement-learning
notebooks/02-dynamic-programming.ipynb
mit
def fib(n): if n < 2: return n return fib(n-2) + fib(n-1) %time fib(30) """ Explanation: Recursion, Memoization and Dynamic Programming Remember how we talk about using recursion and dynamic programming. One interesting thing to do is to implement the solution to a common problem called Fibonnaci numb...
ColeLab/informationtransfermapping
MasterScripts/Manuscript7_PercentFROM_Region_ITE.ipynb
gpl-3.0
import sys sys.path.append('utils/') import numpy as np import loadGlasser as lg import scipy.stats as stats import matplotlib.pyplot as plt import statsmodels.sandbox.stats.multicomp as mc import sys import warnings warnings.filterwarnings('ignore') %matplotlib inline import nibabel as nib import os import permutation...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160516월_3일차_기초 선형 대수 1 - 행렬의 정의와 연산 Basic Linear Algebra(NumPy)/4.NumPy를 활용한 선형대수 입문.ipynb
mit
x = np.array([1, 2, 3, 4]) x, np.shape(x) x = np.array([[1], [2], [3], [4]]) x, np.shape(x) """ Explanation: NumPy를 활용한 선형대수 입문 선형대수(linear algebra)는 데이터 분석에 필요한 각종 계산을 위한 기본적인 학문이다. 데이터 분석을 하기 위해서는 실제로 수많은 숫자의 계산이 필요하다. 하나의 데이터 레코드(record)가 수십개에서 수천개의 숫자로 이루어져 있을 수도 있고 수십개에서 수백만개의 이러한 데이터 레코드를 조합하여 계산하는 과정이 필요할 수 있...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/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', 'nasa-giss', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NASA-GISS Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. P...
xdnian/pyml
code/ch13/ch13.ipynb
mit
%load_ext watermark %watermark -a '' -u -d -v -p numpy,matplotlib,theano,keras """ Explanation: Copyright (c) 2015, 2016 Sebastian Raschka Li-Yi Wei https://github.com/1iyiwei/pyml MIT License Python Machine Learning - Code Examples Chapter 13 - Parallelizing Neural Network Training with Theano We have seen how to wri...
muneebalam/scrapenhl2
examples/5v5 TOI for teams and players/5v5 TOI for teams and players.ipynb
mit
# Update data # autoupdate.autoupdate() # Comment in if needed, and loop if needed # manip.get_5v5_player_log(2017, force_create) # Comment in if needed, and loop if needed log = pd.concat([manip.get_5v5_player_log(season).assign(Season=season) for season in range(2012, 2018)]) sch = pd.concat([schedules.get_season_s...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Mean_Reversion_on_Futures/notebook.ipynb
unlicense
import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.tsa.stattools import coint, adfuller import matplotlib.pyplot as plt from quantopian.research.experimental import continuous_future, history """ Explanation: Mean Reversion on Futures by Rob Reider and Maxwell Margenot Part of the Qu...
computational-class/cjc2016
code/04.PythonCrawler_netease_music.ipynb
mit
import requests from bs4 import BeautifulSoup headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.6', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Coo...
deepfield/ibis
docs/source/notebooks/tutorial/6-Advanced-Topics-TopK-SelfJoins.ipynb
apache-2.0
import ibis import os hdfs_port = os.environ.get('IBIS_WEBHDFS_PORT', 50070) hdfs = ibis.hdfs_connect(host='quickstart.cloudera', port=hdfs_port) con = ibis.impala.connect(host='quickstart.cloudera', database='ibis_testing', hdfs_client=hdfs) ibis.options.interactive = True """ Explanation: A...
z01nl1o02/tests
notebooks/PCA.ipynb
gpl-2.0
import cv2 import sys,os import numpy as np sample_size = (64//2,64//2) smallset_size = 10 #每类下采样,方便调试 flag_debug = True def load_mnist(num_per_class, dataset_root="C:/dataset/mnist/",resize=sample_size): data_pairs = [] labeldict = {} ds_root = os.path.join(dataset_root,'train') for rdir, pdirs, na...
Konsang/Reinforcement-Learning
RL-Notebooks/Part1_1.ipynb
mit
import tensorflow as tf import numpy as np """ Explanation: The multi-armed bandit problem End of explanation """ bandits = [0.2, 0, -0.2, -5] # Random order num_bandits = len(bandits) def pullBandit(bandit): # Get a random number result = np.random.randn(1) if result > bandit: # return a positi...
phoebe-project/phoebe2-docs
2.2/tutorials/compute.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Compute Now that we have datasets added to our Bundle, our next step is to run the forward model and compute a synthetic model for each of these datasets. Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line i...
alasdairtran/mclearn
projects/peerjcs16/uci_datasets.ipynb
bsd-3-clause
import os import pandas as pd import numpy as np from mclearn.tools import fetch_data, download_data %load_ext autoreload %autoreload 2 uci_url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/' """ Explanation: UCI Datasets End of explanation """ url = uci_url + 'ionosphere/ionosphere.data' dest = 'dat...
tensorflow/docs
site/en/tutorials/distribute/multi_worker_with_estimator.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...
alephcero/adsProject
olds/DataAnalysis (para Ilan).ipynb
gpl-3.0
import pandas as pd import numpy as np import os import sys import simpledbf %pylab inline import matplotlib.pyplot as plt """ Explanation: Referencia: - http://dump.jazzido.com/CNPHV2010-RADIO/ - http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html Variables en el CENSO 2010 (INDEC) VIVIENDA.I...
staeiou/reddit_downvote
the_donald/td-analysis.ipynb
mit
import pandas as pd import seaborn as sns %matplotlib inline posts_df = pd.DataFrame.from_csv("reddit_posts_the_donald_201604.csv") posts_df[0:5] posts_df['created'] = pd.to_datetime(posts_df.created_utc, unit='s') posts_df['created_date'] = posts_df.created.dt.date posts_df['downs'] = posts_df.score - posts_df.up...
atulsingh0/MachineLearning
HandsOnML/code/05_support_vector_machines.ipynb
gpl-3.0
# To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals # Common imports import numpy as np import os # to make this notebook's output stable across runs np.random.seed(42) # To plot pretty figures %matplotlib inline import matplotlib import matplotlib.pyplot as plt ...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/Sorting_searching_and_counting_Solutions.ipynb
gpl-3.0
import numpy as np np.__version__ author = 'kyubyong. longinglove@nate.com' """ Explanation: Soring, searching, and counting End of explanation """ x = np.array([[1,4],[3,1]]) out = np.sort(x, axis=1) x.sort(axis=1) assert np.array_equal(out, x) print out """ Explanation: Sorting Q1. Sort x along the second axis....
luctrudeau/DaalaNotebooks
DCT/DCT fundamentals.ipynb
mpl-2.0
import numpy as np %pylab inline v = np.array([4, 2, 4, 2]) def showEnergy(e, title): x = np.arange(4) pylab.bar(x, e) pylab.yticks(range(0,5)) pylab.xticks([1, 2, 3, 4]) pylab.xlim(0, 4); pylab.ylim(0, 5); pylab.title(title) showEnergy(v, "Energy of the input vector") """ Explanation: P...
stijnvanhoey/course_gis_scripting
_solved/00-jupyter_introduction.ipynb
bsd-3-clause
from IPython.display import Image Image(url='http://python.org/images/python-logo.gif') """ Explanation: <p><font size="6"><b>Jupyter notebook INTRODUCTION </b></font></p> Introduction to GIS scripting May, 2017 © 2017, Stijn Van Hoey (&#115;&#116;&#105;&#106;&#110;&#118;&#97;&#110;&#104;&#111;&#101;&#121;&#64;&#103...
samkennerly/Fidelio
fidelio.ipynb
gpl-3.0
from fidelio_functions import * """ Explanation: Fidelio demo notebook End of explanation """ print(ALL_CAPS) for key, val in sorted(char_to_num(ALL_CAPS).items()): print(key,val) """ Explanation: Choose an alphabet Before sending any messages, we must agree on a way to represent characters as numbers. Fidelio...
mne-tools/mne-tools.github.io
dev/_downloads/6d98b103d247000f4433763dd76607c0/25_background_filtering.ipynb
bsd-3-clause
import numpy as np from numpy.fft import fft, fftfreq from scipy import signal import matplotlib.pyplot as plt from mne.time_frequency.tfr import morlet from mne.viz import plot_filter, plot_ideal_filter import mne sfreq = 1000. f_p = 40. # limits for plotting flim = (1., sfreq / 2.) # frequencies dlim = (-0.2, 0.2...
Diyago/Machine-Learning-scripts
general studies/learning python/learning pandas/stocks analysis.ipynb
apache-2.0
brent['Изм. %'] = brent['Изм. %'].str.replace(',', '.') brent['Изм. %'] = brent['Изм. %'].astype(float) print ('Brent сумма %: ' , brent['Изм. %'].sum()) rub['Изм. %'] = rub['Изм. %'].str.replace(',', '.') rub['Изм. %'] = rub['Изм. %'].astype(float) print ('USD/RUB сумма %: ' , rub['Изм. %'].sum()) """ Explanation:...
Boialex/MIPT-ML
hw1/2.prac.ipynb
gpl-3.0
digits = datasets.load_digits() digits digits_frame = DataFrame(digits.data) digits_frame['target'] = digits.target digits_frame.head() """ Explanation: Digits dataset End of explanation """ breast_cancer = datasets.load_breast_cancer() breast_cancer print breast_cancer.feature_names breast_cancer_frame = DataF...
KasperPRasmussen/bokeh
examples/howto/charts/bar.ipynb
bsd-3-clause
df['neg_mpg'] = 0 - df['mpg'] """ Explanation: Calculate some negative values to show handling of them End of explanation """ defaults.width = 550 defaults.height = 400 """ Explanation: Override some default values to avoid requiring input on each chart End of explanation """ bar_plot = Bar(df, label='cyl', title...
tensorflow/docs-l10n
site/en-snapshot/probability/examples/Variational_Inference_and_Joint_Distributions.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...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/21_stop_frequency.ipynb
bsd-3-clause
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Stop Frequency This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySim in estimation mode to read household travel su...
rohithmohan/aesop
docs/barnase_barstar_alascan.ipynb
gpl-3.0
from aesop import Alascan, plotScan_interactive, plotNetwork_interactive path_apbs = 'path\to\executable\apbs' path_coulomb = 'path\to\executable\coulomb' path_pdb2pqr = 'path\to\executable\pdb2pqr' jobname = 'alascan' pdbfile = 'barnase_barstar.pdb' selstr = ['chain A', 'chain B'] alascan = Alascan(pdb=pdbfile,...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/write_low_level_code.ipynb
apache-2.0
import numpy as np from matplotlib import pyplot as plt import tensorflow as tf print(tf.__version__) """ Explanation: Writing Low-Level TensorFlow Code Learning Objectives Practice defining and performing basic operations on constant Tensors Use Tensorflow's automatic differentiation capability Learn how to train a...
TomTranter/OpenPNM
examples/topology/Using Queries - Level 1.ipynb
mit
import openpnm as op import numpy as np np.random.seed(10) %matplotlib inline ws = op.Workspace() ws.settings["loglevel"] = 40 pn = op.network.Cubic(shape=[4, 4, 1]) """ Explanation: Using Neighborhood Queries The OpenPNM GenericNetwork objects (e.g. Cubic, Voronoi, etc) have methods that let you query the connected ...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/pandas/03.01-Introducing-Pandas-Objects.ipynb
mit
import numpy as np import pandas as pd """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub. The text is released under th...
jbusecke/xarrayutils
docs/utils.ipynb
mit
import xarray as xr import numpy as np %matplotlib inline path = 'http://apdrc.soest.hawaii.edu:80/dods/public_data/Argo_Products/monthly_mean/monthly_mixed_layer' ds = xr.open_dataset(path, use_cftime=True) ds ds.load() """ Explanation: Utilities for large scale climate data analysis The xarrayutils.utils module c...
aravindhv10/CPP_Wrappers
AntiQCD4/ML4JETS/ML4JetsCompare.ipynb
gpl-2.0
!pip install lightgbm !pip install shap """ Explanation: Install important packages for boosted decision trees End of explanation """ %tensorflow_version 1.x import lzma from google.colab import drive import numpy as np import tensorflow as tf import keras from keras import backend as K from keras.layers import Inpu...