repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
tensorflow/docs
site/en/r1/tutorials/images/hub_with_keras.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...
zzsza/Datascience_School
19. 문서 전처리/04. 문서 전처리.ipynb
mit
from sklearn.feature_extraction.text import CountVectorizer corpus = [ 'This is the first document.', 'This is the second second document.', 'And the third one.', 'Is this the first document?', 'The last document?', ] vect = CountVectorizer() vect.fit(corpus) vect.vocabulary_ vect.transform(['T...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/06_cdap.ipynb
bsd-3-clause
import numpy as np import pandas as pd import larch import os os.chdir('test') """ Explanation: Estimating Coordinated Daily Activity Patterns This notebook illustrates how to re-estimate ActivitySim's CDAP model. This process includes running ActivitySim in estimation mode to read household travel survey files and ...
LucaCanali/Miscellaneous
Spark_Notes/Spark_SQL_UDF_examples_Mandelbrot/Spark_SQL_UDF_example_notebook_Mandelbrot_Jupyter_Python.ipynb
apache-2.0
# the function definition def mandelbrot(cR, cI, maxIterations): zR = cR zI = cI i = 1 # Iterative formula for Mandelbrot set: z => z^2 + c # Escape point: |z|^2 >= 4. Note: z nd c are complex numbers while (zR*zR + zI*zI < 4.0 and i < maxIterations): newzR = zR*zR - zI*zI +cR ...
jchowk/pyND
pyND/gal/Notebooks/SMHM_Tinker2017_fits.ipynb
gpl-3.0
##Set up matplotlib for display in the browser: %matplotlib inline import matplotlib as mpl mpl.rc("savefig", dpi=250) import matplotlib.pyplot as plt import numpy as np from astropy.io import fits, ascii from astropy.table import Table,Column """ Explanation: Tinker+ (2017) SMHM-relations Here we will fit the Tinke...
cesarcontre/Simulacion2017
Modulo3/.ipynb_checkpoints/Clase21_AjusteCurvas-checkpoint.ipynb
mit
import numpy as np import matplotlib.pyplot as plt P1 = [0, 1] P2 = [1, 0] X = np.array([[1, 0], [1, 1]]) y = np.array([1, 0]) b0, b1 = np.linalg.inv(X).dot(y) b0, b1 x = np.linspace(-0.2, 1.2, 100) y = b1*x+b0 plt.figure(figsize=(8,6)) plt.plot([P1[0], P2[0]], [P1[1], P2[1]], 'r*', label = 'puntos') plt.plot(x, y,...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/awi-cm-1-0-hr/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'awi-cm-1-0-hr', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: AWI Source ID: AWI-CM-1-0-HR Topic: Ocean Sub-Topics: Timestepping Framework, Adv...
4DGenome/Chromosomal-Conformation-Course
Participants/JCarlos/Finding Compartments.ipynb
gpl-3.0
from pytadbit.parsers.hic_parser import load_hic_data_from_reads from cPickle import load %matplotlib inline reso = 300000 """ Explanation: Finding compartments and TADs End of explanation """ hic_data1 = load_hic_data_from_reads( 'results/HindIII/03_filtering/valid_reads12_HindIII.tsv', resolution= reso) hic_dat...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/gls.ipynb
bsd-3-clause
import numpy as np import statsmodels.api as sm """ Explanation: Generalized Least Squares End of explanation """ data = sm.datasets.longley.load() data.exog = sm.add_constant(data.exog) print(data.exog.head()) """ Explanation: The Longley dataset is a time series dataset: End of explanation """ ols_resid = sm.O...
Diego-Ibarra/aquamod
tutorials/5_fish_model.ipynb
mit
days = 365 * 2 # Two years dt = 0.01 # units: days """ Explanation: Fish model Setting up the model backbone Before we show/code equations... we should start by setting up a the framework... Kinda' a "dummy" empty model... <span style="background-color:#d2d2d2;color:red;font-size:17px"> Copy-paste into Spyder's E...
thempel/adaptivemd
examples/tutorial/5_example_advanced_generators.ipynb
lgpl-2.1
from adaptivemd import ( Project, Task, File, PythonTask ) project = Project('tutorial') engine = project.generators['openmm'] modeller = project.generators['pyemma'] pdb_file = project.files['initial_pdb'] """ Explanation: Custom Generator objects This example should guide you to build your own simple generator...
zhuanxuhit/deep-learning
intro-to-rnns/Anna_KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
kaiping/incubator-singa
doc/en/docs/notebook/mlp.ipynb
apache-2.0
from __future__ import print_function from builtins import range import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Train a multi-layer perceptron (MLP) model In this notebook, we are going to use PySINGA to train a MLP model for classifying 2-d points into two categories (i.e., po...
elingg/tensorflow
tensorflow/examples/udacity/5_word2vec.ipynb
apache-2.0
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. %matplotlib inline from __future__ import print_function import collections import math import numpy as np import os import random import tensorflow as tf import zipfile from matplotlib import pylab from six.mov...
nwhidden/ND101-Deep-Learning
intro-to-rnns/Anna_KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
jokedurnez/RequiredEffectSize
Figure2_CorrSimulation/.ipynb_checkpoints/Correlation_simulation-checkpoint.ipynb
mit
import numpy import nibabel import os import nilearn.plotting import matplotlib.pyplot as plt from statsmodels.regression.linear_model import OLS import nipype.interfaces.fsl as fsl import scipy.stats if not 'FSLDIR' in os.environ.keys(): raise Exception('This notebook requires that FSL is installed and the FSLDIR...
PMEAL/OpenPNM
examples/contrib/loading_statoil_finding_permeability.ipynb
mit
import warnings import scipy as sp import numpy as np import openpnm as op %config InlineBackend.figure_formats = ['svg'] np.set_printoptions(precision=4) np.random.seed(10) %matplotlib inline """ Explanation: Part 1: Import Networks from Statoil Files This example explains how to use the OpenPNM.Utilies.IO.Statoil cl...
quantopian/research_public
notebooks/lectures/Confidence_Intervals/questions/notebook.ipynb
apache-2.0
def generate_autocorrelated_data(theta, mu, sigma, N): X = np.zeros((N, 1)) for t in range(1, N): X[t] = theta * X[t-1] + np.random.normal(mu, sigma) return X def newey_west_SE(data): ind = range(0, len(data)) ind = sm.add_constant(ind) model = regression.linear_model.OLS(data, ind).fit...
bashtage/statsmodels
examples/notebooks/gee_nested_simulation.ipynb
bsd-3-clause
import numpy as np import pandas as pd import statsmodels.api as sm """ Explanation: GEE nested covariance structure simulation study This notebook is a simulation study that illustrates and evaluates the performance of the GEE nested covariance structure. A nested covariance structure is based on a nested sequence of...
daniestevez/jupyter_notebooks
BPSK postprocessing.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import scipy.signal """ Explanation: BPSK postprocessing This notebook shows postprocessing of a 9k6 BPSK signal, with the goal of reverse engineering the coding and protocols. The signals used here were tranmitted by an unknown satellite at 2018-0...
google-research/google-research
jax_dft/examples/training_neural_xc_functional.ipynb
apache-2.0
#@title Default title text # 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, softwar...
feststelltaste/software-analytics
prototypes/Decomposing classes like a boss new.ipynb
gpl-3.0
%load_ext cypher """ Explanation: Introduction In this blog post, I want to show you a graph-based way to split up a class into several independent ones. We take a small example class from Michael Feathers' book "Working effectively with legacy code" and use Neo4j's Awesome Procedures On Cypher (APOC). Hint: To run th...
williamdjones/protein_binding
notebooks/Full Dataset Nonlinear Dimensionality Reduction (In Progress).ipynb
mit
import os import pandas as pd import time from tqdm import tqdm import glob import numpy as np from utils.input_pipeline import * #TODO: Try the variational approach instead. #TODO: instead of solving for a small dimension representation, then traiing a RF on this...make the dims larger and try a linear model instead? ...
fredhohman/pymks
notebooks/elasticity_2D.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt n = 21 from pymks.tools import draw_microstructures from pymks.datasets import make_delta_microstructures X_delta = make_delta_microstructures(n_phases=2, size=(n, n)) draw_microstructures(X_delta) """ Explan...
ga7g08/ga7g08.github.io
_notebooks/2015-04-07-Some-favourite-recipes-in-matplotlib.ipynb
mit
import matplotlib.pyplot as plt import numpy as np def f(x): return x**3 + 3*x**2 - x + 1 fig, ax = plt.subplots() x = np.linspace(-3, 3.2, 100) ax.plot(x, f(x)) plt.show() """ Explanation: Plotting mathematics in matplotlib One of the few complaints against matplotlib from Mathematicians and Physicists alike ...
me-surrey/dl-gym
math_linear_algebra.ipynb
apache-2.0
from __future__ import division, print_function, unicode_literals """ Explanation: Math - Linear Algebra Linear Algebra is the branch of mathematics that studies vector spaces and linear transformations between vector spaces, such as rotating a shape, scaling it up or down, translating it (ie. moving it), etc. Machine...
GoogleCloudPlatform/professional-services
examples/cloudml-bank-marketing/bank_marketing_classification_model.ipynb
apache-2.0
!pip install pandas-profiling !pip install lime """ Explanation: How to build a machine learning marketing model for banking using Google Cloud Platform and Python This notebook shows you how to build a marketing model for banking using Google Cloud Platform (GCP). Many financial institutions use traditional on-premis...
MeissnerEffect/hackathon_MIIA_2017
Bottleneck Features.ipynb
mit
from keras.applications.vgg16 import VGG16 # create the VGG16 model with only the convolutional layers, and using weights from ImageNet model = VGG16(include_top=False,weights='imagenet') # show architecture model.summary() """ Explanation: Pothole detector Bottleneck Features 1. Load the VGG16 model pre-trained on Im...
jrbourbeau/cr-composition
notebooks/legacy/lightheavy/spectrum-analysis.ipynb
mit
%load_ext watermark %watermark -u -d -v -p numpy,matplotlib,scipy,pandas,sklearn,mlxtend """ Explanation: <a id='top'> </a> Author: James Bourbeau End of explanation """ %matplotlib inline from __future__ import division, print_function from collections import defaultdict import itertools import numpy as np from sci...
qinwf-nuan/keras-js
notebooks/layers/pooling/AveragePooling3D.ipynb
mit
data_in_shape = (4, 4, 4, 2) L = AveragePooling3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(290) data_in...
ageron/ml-notebooks
16_reinforcement_learning.ipynb
apache-2.0
import numpy as np import os import sklearn import sys try: # %tensorflow_version only exists in Colab. %tensorflow_version 1.x !apt update && apt install -y libpq-dev libsdl2-dev swig xorg-dev xvfb !pip install -q -U pyvirtualdisplay gym[atari,box2d] IS_COLAB = True except Exception: IS_COLAB ...
superbock/parallel2015
viterbi.ipynb
mit
states = ('Healthy', 'Fever') observations = ('normal', 'cold', 'dizzy') start_probability = {'Healthy': 0.6, 'Fever': 0.4} transition_probability = { 'Healthy' : {'Healthy': 0.7, 'Fever': 0.3}, 'Fever' : {'Healthy': 0.4, 'Fever': 0.6} } emission_probability = { 'Healthy' : {'normal': 0.5, 'cold': 0...
sanjanedic/SBARepay
SBARepayML.ipynb
mit
#Import necessary Python packages #data analysis tools import numpy as np import pandas as pd import datetime from dateutil.relativedelta import relativedelta #plotting tools import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns import graphviz #classification from sklearn.preprocessing import ...
quantopian/research_public
notebooks/tutorials/2_pipeline_lesson10/notebook.ipynb
apache-2.0
from quantopian.pipeline import CustomFactor import numpy """ Explanation: Custom Factors When we first looked at factors, we explored the set of built-in factors. Frequently, a desired computation isn't included as a built-in factor. One of the most powerful features of the Pipeline API is that it allows us to define...
sassoftware/sas-viya-programming
python/data-mining/CAS Action Documentation.ipynb
apache-2.0
# Load the swat package and turn off note messages import swat swat.options.cas.print_messages = False # set the connection: host, port, username, password s = swat.CAS(host, port, username, password) """ Explanation: How to Get CAS Action Documentation within Python-swat There is publically available documentation, ...
doyljoh/myMachineLearningLibs
notebooks/Notebook_py3_NumerAI_Demo.ipynb
mit
import pandas as pd import numpy as np from sklearn import metrics, preprocessing, linear_model """ Explanation: Example classifier on Numerai data using a logistic regression classifier. To get started, install the required packages: pip install pandas, numpy, sklearn End of explanation """ dirRawData = '/home/john...
martinjrobins/hobo
examples/toy/model-beeler-reuter-ap.ipynb
bsd-3-clause
import pints import pints.toy import matplotlib.pyplot as plt import numpy as np model = pints.toy.ActionPotentialModel() """ Explanation: Beeler-Reuter AP Model In this example we use the 1977 Beeler-Reuter model of the mammalian ventricular action potential action potential, and try to estimate its maximum conducta...
csaladenes/csaladenes.github.io
test/plotter.ipynb
mit
import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.font_manager as font_manager plt.style.use('seaborn-darkgrid') %matplotlib inline prop = font_manager.FontProperties('Segoe UI') from sympy import * init_printing() """ Explanation: Plotting workbook Plotting workbook to accompany the paper Ca...
SciTools/cube_browser
doc/write_your_own/components/iplotPicker.ipynb
bsd-3-clause
import ipywidgets import IPython.display import iris import numpy as np import iris.quickplot as iplt import matplotlib.pyplot as plt """ Explanation: Plot Type Selector Example showing how to construct a dropdown widget that can be used to select a plot type. Here a dictionary must be used for the plot type options...
DominikDitoIvosevic/Uni
STRUCE/2018/.ipynb_checkpoints/SU-2018-LAB02-LDM-i-LR-checkpoint.ipynb
mit
# Učitaj osnovne biblioteke... import sklearn import mlutils import matplotlib.pyplot as plt %pylab inline """ Explanation: Sveučilište u Zagrebu Fakultet elektrotehnike i računarstva Strojno učenje 2018/2019 http://www.fer.unizg.hr/predmet/su Laboratorijska vježba 2: Linearni diskriminativni modeli Verzija: 1.2 Za...
darkomen/TFG
ipython_notebooks/06_regulador_experto/ensayo2.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv con los datos...
mathcoding/Programmazione2
Lab 4 - Matrici, Immagini e Frattali.ipynb
mit
import matplotlib.pyplot as plt import numpy as np def DrawChessBoard(n=8): # L'operatore '%' calcola il resto della divisione ChessBoard = np.matrix([[(i+(j%2))%2 for i in range(n)] for j in range(n)]) print(ChessBoard) # Crea una figura, disegna l'immagine data dalla matrice, aggiungi la colorbar sul...
waltervh/BornAgain-tutorial
talks/day_2/python_api_G/pyapi06_lmfit_decaying_wave.ipynb
gpl-3.0
def decaying_sin(params, x): amp = params['amp'] phaseshift = params['phase'] freq = params['frequency'] decay = params['decay'] return amp * np.sin(x*freq + phaseshift) * np.exp(-x*x*decay) """ Explanation: Defining decaying sin wave Function accepts dictionary of parameters and array of x-points...
markriedl/easygen
Easygen.ipynb
mit
!git clone https://github.com/markriedl/easygen.git !cp easygen/*.js /usr/local/share/jupyter/nbextensions/google.colab/ !cp easygen/images/*.png /usr/local/share/jupyter/nbextensions/google.colab/ """ Explanation: EasyGen EasyGen is a visual user interface to help set up simple neural network generation tasks. There ...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/sandbox-2/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: BNU Source ID: SANDBOX-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
jllanfranchi/playground
test_hashses_and_container_classes.ipynb
mit
print hash_obj([0, 1, 2]) bits = 64*2 n_elements = 200 np.log10(2*2**bits/(n_elements*(n_elements-1))) """ Explanation: Old version that was developed here (now probably out of sync with official version in PISA...): python def hash_obj(obj): hash_val, = struct.unpack('&lt;q', hashlib.md5( pickle.dump...
GoogleCloudPlatform/training-data-analyst
courses/dialogflow-chatbot/notebooks/IntentHealthCheck.ipynb
apache-2.0
!pip install --quiet --upgrade tensorflow dialogflow scipy tensorflow-hub import dialogflow_v2 as dialogflow import tensorflow as tf import tensorflow_hub as hub import numpy as np import pandas as pd from collections import defaultdict import os from google.colab import auth import pickle print(tf.__version__) """ E...
AtmaMani/pyChakras
python_crash_course/pandas_cheat_sheet_2.ipynb
mit
import pandas as pd import numpy as np # Index Levels outside = ['G1','G1','G1','G2','G2','G2'] inside = [1,2,3,1,2,3] hier_index = list(zip(outside,inside)) #create a list of tuples hier_index #create a multiindex hier_index = pd.MultiIndex.from_tuples(hier_index) hier_index # Create a dataframe (6,2) with multi le...
sz2472/foundations-homework
homework 8/homework 8.ipynb
mit
df['Age'].describe() """ Explanation: 1. the youngest programmer vs. the oldest programmer? End of explanation """ df.groupby('Gender')['Income'].describe() """ Explanation: 2. What are the maximum income for female programmers? End of explanation """ df['Income'].describe() """ Explanation: 3. how much does a p...
brettavedisian/phys202-2015-work
assignments/assignment10/ODEsEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 3 Imports End of explanation """ g = 9.81 # m/s^2 l = 0.5 # length of pendulum...
kgrodzicki/machine-learning-specialization
course-2-regression/notebooks/numpy-tutorial.ipynb
mit
import numpy as np # importing this way allows us to refer to numpy as np """ Explanation: Numpy Tutorial Numpy is a computational library for Python that is optimized for operations on multi-dimensional arrays. In this notebook we will use numpy to work with 1-d arrays (often called vectors) and 2-d arrays (often cal...
idekerlab/ci-service-template
sample-notebooks/Heat_Diffusion_Example.ipynb
mit
IP = '192.168.99.100' BASE = 'http://' + IP + '/v1/' # You need to change this to your service server import requests import json def jprint(data): print(json.dumps(data, indent=4)) # Change this to your Docker container's IP HEADERS = {'Content-Type': 'application/json'} # Check API Status res = requests.get...
BrahmsPotato/PlayWithPrettyFat
kaggle/titanic/feature_engineering.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import re as re train = pd.read_csv('../input/train.csv', header = 0, dtype={'Age': np.float64}) test = pd.read_csv('../input/test.csv' , header = 0, dtype={'Age': np.float64}) full_data = [train, test] print (train.info()) """ Explanation: Introduction This...
uber/pyro
tutorial/source/epi_intro.ipynb
apache-2.0
import os import matplotlib.pyplot as plt import seaborn as sns import torch import pyro import pyro.distributions as dist from pyro.contrib.epidemiology import CompartmentalModel, binomial_dist, infection_dist %matplotlib inline assert pyro.__version__.startswith('1.7.0') torch.set_default_dtype(torch.double) # Requ...
scikit-optimize/scikit-optimize.github.io
dev/notebooks/auto_examples/bayesian-optimization.ipynb
bsd-3-clause
print(__doc__) import numpy as np np.random.seed(237) import matplotlib.pyplot as plt from skopt.plots import plot_gaussian_process """ Explanation: Bayesian optimization with skopt Gilles Louppe, Manoj Kumar July 2016. Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt Problem statement We are interested...
mne-tools/mne-tools.github.io
0.17/_downloads/c0c13bba79416f07138e867fac14148e/plot_configuration.ipynb
bsd-3-clause
import os.path as op import mne from mne.datasets.sample import data_path fname = op.join(data_path(), 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(fname).crop(0, 10) original_level = mne.get_config('MNE_LOGGING_LEVEL', 'INFO') """ Explanation: Configuring MNE python This tutorial gives a shor...
laurentmih/fastai_homework3
notebooks/state farm attempt.ipynb
mit
import os import zipfile import shutil import csv import bcolz os.environ["KERAS_BACKEND"] = "theano" import keras import numpy as np from keras.utils.data_utils import get_file from keras.models import load_model from keras.layers.normalization import BatchNormalization from keras.layers import Dense, Dropout, Flatten...
jdhp-docs/python-notebooks
python_matplotlib_geo_fr.ipynb
mit
%matplotlib inline """ Explanation: Cartographie avec Python et Matplotlib End of explanation """ from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt fig, ax = plt.subplots() lllat = 41.0 # latitude of lower left hand corner of the desired map domain (degrees). urlat = 52.0 # latitude of upper...
berlemontkevin/Jupyter_Notebook
Algorithm_Physic/M2_PTSC_17/.ipynb_checkpoints/Homework2-checkpoint.ipynb
apache-2.0
# Some useful package import random import numpy import math import time import operator import pylab import matplotlib.pyplot as plt %matplotlib inline n_item = 5 #First of all : generate the random distribut...
GoogleCloudPlatform/python-docs-samples
data-science-onramp/feature-engineering/feature_engineering.ipynb
apache-2.0
import os import pandas as pd from google.cloud import storage """ Explanation: Feature engineering with pandas and scikit-learn This notebook demonstrates how to use Notebooks to perform feature engineering on a dataset using Pandas. For each dataset, you will load the data into a Pandas DataFrame, clean and transfo...
anjsimmo/simple-ml-pipeline
jupyter_notebooks/data_bt.ipynb
mit
import pandas as pd f = pd.read_csv('../data/BLUETH_20150819.filtered.BT', header=None, names=['Site', 'Unix Time', 'Anonymized Bluetooth ID']) f.head() """ Explanation: Wrangle Bluetooth Data We wrangle the bluetooth data into a workable format, and extract the travel time between the sites we are interested in. Impo...
samuelsinayoko/kaggle-housing-prices
data_exploration.ipynb
mit
df.columns """ Explanation: Exploration The dataset is massive, so let's pick a few columns to get started. We look for features that explain the the sell prices, so these features should be correlated. One way to find them is to plot the correlation matrix and look for correlated variables. End of explanation """ d...
rpreen/xcsf
python/notebooks/example_regression.ipynb
gpl-3.0
from __future__ import annotations from typing import Final import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.datasets import fetch_openml from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from sklearn.model_selection import train_test_s...
colour-science/colour-science.org
posts/about-rendering-engines-colourspace-agnosticism.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pylab import colour from colour.utilities.verbose import message_box name, data, illuminant = colour.COLOURCHECKERS['ColorChecker 2005'] sRGB_w = colour.sRGB_COLOURSPACE.whitepoint sRGB_XYZ_to_RGB = colour.sRGB_COLOURSPACE.XYZ_to_RGB_matrix sRGB_RGB_to_XYZ = colour.sRGB_...
tensorflow/docs-l10n
site/pt-br/tutorials/images/transfer_learning.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...
hpleva/pyemto
example_projects/fcc_elastic_constants/CoCrFeMnNi_paramagnetic_fcc.ipynb
mit
from IPython.display import display, HTML HTML("<style>.container { width:98% !important; }</style>") %pylab inline import numpy as np from pyemto.EOS import EOS from pyemto.emto_parser import EMTOPARSER """ Explanation: Make the cell width as wide as possible End of explanation """ lat = 'fcc' ry2J = 2.1798741e-1...
quantopian/research_public
notebooks/data/eventvestor.earnings_guidance/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.eventvestor import earnings_guidance # or if you want to import the free dataset, use: # from quantopian.interactive.data.eventvestor import earnings_guidance_free # import data operations from odo import odo # import other libraries we will use import pandas as pd...
dualphase90/Learning-Neural-Networks
TF more basic tutuorials.ipynb
mit
import tensorflow as tf x = tf.constant(35, name='x') y = tf.Variable(x + 5, name='y') print(y) x = tf.constant(35, name='x') y = tf.Variable(x + 5, name='y') model = tf.initialize_all_variables() with tf.Session() as session: session.run(model) print(session.run(y)) """ Explanation: What does Tensor...
Evfro/polara
examples/Hyper-parameter tuning and cross-validation tutorial.ipynb
mit
import urllib from polara import (get_movielens_data, # returns data in the pandas dataframe format RecommenderData) # provides common interface to access data url = 'http://files.grouplens.org/datasets/movielens/ml-10m.zip' tmp_file, _ = urllib.request.urlretrieve(url) # this may take some time d...
neXyon/suvicoco
notebooks/Adaptive_Controllers.ipynb
agpl-3.0
B_len = np.random.randint(5, 10) A_len = np.random.randint(5, 10) B = np.random.randn(B_len) A = np.random.randn(A_len) def stable_poly(length): # all roots inside unit circle and real valued polynomial roots = np.random.rand((length - 1) // 2) * np.exp(np.random.rand((length - 1) // 2) * 2j * np.pi) ...
ecervera/mindstorms-nb
task/navigation.ipynb
mit
from functions import connect, touch, forward, backward, left, right, stop, disconnect, next_notebook from time import sleep connect() """ Explanation: Exercici de navegació <span title="Roomba navigating around furniture"><img src="img/roomba.jpg" align="right" width=200></span> Un robot mòbil com el Roomba de la ima...
VectorBlox/PYNQ
docs/source/8_base_overlay_iop.ipynb
bsd-3-clause
from pynq import Overlay from pynq.iop import Pmod_OLED from pynq.iop import PMODB ol = Overlay("base.bit") ol.download() oled = Pmod_OLED(PMODB) """ Explanation: Using Peripherals with the Base overlay Base overlay The PYNQ-Z1 has 2 Pmod connectors. PMODA and PMODB as indicated below are connected to the FPGA fabric...
vrbala/vrbala.github.io
machine-learning-nanodegree/student_intervention/student_intervention/new/stu_intv_solution/student_intervention.ipynb
mit
# Import libraries import numpy as np import pandas as pd # Read student data student_data = pd.read_csv("student-data.csv") print "Student data read successfully!" # Note: The last column 'passed' is the target/label, all other are feature columns """ Explanation: Project 2: Supervised Learning Building a Student In...
ankurankan/pgmpy
examples/Monty Hall Problem.ipynb
mit
from IPython.display import Image Image("images/monty.png") """ Explanation: Monty Hall Problem Problem Description: The Monty Hall Problem is a very famous problem in Probability Theory. The question goes like: Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behin...
sameera2004/scikit-xray-examples
demos/Generate_ROI_labeled_arrays.ipynb
bsd-3-clause
import skbeam.core.roi as roi import skbeam.core.correlation as corr import numpy as np import matplotlib.pyplot as plt %matplotlib inline from matplotlib.ticker import MaxNLocator from matplotlib.colors import LogNorm import xray_vision.mpl_plotting as mpl_plot """ Explanation: Generate Region of Interests (ROI) l...
Luke035/dlnd-lessons
transfer-learning/Transfer_Learning.ipynb
mit
from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm vgg_dir = 'tensorflow_vgg/' # Make sure vgg exists if not isdir(vgg_dir): raise Exception("VGG directory doesn't exist!") class DLProgress(tqdm): last_block = 0 def hook(self, block_num=1, block_size=1, total_s...
vkuznet/rep
howto/03-howto-gridsearch.ipynb
apache-2.0
%pylab inline """ Explanation: Grid Search in REP This notebook demonstrates tools to optimize classification model provided by Reproducible experiment platform (REP) package: grid search for the best classifier hyperparameters different optimization algorithms different scoring models (optimization of arbirtar...
google/jax
docs/notebooks/quickstart.ipynb
apache-2.0
import jax.numpy as jnp from jax import grad, jit, vmap from jax import random """ Explanation: JAX Quickstart JAX is NumPy on the CPU, GPU, and TPU, with great automatic differentiation for high-performance machine learning research. With its updated version of Autograd, JAX can automatically differentiate native Py...
AllenDowney/ModSimPy
soln/chap23soln.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
texib/deeplearning_homework
mnist-logistic_regression.ipynb
mit
x = tf.placeholder(tf.float32,shape=[None,28*28]) y = tf.placeholder(tf.float32,shape=[None,10]) # Create model # Set model weights W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) xw = tf.matmul(x, W) r = xw + b a = tf.nn.softmax(r) """ Explanation: 定義 Input 及 Output 暫存變數 Input 為 28x28 的點陣圖素 Ou...
folivetti/PIPYTHON
ErrosExcecoes.ipynb
mit
print(4/0) # division by zero float("quatro ponto seis") # ValueError: could not convert string to float """ Explanation: Erros e Exceções Em diversas situações, podem ocorrer erros ou exceções no Python. Veja alguns exemplos a seguir: End of explanation """ x = float(input("Digite um número:")) print(1/x) """ Exp...
tensorflow/docs-l10n
site/ko/io/tutorials/audio.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...
jaalonso/AFV
Programacion_imperativa_en_Python.ipynb
gpl-3.0
2 * 5 + 6 - (100 + 3) 8/2, 8/3 7 // 2, 7 % 2 2 ** 10 """ Explanation: <a href="https://colab.research.google.com/github/jaalonso/AFV/blob/master/Programacion_imperativa_en_Python.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Programación impera...
renecnielsen/twitter-diy
ipynb/03b Descriptive Statistics - TSV.ipynb
mit
from IPython.core.display import HTML styles = open("../css/custom.css", "r").read() HTML(styles) import pandas as pd import numpy as np """ Explanation: Descriptive Statistics Descriptive Statistics and Graphs Number of Tweets (Total) Number of Tweets (Time Series) Gender Distribution Language Distribution Follower...
KristianHolsheimer/tensorflow_training
control_flow_in_tensorflow.ipynb
gpl-3.0
import tensorflow as tf import numpy as np import pandas as pd %matplotlib inline """ Explanation: Control flow in Tensorflow In this tutorial, we're going to use control flow operations, i.e. if statements and while loops. So before we tackle the bigger problem, let's learn how these control flow operations are imple...
philmui/datascience2016fall
lecture02.ingestion/lecture02.web.scaping.ipynb
mit
import requests from lxml import html """ Explanation: Import needed libraries End of explanation """ response = requests.get('http://news.ycombinator.com/') response response.content """ Explanation: We used the library "request" last time in getting Twitter data (REST-ful). We are introducing the new "lxml" lib...
hyzhak/nltk-experiments
main.ipynb
mit
import nltk from nltk import tokenize # TODO: we don't relly want to download packages each time when we lauch this script # so it'll better to check somehow whether we have packages or not - or Download on demand # nltk.download() """ Explanation: NLTK experiments based on NLTK with Python 3 for Natural Language Pr...
dkirkby/bossdata
examples/nb/MakingSkyPlots.ipynb
mit
%pylab inline from mpl_toolkits.basemap import Basemap from matplotlib.collections import PolyCollection import astropy.units as u from astropy.coordinates import SkyCoord import healpy as hp print(hp.version.__version__) import bossdata.meta print(bossdata.__version__) """ Explanation: Examples of Making Sky Plot...
Eomys/MoSQITo
tutorials/tuto_signal_basic_operations.ipynb
apache-2.0
# Add MOSQITO to the Python path import sys sys.path.append('..') # To get inline plots (specific to Jupyter notebook) %matplotlib notebook # Import numpy import numpy as np # Import plot function import matplotlib.pyplot as plt # Import load function from mosqito.utils import load # Import MOSQITO color sheme [Opti...
random-forests/tensorflow-workshop
archive/extras/time-series-estimator.ipynb
apache-2.0
# tensorflow import tensorflow as tf # rnn common functions from tensorflow.contrib.learn.python.learn.estimators import rnn_common # visualization import seaborn as sns import matplotlib.pyplot as plt # helpers import numpy as np import pandas as pd import csv # enable tensorflow logs tf.logging.set_verbosity(tf.l...
mne-tools/mne-tools.github.io
0.20/_downloads/89050e30106bf5c25f0fafb6d50732da/plot_phantom_4DBTi.ipynb
bsd-3-clause
# Authors: Alex Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import os.path as op import numpy as np from mne.datasets import phantom_4dbti import mne """ Explanation: 4D Neuroimaging/BTi phantom dataset tutorial Here we read 4DBTi epochs data obtained with a spherical phantom using four differe...
tensorflow/fairness-indicators
g3doc/tutorials/Fairness_Indicators_on_TF_Hub_Text_Embeddings.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...
jss367/assemble
exploratory_notebooks/tweets_nlp_experiment.ipynb
mit
# some nlp tools import spacy import gensim import pyLDAvis.gensim as gensimvis import pyLDAvis # tools to get data from s3 import boto3 from io import StringIO import json import requests # would probably need these import numpy as np import pandas as pd import itertools nlp = spacy.load('en') """ Explanation: <h2...
GoogleCloudPlatform/bigquery-notebooks
notebooks/community/analytics-componetized-patterns/retail/recommendation-system/bqml-scann/05_deploy_lookup_and_scann_caip.ipynb
apache-2.0
import numpy as np import tensorflow as tf """ Explanation: Part 5: Deploy the solution to AI Platform Prediction This notebook is the fifth of five notebooks that guide you through running the Real-time Item-to-item Recommendation with BigQuery ML Matrix Factorization and ScaNN solution. Use this notebook to complete...
HackyHour/Wuerzburg
56_nalu/nalu_problem.ipynb
cc0-1.0
import torch from torch import Tensor, nn, optim import torch.nn.functional as F import numpy as np from tqdm.notebook import tqdm import matplotlib.pyplot as plt """ Explanation: Learning the identity with neural networks We try to reproduce the problem of learning neural networks that learn the identity function an...
google/eng-edu
ml/pc/exercises/image_classification_part3.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...
icrtiou/coursera-ML
ex7-kmeans and PCA/3- kmeans for image compression.ipynb
mit
from skimage import io # cast to float, you need to do this otherwise the color would be weird after clustring pic = io.imread('data/bird_small.png') / 255. io.imshow(pic) pic.shape # serialize data data = pic.reshape(128*128, 3) """ Explanation: load image as ndarray http://scikit-image.org/ End of explanation """...
lamastex/scalable-data-science
_360-in-525/2018/02/SimonLindgren/MeTooInJupyterIpythonNBAction/Simon_MetooStep4.ipynb
unlicense
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer analyzer = SentimentIntensityAnalyzer() import pandas as pd pd.set_option('display.max_colwidth', -1) """ Explanation: Simon #metoo step 4 For sentiment analysis, we will use the VADER library. End of explanation """ df = pd.DataFrame.from_csv("me...
molpopgen/fwdpy
docs/pages/regions.ipynb
gpl-3.0
recRegions = [fwdpy.Region(1,1e5,0,False),fwdpy.Region(1e5,2e5,1e-8,False),fwdpy.Region(2e5,3e5,1e-7,False)] for i in recRegions: print (i) neutralRegions = [fwdpy.Region(0,1,1)] """ Explanation: For this hypothetical example, the region lengths are all identical, and thus an equivalent specification would be thi...
mohsinhaider/pythonbootcampacm
Control Flow/The 'if', 'elif', and 'else' Statements.ipynb
mit
you = "ready" if you == "ready": print("Vamanos!") else: print("What's wrong?") """ Explanation: If, Elif, Else Statements Programming starts and ends at control flow. Decisions need to be made to carry out the functions you write. We make decisions use the if, elif, and else statement. Like any other program...