repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
cbessega/udacity-deep_learning-project1
DLND-your-first-network/dlnd-your-first-neural-network.ipynb
apache-2.0
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
kaiping/incubator-singa
doc/en/docs/notebook/cnn.ipynb
apache-2.0
from __future__ import division from builtins import zip from builtins import str from builtins import range from past.utils import old_div from future import standard_library from __future__ import print_function from tqdm import tnrange, tqdm_notebook standard_library.install_aliases() import pickle, gzip # Load th...
Featuretools/featuretools
docs/source/guides/deployment.ipynb
bsd-3-clause
import featuretools as ft es_train = ft.demo.load_mock_customer(return_entityset=True) es_test = ft.demo.load_mock_customer(return_entityset=True, random_seed=33) """ Explanation: Deployment Deployment of machine learning models requires repeating feature engineering steps on new data. In some cases, these steps need...
walkowiak/mips
tests/ours-on-wiki-test.ipynb
mit
cd .. """ Explanation: Prerequisites: python 3.6, we use the f-string notation ( pep 498 ). Alternatively you can modify the code to use python 3.5-compatible formatting Best way to get python is via Anaconda You need to install tinydb: pip install tinydb You need to build our python wrappers: make bind You...
JackDi/phys202-2015-work
assignments/assignment09/IntegrationEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy import integrate """ Explanation: Integration Exercise 2 Imports End of explanation """ def integrand(x, a): return 1.0/(x**2 + a**2) def integral_approx(a): # Use the args keyword argument to feed extra a...
maxis42/ML-DA-Coursera-Yandex-MIPT
1 Mathematics and Python/Lectures notebooks/12 sample distribution evaluation/sample_distribution_evaluation.ipynb
mit
sample = np.random.choice([1,2,3,4,5,6], 100) """ Explanation: Дискретное распределение Сгенерируем выборку объёма 100 из дискретного распределения с шестью равновероятными исходами. End of explanation """ # посчитаем число выпадений каждой из сторон: from collections import Counter c = Counter(sample) print("Числ...
unpingco/Python-for-Probability-Statistics-and-Machine-Learning
chapters/machine_learning/notebooks/svm.ipynb
mit
from sklearn.datasets import make_blobs from sklearn.svm import SVC sv = SVC(kernel='linear') """ Explanation: Support Vector Machines Support Vector Machines (SVM) originated from the statistical learning theory developed by Vapnik-Chervonenkis. As such, it represents a deep application of statistical theory that inc...
hannorein/reboundx
ipython_examples/TidesConstantTimeLag.ipynb
gpl-3.0
import rebound import reboundx import numpy as np %matplotlib inline import matplotlib.pyplot as plt def getsim(): sim = rebound.Simulation() sim.units = ('yr', 'AU', 'Msun') sim.add(m=0.86) # post-MS Sun sim.add(m=3.e-6, a=1., e=0.03) # Earth sim.move_to_com() rebx = reboundx.Extras(si...
ml4a/ml4a-guides
examples/info_retrieval/image-path.ipynb
gpl-2.0
%matplotlib inline import os import random import numpy as np import pickle import matplotlib.pyplot from matplotlib.pyplot import imshow from PIL import Image from scipy.spatial import distance from igraph import * from tqdm import tqdm """ Explanation: Shortest path between images This notebook demonstrates how, giv...
aldian/tensorflow
tensorflow/compiler/xla/g3doc/tutorials/compile.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...
kevinjliang/Duke-Tsinghua-MLSS-2017
01A_TensorFlow_Basics.ipynb
apache-2.0
# Beginning a line with "!" allows you to execute a command in your terminal # You'll need to install these packages for certain lines of this notebook if you don't already have them. !conda install -y matplotlib !pip install -U tqdm %matplotlib inline import numpy as np import matplotlib.pyplot as plt from tqdm impo...
CitizensCode/PopulationFlow
PopulationFlow.ipynb
apache-2.0
flowData = pd.read_csv('../TableD_01110030-eng.csv') flowData.head() # Convert place names to unicode flowData['GEO'] = flowData['GEO'].map(u) flowData['GEODEST'] = flowData['GEODEST'].map(u) flowData.head() # Remove unneeded columns dropCols = ['Geographical classification', 'Geographical classification.1...
landlab/landlab
notebooks/tutorials/marine_sediment_transport/simple_submarine_diffuser_tutorial.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from landlab import RasterModelGrid from landlab.components import SimpleSubmarineDiffuser grid = RasterModelGrid((3, 51)) # grid has just one row of core nodes # Close top and bottom boundaries grid.set_closed_boundaries_at_grid_edges(False, True, False, True) # W...
tensorflow/docs-l10n
site/en-snapshot/tfx/tutorials/tfx/penguin_tfdv.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...
adrn/thejoker
docs/examples/Thompson-black-hole.ipynb
mit
from astropy.io import ascii from astropy.time import Time import astropy.units as u import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pymc3 as pm import pymc3_ext as pmx import exoplanet.units as xu import exoplanet as xo import corner import arviz as az import thejoker as tj from twobody....
turbomanage/training-data-analyst
quests/serverlessml/02_bqml/labs/first_model.ipynb
apache-2.0
%%bash export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT import os PROJECT = "your-gcp-project-here" # REPLACE WITH YOUR PROJECT NAME REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # Do not change these os.environ[...
mjcollin/2016spr
notebook/Entities_Pandas.ipynb
mit
%matplotlib inline from __future__ import print_function import os from pyspark import SQLContext from pyspark.sql import Row import pyspark.sql.functions as sql #from pyspark.sql.functions import udf, length import matplotlib.pyplot as plt import numpy import math import matplotlib.pyplot as plt import seaborn as sns ...
YuriyGuts/kaggle-quora-question-pairs
notebooks/feature-3rdparty-abhishek.ipynb
mit
from pygoose import * import os import warnings import gensim from fuzzywuzzy import fuzz from nltk import word_tokenize from nltk.corpus import stopwords from scipy.stats import skew, kurtosis from scipy.spatial.distance import cosine, cityblock, jaccard, canberra, euclidean, minkowski, braycurtis """ Explanatio...
sorig/shogun
doc/ipython-notebooks/clustering/KMeans.ipynb
bsd-3-clause
from numpy import concatenate, array from numpy.random import randn import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') num = 200 d1 = concatenate((randn(1,num),10.*randn(1,num)),0) d2 = concatenate((randn(1,num),10.*randn(1,num)),0)+array([[10.],[0.]]) d3 = concatenate((randn(1,num),10.*randn(1,nu...
dato-code/tutorials
strata-nyc-2015/feature_engineering/PCA demo.ipynb
apache-2.0
import matplotlib matplotlib.use('nbagg') %matplotlib inline import graphlab as gl """ Explanation: Let's apply PCA to analyze voting patterns End of explanation """ reviews = gl.SFrame.read_csv('../data/yelp/yelp_training_set_review.json', header=False) reviews = reviews.unpack('X1','') reviews = reviews.unpack('v...
jinntrance/MOOC
coursera/ml-foundations/week2/Predicting house prices.ipynb
cc0-1.0
import graphlab """ Explanation: Fire up graphlab create End of explanation """ sales = graphlab.SFrame('home_data.gl/') sales """ Explanation: Load some house sales data Dataset is from house sales in King County, the region where the city of Seattle, WA is located. End of explanation """ graphlab.canvas.set_ta...
espenhgn/LFPy
examples/LFPy-example-03.ipynb
gpl-3.0
import LFPy import numpy as np import os import sys from urllib.request import urlopen import ssl import zipfile import matplotlib.pyplot as plt from matplotlib.collections import PolyCollection from os.path import join """ Explanation: Example plot for LFPy: Single-synapse contribution to the LFP Copyright (C) 2017 C...
dnc1994/MachineLearning-UW
ml-regression/lasso.ipynb
mit
import graphlab """ Explanation: Regression Week 5: Feature Selection and LASSO (Interpretation) In this notebook, you will use LASSO to select features, building on a pre-implemented solver for LASSO (using GraphLab Create, though you can use other solvers). You will: * Run LASSO with different L1 penalties. * Choose...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_object_raw.ipynb
bsd-3-clause
import mne import os.path as op from matplotlib import pyplot as plt """ Explanation: The :class:Raw <mne.io.Raw> data structure: continuous data Continuous data is stored in objects of type :class:Raw <mne.io.Raw>. The core data structure is simply a 2D numpy array (channels × samples) (in memory or loade...
ga7g08/ga7g08.github.io
_notebooks/2015-03-19-Income-Distribution-in-the-UK.ipynb
mit
data_dir = "./DataIncomeInvestigation" if not os.path.isdir(data_dir): os.makedirs(data_dir) """ Explanation: Getting hold of and cleaning up income data for the UK In this post I will be downloading data from the HMRC on income in the UK. The data provides the mean and median income before and after tax split by ...
terapyon/scsk-oss-x-users-meeting-19
4-machine-learning.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd df = pd.read_pickle("df.db") """ Explanation: 機械学習をやってみる この章で扱うもの 前章で作った各種データを再利用 機械学習を行ってみる 学習結果の評価を行う 機械学習の改善方法 この章で取り扱う手順 学習データとテストデータの分割 sklearnを用いて学習 評価 交差検証 グリットサーチ 各種モデルを試す 評価結果の再確認 End of explanation """ df.head() X = df.iloc[:, 3:] X.head() y...
cweinschenk/cweinschenk
Map_Plotting/NIST_Studies/NIST_Study_Map.ipynb
mit
import pandas as pd from bokeh.models.glyphs import Circle from bokeh.plotting import show, output_notebook,figure from bokeh.models import ( GMapPlot, GMapOptions, Range1d, ColumnDataSource, LinearAxis, PanTool, WheelZoomTool,HoverTool, TapTool, OpenURL) output_notebook() """ Explanation: Fire research at the...
MarsUniversity/ece387
website/block_3_vision/lsn15/lsn15.ipynb
mit
%matplotlib inline from __future__ import print_function from __future__ import division import cv2 # opencv itself import numpy as np # matrix manipulations from matplotlib import pyplot as plt # this lets you draw inline pictures in the notebooks import pylab # t...
shaivaldalal/CS6053_DataScience
HW4_sd3462.ipynb
mit
import pandas as pd import numpy as np from collections import Counter from sklearn.preprocessing import scale def cleanBosonData(infile_name): raw=pd.read_csv(infile_name,header=0,index_col=0,na_values=-999) raw=raw.replace({'Label':{Counter(raw['Label']).most_common()[0][0]:0,Counter(raw['Label']).most_commo...
ES-DOC/esdoc-jupyterhub
notebooks/mpi-m/cmip6/models/icon-esm-lr/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mpi-m', 'icon-esm-lr', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: MPI-M Source ID: ICON-ESM-LR Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy...
explosion/thinc
examples/01_intro_model_definition_methods.ipynb
mit
!pip install "thinc>=8.0.0" """ Explanation: Intro to Thinc's Model class, model definition and methods Thinc follows a functional-programming approach to model definition. Its approach is especially effective for complicated network architectures, and use cases where different data types need to be passed through the...
rdempsey/web-scraping-data-mining-course
week8/2_bi_dashboards_reporting/2 - Build a Shareable Dashboard Using iPython Notebook and Matplotlib.ipynb
mit
# Import the Python libraries we need import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt %matplotlib inline # Define a variable for the accidents data file accidents_data_file = '/Users/robert.dempsey/Dropbox/Private/Art of Skill Hacking/Books/' \ 'Python Bu...
mangecoeur/pineapple
data/examples/python3.5/Packages.ipynb
gpl-3.0
import pineapple %pip freeze """ Explanation: Packages Pineapple is a self-contained application that includes a copy of Python 3.5. Upon installation, several useful packages are already installed and available for use without further setup. In addition, Pineapple includes commands to help you manage your Python pack...
nehal96/Deep-Learning-ND-Exercises
Sentiment Analysis/Sentiment Analysis with Andrew Trask/2-creating-input-output-data.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
quantopian/research_public
notebooks/lectures/ARCH_GARCH_and_GMM/notebook.ipynb
apache-2.0
import cvxopt from functools import partial import math import numpy as np import scipy from scipy import stats import statsmodels.api as sm from statsmodels.stats.stattools import jarque_bera import matplotlib.pyplot as plt """ Explanation: Generalized Method of Moments with ARCH and GARCH Models By Delaney Granizo-...
probml/pyprobml
notebooks/book1/19/finetune_cnn_jax.ipynb
mit
# Install Augmax for Image Augmentation try: import augmax except ModuleNotFoundError: %pip install -qq git+https://github.com/khdlr/augmax.git -q import augmax # Install the jax-resnet try: import jax_resnet except ModuleNotFoundError: %pip install -qq git+https://github.com/n2cholas/jax-resnet.g...
brain-research/guided-evolutionary-strategies
Guided_Evolutionary_Strategies_Demo_Jax.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
Iwan-Zotow/VV
C25_GP3phsp.ipynb
mit
import math import matplotlib import numpy as np import matplotlib.pyplot as plt import BEAMphsf import beam_loader import H1Dn import H1Du import ListTable %matplotlib inline def cm2mm(value): """ converts cm to mm """ return value*10.0 """ Explanation: Validation and Verification of the 25mm coll...
BrownDwarf/ApJdataFrames
notebooks/Patten2006.ipynb
mit
%pylab inline import seaborn as sns import warnings warnings.filterwarnings("ignore") import pandas as pd """ Explanation: ApJdataFrames 007: Patten2006 Title: Spitzer IRAC Photometry of M, L, and T Dwarfs Authors: Brian M Patten, John R Stauffer, Adam S Burrows, Massimo Marengo, Joseph L Hora, Kevin L Luhman, Sarah...
ALEXKIRNAS/DataScience
CS231n/assignment3/GANs-PyTorch.ipynb
mit
import torch import torch.nn as nn from torch.nn import init from torch.autograd import Variable import torchvision import torchvision.transforms as T import torch.optim as optim from torch.utils.data import DataLoader from torch.utils.data import sampler import torchvision.datasets as dset import numpy as np import ...
HazyResearch/snorkel
tutorials/crowdsourcing/Crowdsourced_Sentiment_Analysis-pandas.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import os import numpy as np from snorkel import SnorkelSession session = SnorkelSession() """ Explanation: Training a Sentiment Analysis LSTM Using Noisy Crowd Labels This is a version of the crowdsourcing tutorial that uses PySpark using Pandas instead of SparkSQ...
metpy/MetPy
v0.12/_downloads/e5685967297554788de3cf5858571b23/Natural_Neighbor_Verification.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import ConvexHull, Delaunay, delaunay_plot_2d, Voronoi, voronoi_plot_2d from scipy.spatial.distance import euclidean from metpy.interpolate import geometry from metpy.interpolate.points import natural_neighbor_point """ Explanation: Natural Neighbo...
mikezawitkowski/fireRiskSF
notebooks/reports/1.0-Weather-vs-dept-call-volume.ipynb
mit
from __future__ import division, print_function import json import numpy as np from datetime import datetime import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns query_url = 'https://data.sfgov.org/resource/wbb6-uh78.json?$order=close_dttm%20DESC&$offset={}&$limit={}' offset = 0...
AdityaSoni19031997/Machine-Learning
Classifying_datasets/Convolutional_Neural_Networks/scikit_tutorial.ipynb
mit
import sklearn as sk import numpy as np import matplotlib.pyplot as plt %matplotlib inline from sklearn .datasets import fetch_olivetti_faces faces = fetch_olivetti_faces() faces.DESCR faces.keys() faces.images.shape faces.data.shape faces.target.shape np.max(faces.data) np.min(faces.data) np.median(faces.data)...
arokem/seaborn
doc/docstrings/set_theme.ipynb
bsd-3-clause
sns.barplot(x=["A", "B", "C"], y=[1, 3, 2]) """ Explanation: By default, seaborn plots will be made with the current values of the matplotlib rcParams: End of explanation """ sns.set_theme() sns.barplot(x=["A", "B", "C"], y=[1, 3, 2]) """ Explanation: Calling this function with no arguments will activate seaborn's ...
abulbasar/machine-learning
Scikit - 05 Classification.ipynb
apache-2.0
iris.info() species = iris.Species.unique() colors = sns.color_palette("hls", 3) for i, v in enumerate(species): df = iris[iris.Species == v] plt.scatter(df["PetalLength"],df["SepalLength"], color = colors[i], label = v) plt.legend(loc = "upper left") plt.xlabel("Petal Length") plt.ylabel("Sepal Length") y = ...
guilgautier/DPPy
notebooks/multivariate_jacobi_ensemble.ipynb
mit
# !pip install dppy """ Explanation: On two ways to use determinantal point processes for Monte Carlo integration Guillaume Gautier, Rémi Bardenet, and Michal Valko See also - the documentation on ReadTheDocs - the NeurIPS'19 paper - the ICML'19 workshop talk (Workshop on Negative Dependence in ML) <h1>Table of Conten...
dmittov/shad_python_hw3
hw3.ipynb
gpl-2.0
!ls -l corpus """ Explanation: Дмитрий Миттов. Большие данные. Я решил воспользоваться предоставленным корпусом: End of explanation """ import os import numpy as np import sys import nltk import unicodedata from collections import Counter, namedtuple import pickle import numpy as np from copy import deepcopy %matpl...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/ordinal_regression.ipynb
bsd-3-clause
import numpy as np import pandas as pd import scipy.stats as stats from statsmodels.miscmodels.ordinal_model import OrderedModel """ Explanation: Ordinal Regression End of explanation """ url = "https://stats.idre.ucla.edu/stat/data/ologit.dta" data_student = pd.read_stata(url) data_student.head(5) data_student.d...
spectralDNS/shenfun
binder/Torus-biharmonic.ipynb
bsd-2-clause
from shenfun import * from shenfun.la import SolverGeneric2ND import sympy as sp from IPython.display import Math N = 24 R = 3 r, theta, phi = psi = sp.symbols('x,y,z', real=True, positive=True) rv = ((R + r*sp.cos(theta))*sp.cos(phi), (R + r*sp.cos(theta))*sp.sin(phi), r*sp.sin(theta)) def discourage_powers(expr): ...
jbwhit/jupyter-best-practices
notebooks/Advanced-Notebook-Tricks.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd from pandas.tools.plotting import scatter_matrix from sklearn.datasets import load_boston import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set_context('poster') sns.set_style('whitegrid') plt.rcParams['figure.figsize'] = 12, 8 ...
willettk/gzhubble
python/notebooks/zeta_models_compared.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt from astropy.table import Table,Column from astropy.io import fits from scipy import optimize from scipy.optimize import minimize from scipy import stats from scipy.stats import distributions as dist import numpy as np import os import requests import warnings im...
madlib/madlib-examples
Prediction-metrics-demo-1.ipynb
apache-2.0
%load_ext sql # %sql postgresql://gpdbchina@10.194.10.68:55000/madlib %sql postgresql://fmcquillan@localhost:5432/madlib %sql select madlib.version(); """ Explanation: Prediction metrics This module provides a set of metrics to evaluate the quality of predictions of a model. A typical function will take a set of "pr...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/deep-learning/theano-tutorial/intro_theano/logistic_regression.ipynb
mit
import os import requests import gzip import six from six.moves import cPickle if not os.path.exists('mnist.pkl.gz'): r = requests.get('http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz') with open('mnist.pkl.gz', 'wb') as data_file: data_file.write(r.content) with gzip.open('mnist.pkl.gz...
Upward-Spiral-Science/claritycontrol
code/a10_extended_exploratory.ipynb
apache-2.0
FEATURES_PATH = '../code/data/roi_features/features.csv' # use your own path import numpy as np import matplotlib matplotlib.use('AGG') # avoid some error in matplotlib, delete this line if the following doesn't work import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import jgraph as ig %matplot...
CopernicusMarineInsitu/INSTACTraining
PythonNotebooks/IndexFilePlots/IndexFile_Folium_Visalization.ipynb
mit
indexfile = "datafiles/index_latest.txt" """ Explanation: Index file visualization This notebook shows an easy way to represent the In Situ data positions using the index files.<br> For this visualization of a sample <i>index_latest.txt</i> dataset of the Copernicus Marine Environment Monitoring Service. End of explan...
rringham/deep-learning-notebooks
udacity/3_regularization.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import numpy as np import tensorflow as tf from six.moves import cPickle as pickle """ Explanation: Deep Learning Assignment 3 Previously in 2_fullyconnected.ipynb, you tra...
kubeflow/code-intelligence
Issue_Embeddings/notebooks/03_Create_Model.ipynb
mit
def pass_through(x): return x data_lm = load_data(path, bs=120) """ Explanation: 1. Load DataBunch You have to redefine or import any custom you defined in the last step, because the data bunch is going to look for that. End of explanation """ learn = language_model_learner(data=data_lm, ...
diogo149/hyperparamter_optimization_from_scratch
Hyperparameter Optimization.ipynb
apache-2.0
def smbo(generator_fn, score_fn, evaluation_fn, num_dims, num_initial_points=10, num_iter=200, num_generated=10000): """ general sequential model based optimization to minimize the result of some presumably expensive function generator_fn: funct...
survey-methods/samplics
docs/source/tutorial/sample_weights.ipynb
mit
import numpy as np import pandas as pd import samplics from samplics.datasets import PSUSample, SSUSample from samplics.weighting import SampleWeight """ Explanation: Sample weight adjustment The objective of this tutorial is to familiarize ourselves with SampleWeight the samplics class for adjusting sample weights. ...
JeffAbrahamson/MLWeek
practicum/03_sklearn/sklearn-intro.ipynb
gpl-3.0
import numpy as np import scipy as sp from sklearn import datasets iris = datasets.load_iris() digits = datasets.load_digits() boston = datasets.load_boston() """ Explanation: Scikit Learn et données Scikit-learn propose quelques ensembles de données, notamment iris et digits (classification) et le boston house price...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/sandbox-1/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'sandbox-1', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-1 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
jastarex/DeepLearningCourseCodes
01_TF_basics_and_linear_regression/tensorflow_basic.ipynb
apache-2.0
import tensorflow as tf a = tf.constant(100) with tf.Session() as sess: print sess.run(a) #syntactic sugar print a.eval() # or sess = tf.Session() print sess.run(a) # print a.eval() # this will print out an error """ Explanation: TensorFlow基础 此处使用python2写法,可以用pyenv安装anaconda2-4.4.0亦即python 2.7对...
sevo/closure_decorator
Closure a dekorator.ipynb
mit
def f1(a): print(a) print(b) f1(3) b = 6 f1(3) """ Explanation: Obsah dnesnej prednasky 1. Rozsah platnosti premennej 2. Vnorena funkcia 3. Closure 4. Decorator Closure - Uzaver Funkcia, ktora pouziva neglobalnu premennu definovanu mimo svojho tela (vysvetlim) Da sa to pouzit napriklad na asynchronne progra...
dsacademybr/PythonFundamentos
Cap03/Notebooks/DSA-Python-Cap03-Exercicios-Loops-Condiconais.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 3</font> Download: http://github.com/dsacademybr End of explanation """ # Exerc...
ddtm/dl-course
Seminar11/Seminar11_intro.ipynb
mit
with open("./train.csv") as fin: ids,words,transcripts = zip(*[line.split(',') for line in list(fin)[1:]]) words = [word+"@" for word in words] transcripts = [["START"]+ts[:-2].split()+["END"] for ts in transcripts] for word, trans in zip(words[:5],phonemes[:5]): print word,':',trans """ Explanation: ...
Azaruddinjailor/ml_lab_ecsc_306
labwork/lab1/TF_Basic_1.ipynb
apache-2.0
import tensorflow as tf # creates nodes in a graph # "construction phase" x1 = tf.constant(5) x2 = tf.constant(6) result = tf.multiply(x1,x2) print(result) """ Explanation: TensorFlow works by first defining and describing our model in abstract, and then, when we are ready, we make it a reality in the session. The des...
ML4DS/ML4all
U3.PCA/PCA_student.ipynb
mit
# Basic imports %matplotlib inline import numpy as np import matplotlib.pyplot as plt import seaborn as sns; sns.set() """ Explanation: Principal Component Analysis The code in this notebook has been taken from a notebook in the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub. The c...
karlstroetmann/Artificial-Intelligence
Python/1 Search/N-Queens-Frame.ipynb
gpl-2.0
start = () """ Explanation: The 8-Queens Puzzle We represent solutions to the 8-queens puzzle as tuples of the form $$ (r_0, \cdots, r_7), $$ where $r_i$ is the row of the queen in column $i$. We start counting from $0$ because this is the way it is done in Python. In general, states are defined as tuples of the form...
TimothyHelton/k2datascience
notebooks/Linear_Models_Exercises.ipynb
bsd-3-clause
import os import os.path as osp import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression import seaborn as sns import statsmodels.formula.api as smf from statsmodels.graphics.regressionplots import influence_plot fr...
jseabold/statsmodels
examples/notebooks/statespace_local_linear_trend.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from scipy.stats import norm import statsmodels.api as sm import matplotlib.pyplot as plt """ Explanation: State space modeling: Local Linear Trends This notebook describes how to extend the statsmodels statespace classes to create and estimate a custom model....
nishant009/sdcnd_traffic_sign_classification
Traffic_Sign_Classifier.ipynb
mit
# Load pickled data import pickle training_file = '../data/train.p' validation_file = '../data/valid.p' testing_file = '../data/test.p' with open(training_file, mode='rb') as f: train = pickle.load(f) with open(validation_file, mode='rb') as f: valid = pickle.load(f) with open(testing_file, mode='rb') as f: ...
NeuroDataDesign/seelviz
Tony/ipynb/april3/s275_Registration.ipynb
apache-2.0
from ndreg import * import matplotlib import ndio.remote.neurodata as neurodata """ Explanation: Volumetric Registration and Analysis In this tutorial we align a partial mouse brain to the Allen Referece Atlas (ARA). Thus the ARA is our reference image, it consists of image data stored in the default "average" channe...
sot/aca_stats
fit_acq_model-2018-11-dev/fit_acq_model-2018-11-binned-poly-mono.ipynb
bsd-3-clause
import sys import os from itertools import count from pathlib import Path sys.path.insert(0, str(Path(os.environ['HOME'], 'git', 'skanb', 'pea-test-set'))) import utils as asvt_utils import numpy as np import matplotlib.pyplot as plt from astropy.table import Table, vstack from astropy.time import Time import tables fr...
jmhsi/justin_tinker
data_science/courses/learning_dl_packages/models/research/slim/slim_walkthrough.ipynb
apache-2.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import matplotlib %matplotlib inline import matplotlib.pyplot as plt import math import numpy as np import tensorflow as tf import time from datasets import dataset_utils # Main slim library from tensorflow.c...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_read_noise_covariance_matrix.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) from os import path as op import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif') fname_evo = op.join(data_path,...
brean/python-pathfinding
pathfinding.ipynb
mit
from pathfinding.core.diagonal_movement import DiagonalMovement from pathfinding.core.grid import Grid from pathfinding.finder.a_star import AStarFinder """ Explanation: A simple usage example to find a path using A*. End of explanation """ matrix = [ [1, 1, 1], [1, 0, 1], [1, 1, 1] ] """ Explanation: Create ...
cosmolejo/Fisica-Experimental-3
Pre-Labs/Espectroscopia/Basics.ipynb
gpl-3.0
import sys print ('maximo float: ',sys.float_info.max) print ('minimo float: ',sys.float_info.min) print ('int: numero de bits por digito ',sys.int_info.bits_per_digit, 'esto es: ', 2**sys.int_info.bits_per_digit) import matplotlib.pyplot as plt import numpy as np plt.close("all") x=np.linspace(-10,10) cuadrado=pl...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/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', 'pcmdi', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: PCMDI Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. Propertie...
whitead/numerical_stats
unit_5/hw_2016/homework_5_key.ipynb
gpl-3.0
import numpy as np ints = np.arange(1,21) pows = 2**ints print(pows) print(pows[9], pows[19]) """ Explanation: Homework 5 CHE 116: Numerical Methods and Statistics Prof. Andrew White Version 1.1 (2/9/2016) 1. Python Practice (20 Points) Answer the following problems in Python [4 points] Using Numpy, create the first...
tensorflow/docs-l10n
site/en-snapshot/guide/migrate/tensorboard.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...
rbiswas4/AnalyzeSN
examples/LightCurve.ipynb
mit
import sncosmo import analyzeSN as ans import numpy as np from analyzeSN import LightCurve %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set() """ Explanation: The LightCurve class Background What kind of physical data are we representing and what do these quantities mean? Astrophysica...
bjshaw/phys202-2015-work
assignments/assignment07/AlgorithmsEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import numpy as np """ Explanation: Algorithms Exercise 2 Imports End of explanation """ def find_peaks(a): """Find the indices of the local maxima in a sequence.""" c = [] for n in range(0,len(a)): if n >= 1 and n <= l...
jnarhan/Breast_Cancer
src/models/JN_BC_Diff_ Diagnosis.ipynb
mit
import os import sys import time import numpy as np from tqdm import tqdm import sklearn.metrics as skm from sklearn import metrics from sklearn.svm import SVC from sklearn.model_selection import train_test_split from skimage import color import keras.callbacks as cb import keras.utils.np_utils as np_utils from ker...
robertoalotufo/ia898
src/phasecorr.ipynb
mit
import numpy as np def phasecorr(f,h): F = np.fft.fftn(f) H = np.fft.fftn(h) T = F * np.conjugate(H) R = T/np.abs(T) g = np.fft.ifftn(R) return g.real """ Explanation: Function phasecorr Synopse Computes the phase correlation of two images. g = phasecorr(f,h) OUTPUT g: Image. Phase correlation...
angelmtenor/deep-learning
batch-norm/Batch_Normalization_Exercises.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con...
InsightLab/data-science-cookbook
2019/09-clustering/cl_PedroMotta.ipynb
mit
# import libraries import math # linear algebra import numpy as np # data processing import pandas as pd # data visualization from matplotlib import pyplot as plt from sklearn import cluster # load the data with pandas dataset = pd.read_csv('dataset.csv', header=None) dataset = np.array(dataset) plt.scatter(datas...
dtamayo/rebound
ipython_examples/Starman.ipynb
gpl-3.0
import rebound import numpy as np %matplotlib inline """ Explanation: Starman This notebook integrates the orbit of Elon Musk's Tesla and Starman. The orbital parameters are taken from Bill Gray's website: https://www.projectpluto.com/temp/j95.htm#elements. End of explanation """ sim = rebound.Simulation() sim.add([...
michaelaye/planet4
notebooks/clustering development.ipynb
isc
from planet4.dbscan import DBScanner from planet4 import io, clustering, plotting, markings, dbscan import seaborn as sns sns.set_context('notebook') blotchcols = markings.Blotch.to_average fancols = markings.Fan.to_average # not automatically initialized %matplotlib ipympl import socket if socket.gethostname().star...
cpcloud/ibis
docs/tutorial/05-IO-Create-Insert-External-Data.ipynb
apache-2.0
!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db' import os import tempfile import ibis ibis.options.interactive = True connection = ibis.sqlite.connect( os.path.join(tempfile.gettempdir(), 'geography.db') ) """ Explanation: Creating and Inserting Data Setup E...
zifeo/Food-habits
1-preprocessing/restaurants/lafourchette.ipynb
apache-2.0
restaurant_ids = [] restaurant_names = [] websites = [] for link in df.index.values: link_split = link.split("/") websites.append(link_split[2]) restaurant_names.append(link_split[-2]) restaurant_ids.append(link_split[-1]) len(np.unique(restaurant_ids)) == len(restaurant_ids) df = df.set_index([resta...
neurokernel/vision
notebooks/vision.ipynb
bsd-3-clause
%matplotlib inline import matplotlib as mpl import matplotlib.pyplot as p """ Explanation: Vision Model Demo This notebook illustrates how to run a Neurokernel-based model of portions of the fly's vision system. Background In addition to the retina where the photo-transduction takes place, the optic lobe of the Drosop...
andmax/gpufilter
python/alg5epe.ipynb
mit
import math import cmath import numpy as np from scipy import ndimage, linalg from skimage.color import rgb2gray from skimage.measure import structural_similarity as ssim from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt %matplotlib inline plt.gray() # to plot gray images using gray scale ...
InsightLab/data-science-cookbook
2020/trabalho-01/Exemplo de relatório.ipynb
mit
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt """ Explanation: (Micro)Relatório do catálogo da Netflix Este (micro)relatório apresenta algumas informações extraídas de um dataset com o catálogo da Netflix, disponível no Kaggle. As bibliotecas utilizadas são as seguintes: End of explanation """...
mne-tools/mne-tools.github.io
0.18/_downloads/7b57fca16e7c12b88411529a749018d6/plot_sensors_decoding.ipynb
bsd-3-clause
# sphinx_gallery_thumbnail_number = 6 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 (SlidingEstimato...
tensorflow/examples
courses/udacity_intro_to_tensorflow_for_deep_learning/l09c05_nlp_tweaking_the_model.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
whitead/numerical_stats
unit_4/hw_2018/Homework_4_Key.ipynb
gpl-3.0
#1.1 import math print('{:.4}'.format(math.pi)) #1.2 - no for loop print('{:5.4}'.format(math.sqrt(1))) print('{:5.4}'.format(math.sqrt(2))) print('{:5.4}'.format(math.sqrt(3))) print('{:5.4}'.format(math.sqrt(4))) print('{:5.4}'.format(math.sqrt(5))) #1.2 - for loop for i in range(1, 6): print('{:5.4}'.format(ma...
whitead/numerical_stats
unit_9/hw_2019/homework_9_key.ipynb
gpl-3.0
import numpy as np """ Explanation: Homework 9 Key CHE 116: Numerical Methods and Statistics 2/21/2019 End of explanation """ import numpy as np m = np.zeros((6, 12)) m[:,1] = 2**np.arange(6) m[:,2] = 4 print(m) """ Explanation: 1. Creating Matrices (12 Points) Create the following matrices using the given constra...
zraxon/Oslo-Model
Oslo Model.ipynb
gpl-3.0
import analysis import matplotlib.pyplot as plt import numpy as np import pickle from collections import OrderedDict from pile import Pile from scipy.optimize import curve_fit """ Explanation: Zixu Zack Xiang, 01/02/17 The following notebook was ran in a Python 3 environment. The code was written to maximise clarity...
xiongzhenggang/xiongzhenggang.github.io
AI/ML/专利.ipynb
gpl-3.0
from scipy.stats import pearsonr def pearsonrs(x,y): pears = [] # 循环列处理 for arr in x.T: pears.append(pearsonr(arr,Y)[0]) return np.array(pears) pears = np.abs(pearsonrs(X1,Y)) index = np.argsort(-pears) pears,index # 选取相关系数大于0.1的,即前9个特征 X2 = X1[:,index[0:9]] X2.shape # 1,分别将数据分为训练集和测试集,随机分配...