repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
daler/metaseq-biotrac56 | heatmap-example.ipynb | mit | # Show figures in the notebook
%matplotlib inline
"""
Explanation: Overview
This notebook is a follow-up to the de-example.ipynb notebook.
The end goal is a heatmap of normalized H3K4me3 ChIP-seq signal in K562 cells,
split into signal over genes that were up, down and unchanged compared to H1-hESC
cells.
End of expl... |
rueedlinger/machine-learning-snippets | notebooks/supervised/regression/linear/multiple_linear_regression_statsmodels.ipynb | mit | import statsmodels.api as sm
import statsmodels.formula.api as smf
import statsmodels.tools.eval_measures as eval_measures
import seaborn as sns
import scipy.stats as stats
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets, model_selection, metrics
"""
Explanatio... |
tensorflow/docs-l10n | site/ja/tutorials/quickstart/advanced.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... |
lia-statsletters/notebooks | people/.ipynb_checkpoints/populations-checkpoint.ipynb | gpl-3.0 | F=graphviz.Graph()#(engine='neato')
F.graph_attr['rankdir'] = 'LR'
F.edge('A_1','B_1')
F.edge('A_1','B_2')
F.edge('A_2','B_1')
F.edge('A_3','B_1')
F.edge('A_4','B_2')
F.edge('A_5','B_2')
F.edge('A_5','B_3')
F
"""
Explanation: Finding relations between clusters of people and clusters of stuff they purchase
The old sayi... |
darkomen/TFG | medidas/11082015/Análisis de datos.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... |
streety/biof509 | Wk11-Inheritance-Abstraction.ipynb | mit | class Person(object):
"""A class definition for a person. The following attributes are supported:
Attributes:
name: A string representing the person's name.
age: An integer representing the person's age."""
mammal = True
def __init__(self, name, age):
"""Return a Person o... |
williamsmj/moma-collection | moma1.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
sns.set_context('poster')
"""
Explanation: New York's Museum of Modern Art recently posted a CSV database of their collection on Github. It's a perfect dataset to demonstrate some of the expressive but relat... |
AlbanoCastroSousa/RESSPyLab | examples/VC_Calibration_Example_1.ipynb | mit | import RESSPyLab as rpl
import numpy as np
"""
Explanation: Original Voce-Chaboche Model Fitting Example 1
An example of fitting the original Voce-Chaboche model to a set of test data is provided.
Documentation for all the functions used in this example can be found by either looking at docstrings for any of the funct... |
saketkc/notebooks | python/AndrewsCurves.ipynb | bsd-2-clause | def andrews_curves(data, granularity=1000):
"""
Parameters
-----------
data : array like
ith row is the ith observation
jth column is the jth feature
Size (m, n) => m replicats with n features
granularity : int
linspace granularity for theta
Ret... |
caisq/tensorflow | tensorflow/contrib/eager/python/examples/notebooks/custom_layers.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... |
cathywu/flow | tutorials/tutorial02_aimsun.ipynb | mit | from flow.scenarios.loop import LoopScenario
"""
Explanation: Tutorial 2: Running Aimsun Simulations
This tutorial walks through the process of running non-RL traffic simulations in Flow with Aimsun. This tutorial is a near direct copy of the tutorial01_sumo.ipynb since some modifications to describe Aimsun-specific f... |
kit-cel/wt | SC468/LDPC_Optimization_BEC.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plot
from ipywidgets import interactive
import ipywidgets as widgets
import math
from pulp import *
%matplotlib inline
"""
Explanation: Optimization of Degree Distributions on the BEC
This code is provided as supplementary material of the lecture Channel Coding 2 - Adva... |
ccwang002/2015Talk-DeepLearn-CNN | code/03_layers.ipynb | mit | # As usual, a bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolatio... |
MCGallaspy/pymc3 | pymc3/examples/stochastic_volatility.ipynb | apache-2.0 | import numpy as np
import pymc3 as pm
from pymc3.distributions.timeseries import GaussianRandomWalk
from scipy.sparse import csc_matrix
from scipy import optimize
%pylab inline
"""
Explanation: Stochastic Volatility model
End of explanation
"""
n = 400
returns = np.genfromtxt("data/SP500.csv")[-n:]
returns[:5]
pl... |
Lattecom/HYStudy | scripts/[HYStudy 19th] Data Structure 2.ipynb | mit | # Node of a Singly Linked List
class Node:
# constructor
def __init__(self, data=None, next=None):
self.data = data
self.next = next
# method of getter, setter for data
def setData(self, data):
self.data = data
def getData(self):
return self.data
# metho... |
jrelliott82/end_of_day_two | DefensiveProgramming_3.ipynb | gpl-2.0 | def test_range_overlap():
assert range_overlap([(-3.0, 5.0), (0.0, 4.5), (-1.5, 2.0)]) == (0.0, 2.0)
assert range_overlap([ (2.0, 3.0), (2.0, 4.0) ]) == (2.0, 3.0)
assert range_overlap([ (0.0, 1.0), (0.0, 2.0), (-1.0, 1.0) ]) == (0.0, 1.0)
"""
Explanation: # Defensive programming (2)
We have seen the ba... |
jldbc/pybaseball | EXAMPLES/2018_NL_Central_Analysis.ipynb | mit | import pybaseball as pyball
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# Get all NL Central Team Records for 2018
year = 2018
brewers = pyball.schedule_and_record(year, 'MIL')
cardinals = pyball.schedule_and_record(year, 'STL')
cubs = pyball.schedule_and_record(year, 'CH... |
cmorgan/toyplot | docs/data-tables.ipynb | bsd-3-clause | import toyplot.data
import numpy
table = toyplot.data.Table()
table["x"] = numpy.arange(10)
table["x*2"] = table["x"] * 2
table["x^2"] = table["x"] ** 2
table
"""
Explanation: .. _data-tables:
Data Tables
Data tables, with rows containing observations and columns containing variables or series, are arguably the corne... |
robblack007/clase-dinamica-robot | Practicas/practica1/visualizacion.ipynb | mit | from robots.robots import Robot
from numpy import pi
"""
Explanation: Práctica 1 - Introducción a Jupyter lab y libreria robots
Introducción a la librería robots y sus visualizadores
En este documento se van a importar las librerias necesarias para graficar los datos simulados por medio de los métodos numéricos descri... |
mitdbg/modeldb | client/workflows/demos/Spam-Detection.ipynb | mit | try:
import verta
except ImportError:
!pip install verta
"""
Explanation: Spam Detection (NLTK and scikit-learn)
This example logs a class (instead of an object instance) as a model.
This allows for custom setup configuration in the class's __init__() method,
and access to logged artifacts at deployment time.
... |
albahnsen/PracticalMachineLearningClass | exercises/P3-ConversationsToxicityDetection-SampleSolution.ipynb | mit | !pip install -U -q kaggle
!echo {"username":"albahnsen","key":"1c9e16f2c8e4de73bb6b7db12d17e22d"} > C:\Users\albah\.kaggle\kaggle.json
!kaggle competitions download -c jigsaw-unintended-bias-in-toxicity-classification -f test.csv -p ../datasets
!kaggle competitions download -c jigsaw-unintended-bias-in-toxicity-class... |
hrjn/ISLR_reading_group | notebooks/chap2.ipynb | gpl-3.0 | df_adv = pd.read_csv("../data/Advertising.csv")
# Define the output variable:
y = df_adv["Sales"].values
# Define the features:
label_adv = ["TV", "Radio","Newspaper"]
X = df_adv[label_adv].values
# Split train/test data:
#data_adv = np.column_stack((X,y))
#X_train, X_test, y_train, y_test = train_test_split(X, y, te... |
bgroveben/python3_machine_learning_projects | learn_kaggle/pandas/PFDS_pandas/intro_to_pandas.ipynb | mit | import pandas as pd
"""
Explanation: <p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br>
Pandas</p>
<br>
pandas is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python.
pandas ... |
bird-house/birdy | notebooks/examples/owslib.ipynb | apache-2.0 | from owslib.wps import WebProcessingService
from birdy import WPSClient
url = "https://bovec.dkrz.de/ows/proxy/emu?Service=WPS&Request=GetCapabilities&Version=1.0.0"
wps = WebProcessingService(url)
cli = WPSClient(url=url)
"""
Explanation: OWSLib versus Birdy
This notebook shows a side-by-side comparison of owslib.w... |
nholtz/structural-analysis | slope-deflection/oiq-exam-question-2-Version-2.ipynb | cc0-1.0 | from IPython import display
display.SVG('oiq-frame-1.svg')
"""
Explanation: OIQ Exam Question 2
Question from OIQ Technical Exam, obviously meant to be solved using moment distribution, but
here we see how easy it is using slope deflection instead. This version users a newer version of 'sdutil'
that computes end-shea... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/supplemental/solutions/object_detection_with_automl.ipynb | apache-2.0 | pip freeze | grep google-cloud-automl==1.0.1 || pip install google-cloud-automl==1.0.1
pip freeze | grep google-cloud-storage==1.27.0 || pip install google-cloud-storage==1.27.0
import os
import tensorflow as tf
from google.cloud import automl
"""
Explanation: <b>Object Detection with AutoML Vision</b>
<br>
<b>Lear... |
RaoUmer/lightning-example-notebooks | plots/force.ipynb | mit | import os
from lightning import Lightning
from numpy import random, asarray, linspace, corrcoef
from colorsys import hsv_to_rgb
from sklearn import datasets
import networkx as nx
"""
Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> For... |
MTG/essentia | src/examples/python/tutorial_tensorflow_real-time_simultaneous_classifiers.ipynb | agpl-3.0 | !pip install pysoundcard
%matplotlib nbagg
import numpy as np
from scipy.special import softmax
import matplotlib.pyplot as plt
import soundcard as sc
from struct import unpack
from IPython import display
from essentia.streaming import *
from essentia import Pool, run, array, reset
"""
Explanation: Real-time infer... |
MetricLearning/diplomado_datascience | 04_Introduccion_estadistica/01_Tabla_frecuencias_y_medidas.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
np.set_printoptions(precision=2)
%precision 2
"""
Explanation: Análisis descriptivo
Autor: Roberto P. Muñoz<br />
Cargo: Data Scientist en MetricArts<br />
Github: https://github.com/rpmunoz
En este tutorial revisaremos los conceptos de tablas de frencuencias, medidas de localiz... |
metpy/MetPy | v0.12/_downloads/bb9caa5586d62e19ca46e30c02d29b43/Station_Plot.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from metpy.calc import reduce_point_density
from metpy.cbook import get_test_data
from metpy.io import metar
from metpy.plots import add_metpy_logo, current_weather, sky_cover, StationPlot
"""
Explanation: Station Plot
Make ... |
mne-tools/mne-tools.github.io | 0.19/_downloads/0f6b60b574bc5e5c341b148b90d0f456/plot_evoked_whitening.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import sample
from mne.cov import compute_covariance
print(__doc__)
"""
Explanation: Whitening evoked data with a noise cova... |
DBWangGroupUNSW/COMP9318 | L7 - Multinomial and Bernoulli Naive Bayes Classifiers.ipynb | mit | import pandas as pd
import numpy as np
from sklearn.naive_bayes import MultinomialNB,BernoulliNB
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction import DictVectorizer
from sklearn.cross_validation import KFold
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Predict S... |
ohsu-computational-biology/server | scripts/ga4gh_example.ipynb | apache-2.0 | baseURL = "http://localhost:8000"
client = ga4gh.client.HttpClient(baseURL)
"""
Explanation: GA4GH IPython Example Notebook
This notebook provides an overview of how to call a the GA4GH reference server from an iPython notebook. Before running this notebook:
git clone https://github.com/ga4gh/server.git -b develop
D... |
deepmind/deepmind-research | polygen/training.ipynb | apache-2.0 | !pip install tensorflow==1.15 dm-sonnet==1.36 tensor2tensor==1.14
import os
import numpy as np
import tensorflow.compat.v1 as tf
tf.logging.set_verbosity(tf.logging.ERROR) # Hide TF deprecation messages
import matplotlib.pyplot as plt
%cd /tmp
%rm -rf /tmp/deepmind_research
!git clone https://github.com/deepmind/dee... |
aravindk1992/TextClassification | A Noob's guide to text classification.ipynb | mit | import nltk
nltk.download()
"""
Explanation: A Noob's guide to Text Classification Using NLTK, Scikit and Gensim
The Summer of 2015 was very productive! I got an opportunity to work with a startup company on a Text Classification problem. We were dealing with a very large HTML corpus which made it all the more challe... |
GoogleCloudPlatform/training-data-analyst | blogs/windmills/windmills.ipynb | apache-2.0 | %projects set ml-autoawesome
import os
PROJECT = 'ml-autoawesome' # CHANGE THIS
BUCKET = 'ml-autoawesome-cmle' # CHANGE THIS
REGION = 'us-central1' # CHANGE THIS
os.environ['PROJECT'] = PROJECT # for bash
os.environ['BUCKET'] = BUCKET # for bash
os.environ['REGION'] = REGION # for bash
%bash
echo "project=$PROJE... |
hawk31/pyGPGO | tutorials/mlopt.ipynb | mit | import numpy as np
from sklearn.datasets import make_moons
np.random.seed(20)
X, y = make_moons(n_samples = 200, noise = 0.3) # Data and target
"""
Explanation: Hyperparameter optimization using pyGPGO
by José Jiménez (Oct 18, 2017)
In this tutorial, we will learn the basics of the Bayesian optimization (BO) framewor... |
jlawman/jlawman.github.io | content/sklearn/Dimensionality Reduction - PCA.ipynb | mit | from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
%matplotlib inline
"""
Explanation: Principal Component Analysis (PCA) offers an effective way to reduce the dimensions of the data. This reduction o... |
GoogleCloudDataproc/cloud-dataproc | notebooks/python/2.1. Google Cloud Storage (CSV) & Spark DataFrames - Python.ipynb | apache-2.0 | from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('2.1. Google Cloud Storage (CSV) & Spark DataFrames') \
.getOrCreate()
"""
Explanation: 2.1. Google Cloud Storage (CSV) & Spark DataFrames - Python
Create Dataproc Cluster with Jupyter
This notebook is designed to be run on Google Cloud D... |
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
P... |
bjshaw/phys202-2015-work | days/day13/ODEs.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
"""
Explanation: Ordinary Differential Equations
Learning Objectives: Understand the numerical solution of ODEs and use scipy.integrate.odeint to solve and explore ODEs numerically.
Imports
End of explanation
"""
tmax = 10.0 ... |
rainyear/pytips | Tips/2016-03-15-Unicode-String.ipynb | mit | ('S' 'T' 'R' 'I' 'N' 'G')
"""
Explanation: Python 字符串
所有用过 Python (2&3)的人应该都看过下面两行错误信息:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 0-1: invalid continuation byte
这就是 Python 界的"锟斤拷"!
今天和接下来几期的内容将... |
statsmodels/statsmodels.github.io | v0.13.0/examples/notebooks/generated/ols.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
np.random.seed(9876789)
"""
Explanation: Ordinary Least Squares
End of explanation
"""
nsample = 100
x = np.linspace(0, 10, 100)
X = np.column_stack((x, x ** 2))
beta = np.array([1, 0.1, 10])
e = ... |
rashikaranpuria/Machine-Learning-Specialization | Regression/Assignment_four/.ipynb_checkpoints/week-4-ridge-regression-assignment-2-blank-checkpoint.ipynb | mit | import graphlab
graphlab.product_key.set_product_key("C0C2-04B4-D94B-70F6-8771-86F9-C6E1-E122")
"""
Explanation: Regression Week 4: Ridge Regression (gradient descent)
In this notebook, you will implement ridge regression via gradient descent. You will:
* Convert an SFrame into a Numpy array
* Write a Numpy function t... |
gangadhara691/gangadhara691.github.io | P3 wrangle_data/DataWrangling_ganga.ipynb | mit | def isEnglish(string):
try:
string.encode('ascii')
except UnicodeEncodeError:
return False
else:
return True
"""
Explanation: P3 - Data Wrangling with MongoDB
OpenStreetMap Project Data Wrangling with MongoDB
Gangadhara Naga Sai<a name="top"></a>
Data used -<a href=https://mapzen.co... |
Merinorus/adaisawesome | Homework/05 - Taming Text/HW05.ipynb | gpl-3.0 | from wordcloud import WordCloud
from nltk.corpus import stopwords
from nltk.sentiment import *
import pandas as pd
import numpy as np
import nltk
import time
import matplotlib.pyplot as plt
import seaborn as sns
import pycountry
%matplotlib inline
# import data
directory = 'hillary-clinton-emails/'
aliases = pd.read_c... |
AnyBody-Research-Group/AnyPyTools | docs/Tutorial/05_Monte_Carlo_studies_etc.ipynb | mit | from scipy.stats import distributions
# Truncated normal between +/- 2SD.
patella_tendon_insertion = distributions.truncnorm(-2,2,[0.02, 0.12, 0], [0.01,0.01,0.01])
patella_tendon_origin = distributions.truncnorm(-2,2,[0.0,-0.03, 0], [0.01,0.01,0.01])
from anypytools import macro_commands as mc
macro = [
mc.Set... |
StanIsAdmin/PyProt | examples/substitution-matrices.ipynb | gpl-3.0 | sh3Files = ("SH3-A.fasta", "SH3-B.fasta", "SH3-C.fasta", "SH3-D.fasta")
sh3Paths = [joinpath("..", "resources", "fasta", filename) for filename in sh3Files]
print("SH3 Family")
blosum40sh3 = blosumFromFasta(40, *sh3Paths)
print(blosum40sh3)
blosum70sh3 = blosumFromFasta(70, *sh3Paths)
print(blosum70sh3)
print("PDZ Fam... |
automl/SpySMAC | examples/cave_notebook.ipynb | bsd-3-clause | from cave.cavefacade import CAVE
#cave = CAVE(["workflow-result"], "test_jupyter", ["."], file_format='BOHB')
cave = CAVE(folders=["./smac3/example_output/run_1", "./smac3/example_output/run_2"],
output_dir="cave_on_jupyter",
ta_exec_dir=["./smac3"],
verbose_level="OFF"
)... |
Donnyvdm/courses | Machine Learning/1. Foundations A Case Study Approach/Week 3/Analyzing product sentiment.ipynb | unlicense | products.head()
len(products)
# Sklearn does not work well with empty fields, so we're dropping all rows that have empty fields
products = products.dropna()
len(products)
"""
Explanation: Let's explore the data
End of explanation
"""
from sklearn.feature_extraction.text import CountVectorizer
cv = CountVectorizer(... |
sony/nnabla | tutorial/dynamic_and_static_nn.ipynb | apache-2.0 | !pip install nnabla-ext-cuda100
!git clone https://github.com/sony/nnabla.git
%cd nnabla/tutorial
%matplotlib inline
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.solvers as S
import numpy as np
np.random.seed(0)
GPU = 0 # ID of GPU that we will use
batch_si... |
jdekozak/dirac5d | Dirac with Geometric Algebra 1,4 over the Reals.ipynb | gpl-3.0 | from sympy import *
variables = (t, x, y, z, w) = symbols('t x y z w', real=True)
print(variables)
metric=[1
,-1
,-1
,-1
,-1]
myBasis='gamma_t gamma_x gamma_y gamma_z gamma_w'
sp5d = Ga(myBasis, g=metric, coords=variables,norm=True)
(gamma_t, gamma_x, gamma_y, gamma_z, gamma_w) = sp5d... |
rjleveque/ptha_tutorial | Notebooks/Make_Transects.ipynb | bsd-2-clause | %pylab inline
from __future__ import print_function
import sys, os
from ptha_paths import data_dir, events_dir
"""
Explanation: Make Transects
This notebook illustrates how to transects of event results or hazard maps.
First set up some things needed in notebook....
End of explanation
"""
# Read in topography data:... |
phungkh/phys202-2015-work | assignments/assignment08/InterpolationEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
sns.set_style('white')
from scipy.interpolate import griddata
"""
Explanation: Interpolation Exercise 2
End of explanation
"""
#xx= np.array([[0],[-5],[-4],[-3],[-2],[-1],[0],[1],[2],[3],[4],[5],[-5],[-4],[-3],[-2],[-1],[0]... |
eblur/dust | examples/mie_vs_RG_scattering.ipynb | bsd-2-clause | from astrodust import distlib
from astrodust.extinction import sigma_scat as ss
import astrodust.constants as c
NH, d2g = 1.e21, 0.009
MDUST = NH * c.m_p * d2g
ERANGE = np.logspace(-0.6,1.0,20)
"""
Explanation: Compare the RG-Drude and Mie scattering cross-sections
End of explanation
"""
RHO_SIL, RHO_GRA, RHO_A... |
AllenDowney/ModSimPy | notebooks/chap16.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... |
danresende/deep-learning | intro-to-tflearn/TFLearn_Digit_Recognition.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
molgor/spystats | notebooks/Sandboxes/MCMC/.ipynb_checkpoints/GaussianProcess inference in PyMC3-checkpoint.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps/external_plugins/spystats/')
import django
django.setup()
import pandas as pd
import matplotlib.pyplot as plt
## Use the ggplot style
plt.style.use('ggplot')
import numpy as np
from spystats import tools
"""
Explanation: Gaussian ... |
Kreiswolke/gensim | docs/notebooks/topic_coherence-movies.ipynb | lgpl-2.1 | import re
import os
from scipy.stats import pearsonr
from datetime import datetime
from gensim.models import CoherenceModel
from gensim.corpora.dictionary import Dictionary
# %load_ext line_profiler # This was used for finding out which line was taking maximum time for indirect confirmation measure
"""
Explanation:... |
MIT-LCP/mimic-workshop | temp/03-example-patient-ich.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sqlite3
%matplotlib inline
"""
Explanation: Exploring the trajectory of a single patient
Import Python libraries
We first need to import some tools for working with data in Python.
- NumPy is for working with numbers
- Pandas is for analysi... |
fernandojvdasilva/nlp-python-lectures | nlp_preprocessing_pt-br.ipynb | gpl-3.0 | import nltk
nltk.download("gutenberg")
"""
Explanation: <h1 align="center"> Introdução ao Processamento de Linguagem Natural (PLN) Usando Python </h1>
<h3 align="center"> Professor Fernando Vieira da Silva MSc.</h3>
<h2> Técnicas para Pré-Processamento </h2>
<p>Vamos avaliar as técnicas mais comuns para prepararmos... |
jerkos/cobrapy | documentation_builder/deletions.ipynb | lgpl-2.1 | import pandas
from time import time
import cobra.test
cobra_model = cobra.test.create_test_model("textbook")
ecoli_model = cobra.test.create_test_model("ecoli")
"""
Explanation: Simulating Deletions
End of explanation
"""
growth_rates, statuses = cobra.flux_analysis.single_gene_deletion(cobra_model)
"""
Explanati... |
YoungKwonJo/mlxtend | docs/examples/evaluate_decision_regions.ipynb | bsd-3-clause | %matplotlib inline
from mlxtend.evaluate import plot_decision_regions
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
# Loading some example data
iris = datasets.load_iris()
X = iris.data[:, [0,2]]
sc = StandardScaler()
X = sc.f... |
mne-tools/mne-tools.github.io | 0.18/_downloads/d327bd04605fdc3280dac732219b5db7/plot_artifacts_detection.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
from mne.preprocessing import create_ecg_epochs, create_eog_epochs
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
"""
Explanation: In... |
ksooklall/deep_learning_foundation | seq2seq/sequence_to_sequence_implementation.ipynb | mit | import numpy as np
import time
import helper
source_path = 'data/letters_source.txt'
target_path = 'data/letters_target.txt'
source_sentences = helper.load_data(source_path)
target_sentences = helper.load_data(target_path)
"""
Explanation: Character Sequence to Sequence
In this notebook, we'll build a model that ta... |
talolard/Interview | Exploration.ipynb | gpl-3.0 | %pylab inline
import sklearn
import pandas as pd
import numpy as np
import nltk
import os
import re
import seaborn as sns
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.decomposition import NMF, LatentDirichletAllocation
from sklearn.pipeline import Pipeline
path ='./data'
... |
ioos/notebooks_demos | notebooks/2018-02-27-pocean-timeSeries-demo.ipynb | mit | from datetime import datetime, timedelta
import numpy as np
import pandas as pd
x = np.arange(100, 110, 0.1)
start = datetime.now() - timedelta(days=7)
df = pd.DataFrame(
{
"time": [start + timedelta(days=n) for n in range(len(x))],
"longitude": -48.6256,
"latitude": -27.5717,
"de... |
dib-lab/SSUsearch | notebooks/ssu-search.ipynb | bsd-3-clause | cd /usr/local/notebooks
mkdir -p ./workdir
#check seqfile files to process in data directory (make sure you still remember the data directory)
!ls ./data/test/data
"""
Explanation: Set up working directory
End of explanation
"""
Seqfile='./data/test/data/1c.fa'
"""
Explanation: README
This part of pipeline search... |
eggie5/UCSD-MAS-DSE230 | hmwk3/2.Reconstruction-HW-Copy.ipynb | mit | !curl -o $data_dir/SampleStations.pickle http://mas-dse-open.s3.amazonaws.com/Weather/SampleStations.pickle
"""
Explanation: Downloading Pickled data from S3
If SampleStations.pickle is not in the directory, get it using the following command
End of explanation
"""
import pickle
Data=pickle.load(open('./Data/Weather... |
naokishibuya/deep-learning | python/gan_mnist.ipynb | mit | import numpy as np
import keras
import keras.backend as K
from keras.layers import Input, Dense, Activation, LeakyReLU, BatchNormalization
from keras.models import Sequential
from keras.optimizers import Adam
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
%matplotlib inline
"""
Ex... |
PMEAL/OpenPNM | examples/contrib/maze_solver.ipynb | mit | # Install the required pmeal packages in the current Jupyter kernel
import sys
try:
import openpnm as op
except:
!{sys.executable} -m pip install openpnm
import openpnm as op
try:
import porespy as ps
except:
!{sys.executable} -m pip install porespy
import porespy as ps
import requests
import n... |
metpy/MetPy | v0.12/_downloads/0eff36d3fdf633f2a71ae3e92fdeb5b8/Simple_Sounding.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, SkewT
from metpy.units import units
# Change default to be better for skew-T
plt.rcParams['figure.figsize'] = (9, 9)
# Upper air data can be... |
google/modem | pythonML/model/Sample_Propensity_Model_AI_Platform_(sklearn).ipynb | apache-2.0 | !python --version && gcloud components update
"""
Explanation: Disclaimer: The following code demonstrates a sample model creation with AI Platform, based on GA-BQ export dataset. This is meant for inspiration only. We expect analysts/data scientists to identify the right set of features to create retargeted audiences... |
AI-Innovation/cs231n_ass1 | svm.ipynb | mit | # Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the
# notebook rather than in a new window.
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.... |
parrt/msan501 | notes/functions.ipynb | mit | def pi():
return 3.14159
"""
Explanation: Organizing your code with functions
<img src="images/pestle.png" width="75" align="right">Years ago I learned to make Thai red curry paste from scratch, including roasting then grinding seeds and pounding stuff in a giant mortar and pestle. It takes forever and so I genera... |
pydata/xarray | doc/examples/ROMS_ocean_model.ipynb | apache-2.0 | import numpy as np
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
%matplotlib inline
import xarray as xr
"""
Explanation: ROMS Ocean Model Example
The Regional Ocean Modeling System (ROMS) is an open source hydrodynamic model that is used for simulating currents and wat... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160704월_24일차_모형 최적화 Model optimization/1.모형 하이퍼 파라미터 튜닝.ipynb | mit | from sklearn.datasets import load_digits
from sklearn.svm import SVC
from sklearn.learning_curve import validation_curve
digits = load_digits()
X, y = digits.data, digits.target
param_range = np.logspace(-6, -1, 10)
%%time
train_scores, test_scores = \
validation_curve(SVC(), X, y,
param_name... |
pfschus/fission_bicorrelation | methods/singles_hist_sim_e.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import scipy.io as sio
sys.path.append('../scripts')
import bicorr as bicorr
import bicorr_e as bicorr_e
import bicorr_math as bicorr_math
import bicorr_sim as bicorr_sim
from tqdm import tqdm
%load_ext autoreload
%autoreload 2
"""
Explanation: ... |
hich28/mytesttxx | tests/python/ltsmin-pml.ipynb | gpl-3.0 | %%pml model
active proctype P() {
int a = 0;
int b = 0;
x: if
:: d_step {a < 3 && b < 3; a = a + 1; } goto x;
:: d_step {a < 3 && b < 3; b = b + 1; } goto x;
fi;
}
"""
Explanation: There are two ways to load a Promela model: from a file or from a cell.
Loading from a cell
Using the %%pml magic will save the mod... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_creating_data_structures.ipynb | bsd-3-clause | import mne
import numpy as np
"""
Explanation: Creating MNE's data structures from scratch
MNE provides mechanisms for creating various core objects directly from
NumPy arrays.
End of explanation
"""
# Create some dummy metadata
n_channels = 32
sampling_rate = 200
info = mne.create_info(n_channels, sampling_rate)
pr... |
turbomanage/training-data-analyst | quests/dei/WIT_Smile_Detector.ipynb | apache-2.0 | !curl -L https://storage.googleapis.com/what-if-tool-resources/smile-demo/smile-colab-model.hdf5 -o ./smile-model.hdf5
!curl -L https://storage.googleapis.com/what-if-tool-resources/smile-demo/test_subset.zip -o ./test_subset.zip
!unzip -qq -o test_subset.zip
"""
Explanation: What-If Tool Image Smile Detection
In this... |
ITAM-DS/analisis-numerico-computo-cientifico | libro_optimizacion/temas/5.optimizacion_de_codigo/5.5/Computo_en_paralelo_usando_GPUS_en_SMC.ipynb | apache-2.0 | %%bash
lscpu
%%bash
sudo lshw -C memory
%%bash
#execute next line to have in the book output of cell
sudo lshw -C display
"""
Explanation: (COMPPARALELOGPUSSMC)=
5.5 Cómputo en paralelo usando GPUs en un sistema de memoria compartida (SMC)
```{admonition} Notas para contenedor de docker:
Comando de docker para ejecu... |
probml/pyprobml | notebooks/misc/Tabular_SARSA.ipynb | mit |
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 2.x
IS_COLAB = True
except Exception:
IS_COLAB = False
if not(IS_COLAB):
print('not a colab')
!pip -q install gym numpy matplotlib
"""
Explanation: <a href="https://colab.research.google.com/github/probml/pyprobml/blob/mast... |
DS-100/sp17-materials | sp17/hw/hw4/hw4_solution.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import sqlalchemy
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('hw4.ok')
"""
Explanation: Homework 4: SQL, FEC Data, and Small Donors
Due: 11:59pm Tuesday, March 14
Note: The ... |
bambinos/bambi | docs/notebooks/circular_regression.ipynb | mit | import arviz as az
import bambi as bmb
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
az.style.use("arviz-white")
"""
Explanation: Circular Regression
End of explanation
"""
x = np.linspace(-np.pi, np.pi, 200)
mus = [0., 0., 0., -2... |
MaayanLab/clustergrammer-widget | Working_on_new_API.ipynb | mit | import numpy as np
import pandas as pd
from clustergrammer_widget import *
net = Network(clustergrammer_widget)
"""
Explanation: Working on new API
The clustergrammer_widget class is now being loaded into the Network class. The class and widget instance are saved in th Network instance, net. This allows us to load dat... |
HSE-LaMBDA/Machine-Learning-Data-Mining-2017 | bias-variance/seminar/Tweet-regularisation.ipynb | mit | %env THEANO_FLAGS='floatX=float32'
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
data = []
labels = []
with open('./training.txt') as f:
for line in f:
tokens = line.split('\t')
label, tweet = tokens[0], tokens[1:]
labels.append(int(label))... |
fonnesbeck/baseball | notebooks/Linear Weights Prediction.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import pymc3 as pm
from pymc3.gp.util import plot_gp_dist
import theano.tensor as tt
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('dark')
"""
Explanation: Linear Weights Prediction
End of explanation
"""
seasonal_pitch_raw = pd.read_csv... |
stevenydc/2015lab1 | Lab1-babypython.ipynb | mit | # The %... is an iPython thing, and is not part of the Python language.
# In this case we're just telling the plotting library to draw things on
# the notebook, instead of on a separate window.
%matplotlib inline
#this line above prepares IPython notebook for working with matplotlib
# See all the "as ..." contructs? ... |
tanmay987/deepLearning | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
dinrker/Algorithms_DataStructures | 06_Stack_Queue.ipynb | mit | class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
# return the top element
if len(self.stack2) == 0:
... |
feststelltaste/software-analytics | demos/20180321_Mathema_Campus/Wertloser Code.ipynb | gpl-3.0 | import pandas as pd
coverage = pd.read_csv("../dataset/jacoco_production_coverage_spring_petclinic.csv")
coverage.head()
"""
Explanation: Identifikation wertloser Codeteile im Projekt "Spring PetClinic"
Auslastungsdaten vom Produktivbetrieb
Datenquelle: Gemessen wurde der Anwendungsbetrieb der Software über einen Zei... |
phoebe-project/phoebe2-docs | 2.0/examples/legacy_spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Comparing Spots in PHOEBE 2 vs PHOEBE Legacy
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
"... |
NYUDataBootcamp/Projects | UG_F16/RodriguezBallve-Spain's_Labor_Market.ipynb | mit | import pandas as pd
from pandas_datareader import data, wb # we will be working with World Bank Data
import wbdata
import pandas
import matplotlib.pyplot as plt
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import datetime as dt
%ma... |
phaustin/pyman | Book/chap2/chap2_basics.ipynb | cc0-1.0 | # This code tests that your Python installation worked.
# It generates a png image file that you should e-mail
# to the address shown on the plot
import scipy as sp
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import platform
import socket
# If you are a student, please fill in your first a... |
fcollonval/coursera_data_visualization | LogisticRegression.ipynb | mit | # Magic command to insert the graph directly in the notebook
%matplotlib inline
# Load a useful Python libraries for handling data
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import seaborn as sns
import matplotlib.pyplot as plt
from IPython.display import Markdown, display
nesarc = pd... |
sot/aimpoint_mon | testing/dynam_offsets/confirm_offsets_via_xija_model.ipynb | bsd-2-clause | import os
import sys
from glob import glob
import json
import numpy as np
from astropy.table import Table
from Chandra.Time import DateTime
from Ska.Matplotlib import plot_cxctime
from chandra_aca import drift
import parse_cm
"""
Explanation: Independent confirmation of ACA offsets
As part of the verification of the... |
pkmital/CADL | session-4/session-4.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n',
'You should consider updating to Python 3.4.0 or',
'higher as the libraries built for this course',
'have only been tested in Python 3.4 and higher.\n')
... |
rasbt/pattern_classification | dimensionality_reduction/projection/kernel_pca.ipynb | gpl-3.0 | %load_ext watermark
%watermark -v -u -d -p scipy,scikit-learn,numpy,matplotlib
"""
Explanation: Sebastian Raschka 2014
End of explanation
"""
from scipy.spatial.distance import pdist, squareform
from scipy import exp
from scipy.linalg import eigh
import numpy as np
def stepwise_kpca(X, gamma, n_components):
""... |
srcole/qwm | sfn/.ipynb_checkpoints/Poster viewer distribution by SfN theme-checkpoint.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from tools.plt import scatt_corr, unpair_2cond, scatt_2cond
import seaborn as sns
sns.set_style('white')
import pandas as pd
"""
Explanation: Poster viewer distribution by SfN them... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.