repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
GoogleCloudPlatform/training-data-analyst
blogs/explainable_ai/AI_Explanations_on_CAIP.ipynb
apache-2.0
import os PROJECT_ID = "michaelabel-gcp-training" os.environ["PROJECT_ID"] = PROJECT_ID """ Explanation: AI Explanations: Explaining a tabular data model Overview In this tutorial we will perform the following steps: Build and train a Keras model. Export the Keras model as a TF 1 SavedModel and deploy the model on ...
rainyear/pytips
Tips/2016-04-13-Iterator-Tools.ipynb
mit
from itertools import cycle, count, repeat print(count.__doc__) counter = count() print(next(counter)) print(next(counter)) print(list(map(lambda x, y: x+y, range(10), counter))) odd_counter = map(lambda x: 'Odd#{}'.format(x), count(1, 2)) print(next(odd_counter)) print(next(odd_counter)) print(cycle.__doc__) cyc =...
H4ml3t/wmarchive-examples
How to write results into HDFS - example.ipynb
mit
# is SparkContext already loaded? sc # Make sure you have a HiveContext sqlContext # Which is the version? sc.version # load a dataframe from Avro files df = sqlContext.read.format("com.databricks.spark.avro").load("/cms/wmarchive/test/avro/2016/01/01/") df.printSchema() %%time df.count() """ Explanation: How to ...
gammapy/PyGamma15
tutorials/analysis-stats/Tutorial.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt """ Explanation: Tutorial about statistical methods The following contains a sequence of simple exercises, designed to get familiar with using Minuit for maximum likelihood fits and emcee to determine parameters by MCMC. Commands are generally comme...
georgetown-analytics/machine-learning
examples/bbengfort/bikeshare/bikeshare.ipynb
mit
import os import sys sys.path.append("/Users/benjamin/Repos/ddl/yellowbrick") import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set_context('notebook') sns.set_style('whitegrid') """ Explanation: Bikeshare Ridership Notebook to predict the number of riders per day ...
JustinNoel1/ML-Course
exercise-sessions/Session-11/Session-11.ipynb
apache-2.0
import numpy as np import pandas as pd """ Explanation: Problem Set 11 First the exercise: * What is the maximum depth of a decision tree trained on $N$ samples? The decision tree must make a proper split at each node, so the size of each node must reduce by at least one as we move down one level. So the maximum depth...
yunqu/PYNQ
boards/Pynq-Z1/base/notebooks/arduino/arduino_grove_gesture.ipynb
bsd-3-clause
from pynq.overlays.base import BaseOverlay base = BaseOverlay("base.bit") """ Explanation: Grove Gesture Example This example shows how to use the Grove gesture sensor on the board. The gesture sensor can detect 10 gestures as follows: | Raw value read by sensor | Gesture | |--------------------------|---...
relf/smt
tutorial/SMT_Noise.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from smt.surrogate_models import KRG # defining the training data xt = np.array([0.0, 1.0, 2.0, 2.5, 4.0]) yt = np.array([0.0, 1.0, 1.5, 1.1, 1.0]) # defining the models sm_noise_free = KRG() # noise-free Kriging model sm_noise_fixed = KRG(noise0=[1e-6]) # noisy Krig...
dwaithe/ONBI_image_analysis
day2_colocalisation/.ipynb_checkpoints/2015 Correlation and Colocalisation practical-checkpoint.ipynb
gpl-2.0
#This line is very important: (It turns on the inline visuals!) %pylab inline a = [2,9,32,12,14,6,9,23,4,5,13,6,7,92,21,45]; b = [7,21,4,2,92,9,9,6,13,12,45,5,6,23,14,32]; #Please calculate the dot product of the vectors 'a' and 'b'. #You may use any method you like. If get stuck. Check: #http://docs.scipy.org/doc/num...
schoolie/bokeh
examples/howto/charts/deep_dive-attributes.ipynb
bsd-3-clause
from bokeh.charts.attributes import AttrSpec, ColorAttr, MarkerAttr """ Explanation: Bokeh Charts Attributes One of Bokeh Charts main contributions is that it provides a flexible interface for applying unique attributes based on the unique values in column(s) of a DataFrame. Internally, the bokeh chart uses the AttrSp...
Diyago/Machine-Learning-scripts
DEEP LEARNING/NLP/LSTM RNN/Toxic multiclass prediction Glove + Bidirection LSTM.ipynb
apache-2.0
EMBEDDING_FILE = f'glove.6B.50d.txt' TRAIN_DATA_FILE = f'train.csv' TEST_DATA_FILE = f'test.csv' """ Explanation: We include the GloVe word vectors in our input files. To include these in your kernel, simple click 'input files' at the top of the notebook, and search 'glove' in the 'datasets' section. End of explanatio...
qutip/qutip-notebooks
docs/guide/Eseries.ipynb
lgpl-3.0
%matplotlib inline import numpy as np from pylab import * from qutip import * """ Explanation: Eseries Class Contents Exponential-Series Representation of Quantum Objects Applications of Exponential-Series End of explanation """ es1 = eseries(sigmax(), 1j) """ Explanation: <a id='exponential'></a> Exponential-Seri...
sujitpal/intro-dl-talk-code
src/01-nonlinearity.ipynb
unlicense
from __future__ import division, print_function from sklearn.cross_validation import train_test_split from keras.models import Sequential from keras.layers.core import Dense, Activation, Dropout from keras.utils import np_utils import numpy as np import matplotlib.pyplot as plt %matplotlib inline def read_dataset(fil...
marcinofulus/teaching
Python4physicists_SS2017/Python4hum-Jupyter_intro-from0.ipynb
gpl-3.0
for i in range(4): print(i) %matplotlib notebook import matplotlib.pyplot as plt import numpy as np X = np.linspace(-np.pi, np.pi, 656) F = np.sin(1/(X**2+0.07)) plt.plot(X,F) """ Explanation: Jupyter notebook Sposoby interakcji z programem komputerowym: terminal tekstowy GUI notatnik (NEW!) Jupyter Środowisko...
shngli/Data-Mining-Python
Mining massive datasets/MapReduce SVM.ipynb
gpl-3.0
from collections import defaultdict import math # determine if an integer n is a prime number def isPrime(n): if n == 2: return True if n%2 == 0 or n <= 1: return False sqr = int(math.sqrt(n)) + 1 for divisor in range(3, sqr, 2): if n%divisor == 0: return False r...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/p-Hacking_and_Multiple_Comparisons_Bias/notebook.ipynb
unlicense
import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt """ Explanation: p-Hacking and Multiple Comparisons Bias By Delaney Mackenzie and Maxwell Margenot. Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopian/research_public Notebook rele...
probml/pyprobml
notebooks/misc/GCP_CC_TPU_Pod_Slice_JAX.ipynb
mit
# Hints from : # https://medium.com/analytics-vidhya/how-to-access-files-from-google-cloud-storage-in-colab-notebooks-8edaf9e6c020 # https://stackoverflow.com/questions/57772453/login-on-colab-with-gcloud-without-service-account """ Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch3-Example_3-01.ipynb
unlicense
%pylab notebook """ Explanation: Electric Machinery Fundamentals 5th edition Chapter 3 (Code examples) Example 3-1 Calculate the net magetic field produced by a three-phase stator. Import the PyLab namespace (provides set of useful commands and constants like $\pi$) End of explanation """ bmax = 1 # Normal...
yevheniyc/C
1d_Biopython_Cookbook/Chapter_1.ipynb
mit
p = (4, 5, 6, 7) x, y, z, w = p # x -> 4 data = ['ACME', 50, 91.1, (2012, 12, 21)] name, _, price, date = data # name -> 'ACME', data -> (2012, 12, 21) s = 'Hello' a, b, c, d, e = s # a -> H p = (4, 5) x, y, z = p # "ValueError" """ Explanation: Chapter 1 - Data Structures and Algorithms 1.1 Unpacking a Sequence ...
kyledef/jammerwebscraper
Scrape Newsday.ipynb
mit
# Import dependencies (i.e. packages that extend the standard language to perform specific [advance] functionality) import urllib import urllib2 from datetime import datetime, date, timedelta from bs4 import BeautifulSoup """ Explanation: Web Scraping in Python Series Introduction The system will provide a simple exam...
Danghor/Algorithms
Python/Chapter-09/Union-Find-OO.ipynb
gpl-2.0
class UnionFind: def __init__(self, M): self.mParent = { x: x for x in M } self.mHeight = { x: 1 for x in M } """ Explanation: An Object-Oriented Implementation of the Union-Find Algorithm The class UnionFind maintains three member variables: - mParent is a dictionary that assigns each node to it...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/Bayesian_Gaussian_Mixture_Model.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...
balarsen/pymc_learning
StateSpace/Bayesian state space estimation in Python via Metropolis-Hastings.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import pymc as mc from scipy import signal import statsmodels.api as sm import matplotlib.pyplot as plt np.set_printoptions(precision=4, suppress=True, linewidth=120) """ Explanation: Bayesian state space estimation in Python via Metropolis-Hastings This pos...
ling7334/tensorflow-get-started
mnist/TensorFlow_Mechanics_101.ipynb
apache-2.0
data_sets = input_data.read_data_sets(FLAGS.train_dir, FLAGS.fake_data) """ Explanation: TensorFlow运作方式入门 代码:tensorflow/examples/tutorials/mnist/ 本篇教程的目的,是向大家展示如何利用TensorFlow使用(经典)MNIST数据集训练并评估一个用于识别手写数字的简易前馈神经网络(feed-forward neural network)。我们的目标读者,是有兴趣使用TensorFlow的资深机器学习人士。 因此,撰写该系列教程并不是为了教大家机器学习领域的基础知识。 在学习本教程之前,请确...
ocelot-collab/ocelot
demos/ipython_tutorials/9_thz_source.ipynb
gpl-3.0
# To activate interactive matplolib in notebook # %matplotlib notebook from ocelot import * from ocelot.gui import * import time #Initial Twiss parameters tws0 = Twiss() tws0.beta_x = 29.171 tws0.beta_y = 29.171 tws0.alpha_x = 10.955 tws0.alpha_y = 10.955 tws0.gamma_x = 4.148367385417024 tws0.gamma_y = 4.14836738541...
hanezu/cs231n-assignment
17-assignment2/TensorFlow.ipynb
mit
import tensorflow as tf import numpy as np import math import timeit import matplotlib.pyplot as plt %matplotlib inline from cs231n.data_utils import load_CIFAR10 def get_CIFAR10_data(num_training=49000, num_validation=1000, num_test=10000): """ Load the CIFAR-10 dataset from disk and perform preprocessing to...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/custom/sdk-custom-image-classification-online.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" ! pip install {U...
IS-ENES-Data/submission_forms
dkrz_forms/Templates/ESGF_replication_submission_form.ipynb
apache-2.0
# Evaluate this cell to identifiy your form from dkrz_forms import form_widgets, form_handler, checks form_infos = form_widgets.show_selection() # Evaluate this cell to generate your personal form instance form_info = form_infos[form_widgets.FORMS.value] sf = form_handler.init_form(form_info) form = sf.sub.entity_o...
w4zir/ml17s
lectures/lec07-logistic-regression.ipynb
mit
from IPython.display import Image Image(filename='images/06_03.jpg', width=1000) """ Explanation: CSAL4243: Introduction to Machine Learning Muhammad Mudassir Khan (mudasssir.khan@ucp.edu.pk) Lecture 7: Logistic Regression Overview Logistic Regression Resources Credits <br> <br> K - Nearest Neighbor Classifier End o...
mne-tools/mne-tools.github.io
0.23/_downloads/f574d1e7527e4460eb09a16f6f836e35/60_maxwell_filtering_sss.ipynb
bsd-3-clause
import os import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np import mne from mne.preprocessing import find_bad_channels_maxwell sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', ...
dlsun/symbulate
labs/Lab 3 - Discrete Distributions.ipynb
mit
from symbulate import * %matplotlib inline """ Explanation: Symbulate Lab 3 - Discrete Distributions This Jupyter notebook provides a template for you to fill in. Read the notebook from start to finish, completing the parts as indicated. To run a cell, make sure the cell is highlighted by clicking on it, then press ...
zegnus/self-driving-car-machine-learning
p13-final-project/ros/src/tl_detector/light_classification/scripts/visualize_bosch.ipynb
mit
import os, yaml import glob import numpy as np import pandas as pd import matplotlib.pyplot as plt from pandas.io.json import json_normalize import tensorflow as tf import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Visualize the Bosch Small Traffic Lights Dataset The Bosch small traffic lights datase...
agushman/coursera
src/cours_2/week_5/task_3.ipynb
mit
from sklearn import datasets digits = datasets.load_digits() X = digits.data y = digits.target from sklearn.cross_validation import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.75, random_state=0) def write_answer(data, file_name): with open(file_name, 'w') as fout: ...
QuantStack/quantstack-talks
2018-11-14-PyParis-widgets/notebooks/3.ipyleaflet.ipynb
bsd-3-clause
from ipyleaflet import Map, basemaps, basemap_to_tiles center = (52.204793, 360.121558) m = Map( layers=(basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, "2018-11-12"), ), center=center, zoom=4 ) m """ Explanation: <center><img src="src/ipyleaflet.svg" width="50%"></center> Repository: https://...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/art_and_science_of_ml/labs/export_data_from_bq_to_gcs.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst %pip install google-cloud-bigquery==1.25.0 """ Explanation: Exporting data from BigQuery to Google Cloud Storage In this notebook, we export BigQuery data to GCS so that we can reuse our Keras model that was developed on CSV data. End of explanation "...
arcyfelix/Courses
17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/02-NumPy/2-Numpy-Indexing-and-Selection.ipynb
apache-2.0
import numpy as np #Creating sample array arr = np.arange(0, 11) #Show arr """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> <center>Copyright Pierian Data 2017</center> <center>For more information, visit us at www.pieriandata.com</center> NumPy Indexing and Selectio...
NYUDataBootcamp/Projects
MBA_S16/Ahmad-Shah-NBA Contract Analysis.ipynb
mit
import sys # system module import pandas as pd # data package import matplotlib.pyplot as plt # graphics module import datetime as dt # date and time module import numpy as np # foundation for Pandas %matplotlib inline ...
r1rajiv92/data-512-a1
hcds-a1-data-curation.ipynb
mit
import requests import pandas endpoint = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}' headers={'User-Agent' : 'https://github.com/r1rajiv92', 'From' : 'rajiv92@uw.edu'} yearMonthCombinations = { '2015' : [ 7, 8, 9, 10, 11, 12], ...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a/td1a_cenonce_session2.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.1 - Variables, boucles, tests Répétitions de code, exécuter une partie plutôt qu'une autre. End of explanation """ i = 3 # entier = type numérique (type int) r = 3.3 # réel = type numérique (type...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/aws/aws.ipynb
mit
!ssh -i key.pem ubuntu@ipaddress """ Explanation: This notebook was prepared by Donne Martin. Source and license info is on GitHub. Amazon Web Services (AWS) SSH to EC2 Boto S3cmd s3-parallel-put S3DistCp Redshift Kinesis Lambda <h2 id="ssh-to-ec2">SSH to EC2</h2> Connect to an Ubuntu EC2 instance through SSH with ...
pastas/pasta
examples/notebooks/07_non_linear_recharge.ipynb
mit
import pandas as pd import pastas as ps import matplotlib.pyplot as plt ps.show_versions(numba=True) ps.set_log_level("INFO") """ Explanation: Non-linear recharge models R.A. Collenteur, University of Graz This notebook explains the use of the RechargeModel stress model to simulate the combined effect of precipitatio...
ES-DOC/esdoc-jupyterhub
notebooks/cmcc/cmip6/models/cmcc-esm2-sr5/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-esm2-sr5', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: CMCC Source ID: CMCC-ESM2-SR5 Topic: Ocean Sub-Topics: Timestepping Framework, A...
efoley/deep-learning
sentiment-rnn/Sentiment RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('reviews.txt', 'r') as f: reviews = f.read() with open('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 network that performs sentiment analysis....
mmadsen/experiment-seriation-classification
analysis/sc-1-3/sc-1-seriation-feature-engineering.ipynb
apache-2.0
import numpy as np import networkx as nx import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import cPickle as pickle from copy import deepcopy %matplotlib inline plt.style.use("fivethirtyeight") sns.set() all_graphs = pickle.load(open("train-cont-graphs.pkl",'r')) all_labels = pickle.load(open(...
pushpajnc/models
predicting-house-prices/housing-project-V1.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd import visuals as vs # Supplementary code from sklearn.cross_validation import ShuffleSplit from IPython.display import display # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('h...
dsacademybr/PythonFundamentos
Cap06/Notebooks/DSA-Python-Cap06-08-Retornando Dados do MongoDB.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 6</font> Download: http://github.com/dsacademybr End of explanation """ # Impor...
stephenpardy/PythonNotebooks
astro/IntroIllustrisNotebook.ipynb
gpl-2.0
!pip install astropy import numpy as np import matplotlib.pyplot as plt import h5py import astropy.table as atpy import requests import os %matplotlib inline #input your own api key; your key is listed here after login: http://www.illustris-project.org/data/ apikey= def get(path, params=None): # make HTTP GE...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/5b_deploy_keras_ai_platform_babyweight.ipynb
apache-2.0
import os """ Explanation: LAB 5b: Deploy and predict with Keras model on Cloud AI Platform. Learning Objectives Setup up the environment Deploy trained Keras model to Cloud AI Platform Online predict from model on Cloud AI Platform Batch predict from model on Cloud AI Platform Introduction In this notebook, we'll ...
NAU-CFL/Python_Learning_Source
06_Functions_Lecture.ipynb
mit
def average(n1, n2, n3): # Function Header # Function Body res = (n1+n2+n3)/3.0 return res num1 = 10 num2 = 25 num3 = 16 print(average(num1, num2, num3)) average(100, 90, 29) average(1.2, 6.7, 8) def power(n1, n2): return (n1 ** n2) print(power(2, 3)) 2**3 """ Explanation: Functions Sometimes wh...
drphilmarshall/StatisticalMethods
tutorials/Week3/Metropolis.ipynb
gpl-2.0
import numpy as np import statsmodels.api as sm import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import scipy.stats %matplotlib inline class SolutionMissingError(Exception): def __init__(self): Exception.__init__(self,"You need to complete the solution for this code to work!") def ...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Random_Variables/notebook.ipynb
unlicense
import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.stats as stats from statsmodels.stats import stattools from __future__ import division """ Explanation: Discrete and Continuous Random Variables by Maxwell Margenot Revisions by Delaney Granizo Mackenzie Part of the Quantopian Le...
GoogleCloudPlatform/ml-design-patterns
03_problem_representation/neutral.ipynb
apache-2.0
import numpy as np import pandas as pd def create_synthetic_dataset(N, shuffle): # random array prescription = np.full(N, fill_value='acetominophen', dtype='U20') prescription[:N//2] = 'ibuprofen' np.random.shuffle(prescription) # neutral class p_neutral = np.full(N, fill_value='Neutral', ...
pligor/predicting-future-product-prices
02_preprocessing/exploration03-price_history_standardization.ipynb
agpl-3.0
stds_threshold = std*3 stds_threshold min(df_norm_prices.iloc[0]) """ Explanation: Trust only up to three standard deviations. Which is expected, ~75 euros difference from the original price is the maximum of what normally see as a customer End of explanation """ keep_inds = [ii for ii in range(len(df_norm_prices))...
j-coll/opencga
opencga-client/src/main/python/notebooks/pyopencga_basic_notebook_003-variants.ipynb
apache-2.0
# Initialize PYTHONPATH for pyopencga import sys import os from pprint import pprint cwd = os.getcwd() print("current_dir: ...."+cwd[-10:]) base_modules_dir = os.path.dirname(cwd) print("base_modules_dir: ...."+base_modules_dir[-10:]) sys.path.append(base_modules_dir) from pyopencga.opencga_config import ConfigClie...
RaoUmer/lightning-example-notebooks
images/image-poly.ipynb
mit
from lightning import Lightning from sklearn import datasets """ Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Image polygon plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a> <hr> Setup En...
sanabasangare/data-visualization
fin_MPT.ipynb
mit
import numpy as np import pandas as pd from pandas_datareader import data as web import matplotlib.pyplot as plt import seaborn as sns; sns.set() %matplotlib inline import warnings; warnings.simplefilter('ignore') """ Explanation: Modern Portfolio Theory (MPT) analysis with python Modern portfolio theory (MPT) also k...
thunder-project/thunder-docs
tutorials/registration.ipynb
mit
%matplotlib inline import seaborn as sns import matplotlib.pyplot as plt from showit import image, tile sns.set_style('darkgrid') sns.set_context('notebook') import thunder as td """ Explanation: Image registration A common problem when working with collections of images is registering or aligning them, relative to ...
basp/aya
.ipynb_checkpoints/noise_old-checkpoint.ipynb
mit
v0 = 2 v1 = 5 plt.plot([0, 1], [2, 5], '--') t = 1.0 / 3 vt = noise.lerp(2, 5, t) plt.plot(t, vt, 'ro') """ Explanation: linear interpolation We need a function ${f}$ that, given values ${v_0}$ and ${v_1}$ and some interval ${t}$ where $0 \le {t} \le 1$, returns an interpolated value between ${v_0}$ and ${v_1}$. The ...
Condla/notebooks
IPythonMachineLearningIntro.ipynb
gpl-2.0
%matplotlib inline from sklearn import datasets from sklearn import linear_model from sklearn import cross_validation import matplotlib.pyplot as plt import pandas as pd import warnings warnings.filterwarnings('ignore') """ Explanation: Introduction: Python + Machine Learning This IPython notebook is public, can be ...
pycrystem/pycrystem
doc/demos/02 GaAs Nanowire - Phase Mapping - Orientation Mapping.ipynb
gpl-3.0
%matplotlib inline import numpy as np import diffpy.structure import pyxem as pxm import hyperspy.api as hs accelarating_voltage = 200 # kV camera_length = 0.2 # m diffraction_calibration = 0.032 # px / Angstrom """ Explanation: Phase/Orientation Mapping This tutorial demonstrates how to achieve phase and orienta...
JasonSanchez/w261
exams/w261mt/Midterm MRjob code.ipynb
mit
%matplotlib inline import numpy as np import pylab size = 1000 x = np.random.uniform(-40, 40, size) y = x * 1.0 - 4 + np.random.normal(0,5,size) data = zip(range(size),y,x) #data = np.concatenate((y, x), axis=1) np.savetxt('LinearRegression.csv',data,'%i,%f,%f') data[:10] """ Explanation: DATASCI W261: Machine Learn...
flohorovicic/pynoddy
docs/notebooks/Feature-Analysis.ipynb
gpl-2.0
from IPython.core.display import HTML css_file = 'pynoddy.css' HTML(open(css_file, "r").read()) import sys, os import matplotlib.pyplot as plt # adjust some settings for matplotlib from matplotlib import rcParams # print rcParams rcParams['font.size'] = 15 # determine path of repository to set paths corretly below rep...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-ll/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-ll', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-LL Topic: Land Sub-Topics: Soil, Snow, Vegetation, ...
poolio/unrolled_gan
Unrolled GAN demo.ipynb
mit
%pylab inline from collections import OrderedDict import tensorflow as tf ds = tf.contrib.distributions slim = tf.contrib.slim from keras.optimizers import Adam try: from moviepy.video.io.bindings import mplfig_to_npimage import moviepy.editor as mpy generate_movie = True except: print("Warnin...
TheKingInYellow/PySeidon
PySeidon_tuto_3.ipynb
agpl-3.0
%pylab inline """ Explanation: PySeison - Tutorial 3: ADCP class End of explanation """ from pyseidon import * """ Explanation: 1. PySeidon - ADCP object initialisation Similarly to the "TideGauge class" and the "Drifter class", the "ADCP class" is a measurement-based object. 1.1. Package importation As any other l...
intel-analytics/BigDL
python/orca/colab-notebook/quickstart/autoxgboost_regressor_sklearn_boston.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed un...
metpy/MetPy
dev/_downloads/324acb7faa1ec1d6ac5849ea2223364d/Smoothing.ipynb
bsd-3-clause
from itertools import product import matplotlib.pyplot as plt import numpy as np import metpy.calc as mpcalc """ Explanation: Smoothing Using MetPy's smoothing functions. This example demonstrates the various ways that MetPy's smoothing function can be utilized. While this example utilizes basic NumPy arrays, these ...
ioam/scipy-2017-holoviews-tutorial
solutions/07-working-with-large-datasets-with-solutions.ipynb
bsd-3-clause
import pandas as pd import holoviews as hv import dask.dataframe as dd import datashader as ds import geoviews as gv from holoviews.operation.datashader import datashade, aggregate hv.extension('bokeh') """ Explanation: <a href='http://www.holoviews.org'><img src="assets/hv+bk.png" alt="HV+BK logos" width="40%;" alig...
karlstroetmann/Artificial-Intelligence
Python/5 Linear Regression/Simple-Linear-Regression-with-SciKit-Learn.ipynb
gpl-2.0
import pandas as pd """ Explanation: Simple Linear Regression with SciKit-Learn We import the module pandas. This module implements so called <em style="color:blue;">data frames</em> and is more convenient than the module csv when reading a <tt>csv</tt> file. End of explanation """ cars = pd.read_csv('cars.csv') ca...
jamesdj/tobit
tobit.ipynb
mit
rs = np.random.RandomState(seed=10) ns = 100 nf = 10 x, y_orig, coef = make_regression(n_samples=ns, n_features=nf, coef=True, noise=0.0, random_state=rs) x = pd.DataFrame(x) y = pd.Series(y_orig) n_quantiles = 3 # two-thirds of the data is truncated quantile = 100/float(n_quantiles) lower = np.percentile(y, quantile)...
cucs-numpde/class
Fundamentals.ipynb
bsd-2-clause
%matplotlib notebook import numpy from matplotlib import pyplot pyplot.style.use('ggplot') def u_n(n): x = numpy.linspace(0,1,n) return x, 1 + x + x**2/2 + x**3/6 for n in (40, 20, 10): x, y = u_n(n) pyplot.plot(x, y, 'o', label='$u_{%d}(x)$' % n) pyplot.plot(x, numpy.exp(x), label='$\exp(x)$') pyplot...
kvr777/deep-learning
tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.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...
jdhp-docs/python-notebooks
python_collections_en.ipynb
mit
import collections """ Explanation: Import directives End of explanation """ d = collections.OrderedDict() d["2"] = 2 d["3"] = 3 d["1"] = 1 print(d) print(type(d.keys())) print(list(d.keys())) print(type(d.values())) print(list(d.values())) for k, v in d.items(): print(k, v) """ Explanation: Ordered dictio...
oroszl/mezo
1D.ipynb
gpl-3.0
%pylab inline from ipywidgets import * """ Explanation: Exploring 1D scattering problems on a lattice First let us load matplotlib and numpy by evoking pylab and also let us import interactive widgets from ipywidgets. This is a quick and easy way to set up a simple environment for numerical calculations. End of explan...
bosscha/alma-calibrator
notebooks/2mass/11_PCA_combine_test_matchagain.ipynb
gpl-2.0
#obj = ["3C 454.3", 343.49062, 16.14821, 1.0] #obj = ["PKS J0006-0623", 1.55789, -6.39315, 1.0] obj = ["M87", 187.705930, 12.391123, 1.0] #### name, ra, dec, radius of cone obj_name = obj[0] obj_ra = obj[1] obj_dec = obj[2] cone_radius = obj[3] obj_coord = coordinates.SkyCoord(ra=obj_ra, dec=obj_dec, unit=(u.deg,...
UltronAI/Deep-Learning
CS231n/assignment3/StyleTransfer-TensorFlow.ipynb
mit
%load_ext autoreload %autoreload 2 from scipy.misc import imread, imresize import numpy as np from scipy.misc import imread import matplotlib.pyplot as plt # Helper functions to deal with image preprocessing from cs231n.image_utils import load_image, preprocess_image, deprocess_image %matplotlib inline def get_ses...
sns-chops/multiphonon
tests/notebooks/getdos-multiple-Ei.ipynb
mit
# where am I now? !pwd # create a new working directory and change into it workdir = '~/reduction/ARCS/getdos-multiple-Ei-demo' !mkdir -p {workdir} %cd {workdir} # Data to reduce. Change the IPTS number and run numbers to suit your need samplenxs = "/SNS/ARCS/IPTS-15398/shared/mantid_reduce/non-radC/non-radC_130p00.n...
turbomanage/training-data-analyst
courses/machine_learning/cloudmle/cloudmle.ipynb
apache-2.0
import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID REGION = 'us-central1' # Choose an available region for Cloud MLE from https://cloud.google.com/ml-engine/docs/regions. BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME. Use a regional bucket in the region you selected. # for b...
radajin/whoscored
recomend_position/recomend_position_1.ipynb
mit
%matplotlib inline %config InlineBackend.figure_formats = {'png', 'retina'} import numpy as np import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl import pandas as pd import MySQLdb from sklearn.tree import export_graphviz from sklearn.cross_validation import train_test_split from sklearn.m...
tbarrongh/cosc-learning-labs
src/notebook/03_management_interface.ipynb
apache-2.0
help('learning_lab.03_management_interface') """ Explanation: COSC Learning Lab 03_management_interface.py Related Scripts: * 03_interface_configuration.py * 01_device_control.py * 01_inventory_mounted.py Table of Contents Table of Contents Documentation Implementation Execution HTTP Documentation End of explanation...
tensorflow/docs
site/en/guide/migrate/model_mapping.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...
tridesclous/tridesclous
example/example_locust_dataset.ipynb
mit
%matplotlib inline import time import numpy as np import matplotlib.pyplot as plt import tridesclous as tdc from tridesclous import DataIO, CatalogueConstructor, Peeler """ Explanation: tridesclous example with locust dataset Here a detail notebook that detail the locust dataset recodring by Christophe Pouzat. This ...
quantopian/alphalens
alphalens/examples/intraday_factor.ipynb
apache-2.0
%pylab inline --no-import-all import alphalens import pandas as pd import numpy as np import datetime import warnings warnings.filterwarnings('ignore') """ Explanation: Alphalens: intraday factor In this notebook we use Alphalens to analyse the performance of an intraday factor, which is computed daily but the stocks...
bjackman/lisa
ipynb/examples/wlgen/rtapp_example.ipynb
apache-2.0
import logging from conf import LisaLogging LisaLogging.setup() # Generate plots inline %pylab inline import json import os # Support to initialise and configure your test environment import devlib from env import TestEnv # Support to configure and run RTApp based workloads from wlgen import RTA, Periodic, Ramp, St...
anonyXmous/CapstoneProject
Mini_Project_Naive_Bayes.ipynb
unlicense
%matplotlib inline import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.cm as cm import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from six.moves import range # Setup Pandas pd.set_option('display.width', 500) pd.set_option('display.max_columns', 100) pd.set_option('...
anonyXmous/CapstoneProject
Mini_Project_Clustering.ipynb
unlicense
%matplotlib inline import pandas as pd import sklearn import matplotlib.pyplot as plt import seaborn as sns # Setup Seaborn sns.set_style("whitegrid") sns.set_context("poster") """ Explanation: Customer Segmentation using Clustering This mini-project is based on this blog post by yhat. Please feel free to refer to t...
oemof/examples
oemof_examples/oemof.solph/v0.4.x/jupyter_tutorials/1_Simple_dispatch_store_results.ipynb
gpl-3.0
import os import pandas as pd from oemof.solph import (Sink, Source, Transformer, Bus, Flow, Model, EnergySystem, processing, views) import pickle """ Explanation: Energy system optimisation with oemof - how to collect and store results Import necessary modules End of explanation """ solver...
gregnordin/ECEn360_Winter2016
transmission_lines/01c_standingwaveanimation.ipynb
mit
import numpy as np from matplotlib import pyplot as plt from matplotlib import animation # Switch to a backend that supports FuncAnimation plt.switch_backend('tkagg') print 'Matplotlib graphics backend in use:',plt.get_backend() """ Explanation: Sinusoidal Steady State Voltage on a Transmission Line The voltage on a ...
atulsingh0/MachineLearning
ML_UoW/Course00_MLFoundation/03_Classification_Analyzing_Product_Sentiment-Quiz.ipynb
gpl-3.0
# ignoring the 3 star rating data2 = data[data['rating'] != 3 ] data2['sentiment'] = data2['rating'] > 3 data2.head(5) # training the classifier model # first, spliting the data into train and test datasets train_data, test_data = data2.random_split(0.8, seed=0) sentiment_model = gl.logistic_classifier.create(trai...
iRipVanWinkle/ml
Data Science UA - September 2017/Lecture 04 - Overview of Linear Algebra and Matrix Computations/Finding a Root of a Function - Bisection and Newton Methods.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Finding the Root (Zero) of a Function Finding the root, or zero, of a function is a very common task in exploratory computing. This Notebook presents the Bisection method and Newton's method for finding the root, or 0, of a function...
fastai/course-v3
zh-nbs/Lesson5_sgd_mnist.ipynb
apache-2.0
%matplotlib inline from fastai.basics import * """ Explanation: Practical Deep Learning for Coders, v3 Lesson5_sgd_mnist End of explanation """ path = Config().data_path()/'mnist' path.ls() with gzip.open(path/'mnist.pkl.gz', 'rb') as f: ((x_train, y_train), (x_valid, y_valid), _) = pickle.load(f, encoding='la...
phoebe-project/phoebe2-docs
2.0/examples/single_spots.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: Single Star with Spots Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ import phoebe fro...
ML4DS/ML4all
R5.Bayesian_Regression/.ipynb_checkpoints/Bayesian_regression-checkpoint.ipynb
mit
# Import some libraries that will be necessary for working with data and displaying plots # To visualize plots in the notebook %matplotlib inline from IPython import display import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy.io # To read matlab files import pylab import time """...
materialsproject/mapidoc
index.ipynb
bsd-3-clause
# We start by importing MPRester, which is available from the root import of pymatgen. from pymatgen import MPRester from pprint import pprint # Initializing MPRester. Note that you can call MPRester. MPRester looks for the API key in two places: # - Supplying it directly as an __init__ arg. # - Setting the "MAPI_KEY...
zomansud/coursera
ml-regression/week-2/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...
ChadFulton/statsmodels
examples/notebooks/ols.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std np.random.seed(9876789) """ Explanation: Ordinary Least Squares End of explanation """ nsample = 100 x = np....
gdementen/larray
doc/source/tutorial/tutorial_aggregations.ipynb
gpl-3.0
from larray import * """ Explanation: Aggregations Import the LArray library: End of explanation """ # load the 'demography_eurostat' dataset demography_eurostat = load_example_data('demography_eurostat') # extract the 'country', 'gender' and 'time' axes country = demography_eurostat.country gender = demography_eur...
darcamo/pyphysim
apps/comp_BD/Block Diagonalization.ipynb
gpl-2.0
%pylab inline """ Explanation: Simulation Results for the Enhanced Block Diagonalization algorithm Initializations Here we import some packages and do some initialization. End of explanation """ import sys sys.path.append("/home/darlan/cvs_files/pyphysim/") # xxxxxxxxxx Import Statements xxxxxxxxxxxxxxxxxxxxxxxxxxxx...
akshaybabloo/Car-ND
Term_1/CNN_5/LeNet_8/LeNet_8_2.ipynb
mit
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("./MNIST_data/", reshape=False) X_train, y_train = mnist.train.images, mnist.train.labels X_validation, y_validation = mnist.validation.images, mnist.validation.labels X_test, y_test = mnist.test.images, ...
bearing/dosenet-analysis
Programming Lesson Modules/Module 3- Simple Plots and Histograms.ipynb
mit
%matplotlib inline # Enables IPython matplotlib mode which allows plots to be shown in # markdown sections. Not necessary in functionality of code. import csv import io import urllib.request import matplotlib.pyplot as plt # matplotlib is one of the most frequently used Python extensions for p...