repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
yoavg/cnn | pyexamples/tutorials/RNNs.ipynb | apache-2.0 | model = Model()
NUM_LAYERS=2
INPUT_DIM=50
HIDDEN_DIM=10
builder = LSTMBuilder(NUM_LAYERS, INPUT_DIM, HIDDEN_DIM, model)
# or:
# builder = SimpleRNNBuilder(NUM_LAYERS, INPUT_DIM, HIDDEN_DIM, model)
"""
Explanation: An LSTM/RNN overview:
An (1-layer) RNN can be thought of as a sequence of cells, $h_1,...,h_k$, where $h_... |
mne-tools/mne-tools.github.io | 0.19/_downloads/aa221dc65413caee3ba4b18802f88d21/plot_topo_compare_conditions.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne.viz import plot_evoked_topo
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
Explanation:... |
srcole/qwm | burrito/Burrito_dimensions.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import pandasql
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Data characterization
Scott Cole
2 July 2016
This note... |
mne-tools/mne-tools.github.io | 0.17/_downloads/234d5d29991ce5146ff7526007f98039/plot_stats_cluster_spatio_temporal_repeated_measures_anova.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Denis Engemannn <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.random import randn
import matplotlib.pyplot as plt
import mne
f... |
probml/pyprobml | deprecated/two_moons_normalizingFlow.ipynb | mit | !pip install -U dm-haiku distrax optax
import matplotlib.pyplot as plt
from IPython.display import clear_output
from sklearn import datasets, preprocessing
import distrax
import jax
import jax.numpy as jnp
import numpy as np
import haiku as hk
import optax
import tensorflow as tf
import tensorflow_datasets as tfds
fr... |
mldbai/mldb | container_files/demos/Real-Time Digits Recognizer.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo("WGdLCXDiDSo")
"""
Explanation: MLPaint: Real-Time Handwritten Digits Recognizer
The automatic recognition of handwritten digits is now a well understood and studied Machine Vision and Machine Learning problem. We will be using MNIST (check out Wikipedia's page on ... |
yandexdataschool/gumbel_lstm | demo_gumbel_sigmoid.ipynb | mit | temperature = 0.1
logits = np.linspace(-5,5,10).reshape([1,-1])
gumbel_sigm = GumbelSigmoid(t=temperature)(logits)
sigm = T.nnet.sigmoid(logits)
import matplotlib.pyplot as plt
%matplotlib inline
plt.title('gumbel-sigmoid samples')
for i in range(10):
plt.plot(range(10),gumbel_sigm.eval()[0],marker='o',alpha=0.25)... |
GoogleCloudPlatform/practical-ml-vision-book | 09_deploying/09a_inmemory.ipynb | apache-2.0 | import tensorflow as tf
print('TensorFlow version' + tf.version.VERSION)
print('Built with GPU support? ' + ('Yes!' if tf.test.is_built_with_cuda() else 'Noooo!'))
print('There are {} GPUs'.format(len(tf.config.experimental.list_physical_devices("GPU"))))
device_name = tf.test.gpu_device_name()
if device_name != '/devi... |
bert9bert/statsmodels | examples/notebooks/tsa_arma_0.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.graphics.api import qqplot
"""
Explanation: Autoregressive Moving Average (ARMA): Sunspots data
End of explanation
"""... |
seth2000/chinesepoem | .ipynb_checkpoints/PrepareData-checkpoint.ipynb | mit | # -*- coding: utf-8 -*-
import os
import re
import time
import codecs
import argparse
TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
BASE_FOLDER = "C:/Users/sethf/source/repos/chinesepoem/" # os.path.abspath(os.path.dirname(__file__))
DATA_FOLDER = os.path.join(BASE_FOLDER, 'data')
DEFAULT_FIN = os.path.join(DATA_FOLDER, '唐诗语料库.t... |
anujjamwal/learning | cs231n/lesson-3.ipynb | mit | import numpy as np
import matplotlib.pylab as plt
import math
from scipy.stats import mode
%matplotlib inline
"""
Explanation: Classification
Given an input with $D$ dimensions and $k$ classes, the goal of classification if to find the function $f$ such that
$$ f:X \Rightarrow K$$
Linear Classification
The simplest f... |
kriete/cie5703_notebooks | week_6_Charlotte.ipynb | mit | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
%matplotlib inline
plt.style.use('ggplot')
"""
Explanation: Assignment CIE 5703 - week 6
Import Libraries
End of explanation
"""
from mpl_toolkits.basemap import Basemap
def get_basemap(_resolution):
return Basemap(projection='merc', llcrnrl... |
rflamary/POT | notebooks/plot_otda_d2.ipynb | mit | # Authors: Remi Flamary <remi.flamary@unice.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
#
# License: MIT License
import matplotlib.pylab as pl
import ot
import ot.plot
"""
Explanation: OT for domain adaptation on empirical distributions
This example introduces a domain adaptation in a 2D setting. It exp... |
phasedchirp/Assorted-Data-Analysis | exercises/SlideRule-DS-Intensive/UD120/Evaluation.ipynb | gpl-2.0 | import pickle
import sys
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
data_dict = pickle.load(open("../final_project/final_project_dataset.pkl", "r") )
features_list = ["poi", "salary"]
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(d... |
mercybenzaquen/foundations-homework | foundations_hw/05/.ipynb_checkpoints/Homework5_NYT-checkpoint.ipynb | mit | #my IPA key b577eb5b46ad4bec8ee159c89208e220
#base url http://api.nytimes.com/svc/books/{version}/lists
import requests
response = requests.get("http://api.nytimes.com/svc/books/v2/lists.json?list=hardcover-fiction&published-date=2009-05-10&api-key=b577eb5b46ad4bec8ee159c89208e220")
best_seller = response.json()
print... |
avallarino-ar/MCDatos | Notas/Notas-Python/01_NumPy_ArrayMatrices.ipynb | mit | import numpy as np # Importo numpy con el alias np.
np.empty((2, 3)) # Matriz vacía de 2 x 3.
"""
Explanation: Numpy
Librería para operar con vectores y matrices.
Hace posible operar con cualquier dato numérico o array.
Incorpora operaciones básicas como la suma o la multiplicación u otras más complejas como la ... |
david4096/bioapi-examples | python_notebooks/1kg_rna_quantification_service.ipynb | apache-2.0 | from ga4gh.client import client
c = client.HttpClient("http://1kgenomes.ga4gh.org")
#Obtain dataSet id REF: -> `1kg_metadata_service`
dataset = c.search_datasets().next()
"""
Explanation: GA4GH RNA Quantification API Example
This example illustrates the methods used to access the rna_quantification_service.
Initiali... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/05_06/Begin/.ipynb_checkpoints/Data Frame Plots-checkpoint.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: Data Frame Plots
documentation: http://pandas.pydata.org/pandas-docs/stable/visualization.html
End of explanation
"""
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts... |
bblais/Classy | examples/Example kNearestNeighbor.ipynb | mit | %pylab inline
from classy import *
"""
Explanation: Example for kNearestNeighbor using the Iris Data
First we need the standard import
End of explanation
"""
data=load_excel('data/iris.xls',verbose=True)
"""
Explanation: Load the Data
End of explanation
"""
print(data.vectors.shape)
print(data.targets)
print(data... |
christoffkok/auxi.0 | src/examples/tools/materialphysicalproperties/slags.ipynb | lgpl-3.0 | from auxi.tools.materialphysicalproperties.slags import UrbainViscosityTx
# create an instance of the model
urbainTx = UrbainViscosityTx()
# define the material state
T = 1873.15 # [K]
x = {'SiO2': 0.25, 'P2O5': 0.25, 'CaO': 0.25, 'MgO':0.25} # [mole fraction]
# calculate the viscosity
mu = urbainTx(T=T, x=x)
prin... |
vbsteja/code | Python/ML_DL/DL/Neural-Networks-Demystified-master/Part 5 Numerical Gradient Checking.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('pHMzNW8Agq4')
"""
Explanation: <h1 align = 'center'> Neural Networks Demystified </h1>
<h2 align = 'center'> Part 5: Numerical Gradient Checking </h2>
<h4 align = 'center' > @stephencwelch </h4>
End of explanation
"""
%pylab inline
#Import Code from previous vi... |
ioam/scipy-2017-holoviews-tutorial | solutions/00-welcome-with-solutions.ipynb | bsd-3-clause | from IPython.core import page
with open('../README.rst', 'r') as f:
page.page(f.read())
"""
Explanation: <a href='http://www.holoviews.org'><img src="assets/hv+bk.png" alt="HV+BK logos" width="40%;" align="left"/></a>
<div style="float:right;"><h2>00. Introduction and Setup</h2></div>
<img src="./assets/tutorial_... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/miroc-es2h/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'miroc-es2h', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MIROC
Source ID: MIROC-ES2H
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propert... |
Xilinx/meta-petalinux | recipes-multimedia/gstreamer/gstreamer-vcu-notebooks/vcu-demo-streamin-decode-display.ipynb | mit | from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here... |
iris-edu/ispaq | EXAMPLES/Example3_plotPDFs.ipynb | lgpl-3.0 | import sqlite3
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
import matplotlib.dates as mdates
import numpy as np
import datetime
"""
Explanation: Note:
In this directory, there are two examples using PDFs: Example 3 - Plot PDF for a station, and Example 4 - Calculate P... |
ejm553/NUREU17 | LSST/VariableStarClassification/First_Sources.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table as tab
"""
Explanation: Inital Sources
Using the sources at 007.20321 +14.87119 and RA = 20:50:00.91, dec = -00:42:23.8 taken from the NASA/IPAC Infrared Science Archieve on 6/22/17.
End of explanation
"""
source_1 ... |
MingChen0919/learning-apache-spark | notebooks/07-natural-language-processing/nlp-and-nltk-basics.ipynb | mit | from pyspark import SparkContext
sc = SparkContext(master = 'local')
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName("Python Spark SQL basic example") \
.config("spark.some.config.option", "some-value") \
.getOrCreate()
"""
Explanation: NLP and NLTK Basics
S... |
metpy/MetPy | v1.1/_downloads/83b6998284b63bb8a8f46a92e71d6000/isentropic_example.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, add_timestamp
from metpy.units import units
"""
Explanation: Isentropic Analysi... |
KGPML/Hyperspectral | IndianPinesCNN.ipynb | gpl-3.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import patch_size
import tensorflow as tf
# The IndianPines dataset has 16 classes, representing different kinds of land-cover.
NUM_CLASSES = 16
# We will classify each patch
IMAGE_SIZE = patch_s... |
Caranarq/01_Dmine | 01_Agua/.ipynb_checkpoints/agua-checkpoint.ipynb | gpl-3.0 | # librerías utilizadas
from IPython.display import Markdown, Image
%matplotlib inline
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Configuracion del sistema
import sys; print('Python {} on {}'.format(sys.version, sys.platform))
print('Pandas version: {}'.form... |
nbokulich/short-read-tax-assignment | ipynb/mock-community/taxonomy-assignment-qiime2.ipynb | bsd-3-clause | from os.path import join, exists, split, sep, expandvars
from os import makedirs, getpid
from glob import glob
from shutil import rmtree
import csv
import json
import tempfile
from itertools import product
from qiime2.plugins import feature_classifier
from qiime2 import Artifact
from joblib import Parallel, delayed
f... |
feststelltaste/software-analytics | prototypes/ForensicFiles.ipynb | gpl-3.0 | import glob
file_list = glob.glob(r'C:/dev/forensic/data/**/*.txt', recursive=True)
file_list = [x.replace("\\", "/") for x in file_list]
file_list[:5]
"""
Explanation: Introduction
Idea
The claim was that the directory structure would be very similar to each other over a period of time. We want to identify this time... |
poppy-project/community-notebooks | tutorials-education/poppy-torso__vrep_Prototype d'ininitiation à l'informatique pour les lycéens/decouverte/Decouverte TP3.ipynb | lgpl-3.0 | from poppy.creatures import PoppyTorso
poppy = PoppyTorso(simulator='vrep')
"""
Explanation: Decouverte – Niveau 1 - Python
TP3
Pour commencer votre programme python devra contenir les lignes de code ci-dessous et le logiciel V-REP devra être lancé.
Dans V-REP (en haut à gauche) utilise les deux icones flèche pour dé... |
spennihana/h2o-3 | h2o-py/demos/EEG_eyestate_sklearn_NOPASS.ipynb | apache-2.0 | import pandas as pd
import numpy as np
from collections import Counter
"""
Explanation: Scikit-Learn singalong: EEG Eye State Classification
Author: Kevin Yang
Contact: kyang@h2o.ai
This tutorial replicates Erin LeDell's oncology demo using Scikit Learn and Pandas, and is intended to provide a comparison of the syntac... |
lukasmerten/CRPropa3 | doc/pages/example_notebooks/trajectories/trajectories.v4.ipynb | gpl-3.0 | from crpropa import *
randomSeed = 42
turbSpectrum = SimpleTurbulenceSpectrum(Brms=8*nG, lMin = 60*kpc, lMax=800*kpc, sIndex=5./3.)
gridprops = GridProperties(Vector3d(0), 256, 30*kpc)
BField = SimpleGridTurbulence(turbSpectrum, gridprops, randomSeed)
# print some properties of our field
print('Lc = {:.1f} kpc'.forma... |
Hyperparticle/deep-learning-foundation | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
vadim-ivlev/STUDY | handson-data-science-python/DataScience-Python3/NaiveBayes.ipynb | mit | import os
import io
import numpy
from pandas import DataFrame
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
def readFiles(path):
for root, dirnames, filenames in os.walk(path):
for filename in filenames:
path = os.path.join(root, filen... |
hasadna/knesset-data-pipelines | jupyter-notebooks/committee protocol parts classification using catma.ipynb | mit | import csv
import xml.etree.ElementTree as ET
from os import listdir
import re
import subprocess
from tempfile import mkdtemp
from glob import glob
target = 'target'
ana_name = 'ana'
TALKER_SEP = '_TALKER_'
def get_talker(all_talkers,indices, b):
for i in range(len(indices)):
if indices[i] > b:
... |
Caranarq/01_Dmine | Datasets/INERE/.ipynb_checkpoints/INERE-checkpoint.ipynb | gpl-3.0 | descripciones = {
'P0009' : 'Potencial de aprovechamiento energía solar',
'P0010' : 'Potencial de aprovechamiento energía eólica',
'P0011' : 'Potencial de aprovechamiento energía geotérmica',
'P0012' : 'Potencial de aprovechamiento energía de biomasa',
'P0606' : 'Generación mediante fuentes renovables de energía',
'P06... |
particle-physics-playground/playground | activities/codebkg_DownloadData.ipynb | mit | import pps_tools as pps
#pps.download_drive_file()
#pps.download_file()
"""
Explanation: This notebook provides a way to download data files using the <a href="http://docs.python-requests.org/en/latest/">Python requests library</a>. You'll need to have this library installed on your system to do any work.
The first ... |
pdamodaran/yellowbrick | examples/Sangarshanan/comparing_corpus_visualizers.ipynb | apache-2.0 | ##### Import all the necessary Libraries
from yellowbrick.text import TSNEVisualizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from yellowbrick.text import UMAPVisualizer
from yellowbrick.datasets import load_hobbies
"""
Explanation: Compar... |
xgcm/xmitgcm | doc/demo_writing_binary_file.ipynb | mit | import numpy as np
import xmitgcm
import matplotlib.pylab as plt
"""
Explanation: Use case: writing a binary input file for MITgcm
You may want to write binary files to create forcing data, initial condition,... for your MITgcm configuration. Here we show how xmitgcm can help.
Simple case: a regular grid
End of explan... |
rhiever/scipy_2015_sklearn_tutorial | notebooks/04.1 Cross Validation.ipynb | cc0-1.0 | from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
iris = load_iris()
X, y = iris.data, iris.target
classifier = KNeighborsClassifier()
"""
Explanation: Cross-Validation and scoring methods
To evaluate how well our supervised models generalize, so far we split our data into a t... |
gjwo/nilm_gjw_data | notebooks/disaggregation-CO.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
from os.path import join
from pylab import rcParams
import matplotlib.pyplot as plt
rcParams['figure.figsize'] = (13, 6)
plt.style.use('ggplot')
#import nilmtk
from nilmtk import DataSet, TimeFrame, MeterGroup, HDFDataStore
from nilmtk.disaggregate import Combin... |
NEONScience/NEON-Data-Skills | tutorials/Python/Hyperspectral/hyperspectral-classification/Classification_OLS_py/Classification_OLS_py.ipynb | agpl-3.0 | import numpy as np
import matplotlib
import matplotlib.pyplot as mplt
from scipy import linalg
from scipy import io
### Ordinary Least Squares
### SOLVES 2-CLASS LEAST SQUARES PROBLEM
### LOAD DATA ###
### IF LoadClasses IS True, THEN LOAD DATA FROM FILES ###
### OTHERSIE, RANDOMLY GENERATE DATA ###
LoadClasses =... |
mommermi/Introduction-to-Python-for-Scientists | notebooks/.ipynb_checkpoints/Interpolation_20161104-checkpoint.ipynb | mit | # matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# read in signal.csv
data = np.genfromtxt('signal.csv', delimiter=',',
dtype=[('x', float), ('y', float), ('yerr', float)])
f, ax = plt.subplots()
ax.errorbar(data['x'], data['y'], yerr=data['yerr'], linestyle='', color='red... |
CUBoulder-ASTR2600/lectures | lecture_10_vectors_numpy.ipynb | isc | x = 2
y = 3
myList = [x, y]
myList
"""
Explanation: Array Computing
Terminology
List
A sequence of values that can vary in length.
The values can be different data types.
The values can be modified (mutable).
Tuple
A sequence of values with a fixed length.
The values can be different data types.
The values cannot ... |
vatsan/gp_jupyter_notebook_templates | notebooks/01_data_exploration.ipynb | apache-2.0 | %run '00_database_connectivity_setup.ipynb'
IPython.display.clear_output()
"""
Explanation: Setup database connectivity
We'll reuse our module from the previous notebook (00_database_connectivity_setup.ipynb) to establish connectivity to the database
End of explanation
"""
%%execsql
drop table if exists gp_ds_sample... |
mne-tools/mne-tools.github.io | 0.18/_downloads/6d7b5624e4fa6fee90fb68aca9314f7f/plot_evoked_topomap.ipynb | bsd-3-clause | # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
# Tal Linzen <linzen@nyu.edu>
# Denis A. Engeman <denis.engemann@gmail.com>
# Mikołaj Magnuski <mmagnuski@swps.edu.pl>
#
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 5
import numpy as np
import matplotlib.pyplot as pl... |
alexweav/Learny-McLearnface | GradientChecks.ipynb | mit | %load_ext autoreload
%autoreload 2
import numpy as np
import LearnyMcLearnface as lml
"""
Explanation: Layer Gradient Checks
Here, we use numerical gradient checking to verify the backpropagation correctness of all layers in the Layers folder. We should expect to see very small nonzero values for error, as the checki... |
eford/rebound | ipython_examples/OrbitPlot.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1)
sim.add(m=0.1, e=0.041, a=0.4, inc=0.2, f=0.43, Omega=0.82, omega=2.98)
sim.add(m=1e-3, e=0.24, a=1.0, pomega=2.14)
sim.add(m=1e-3, e=0.24, a=1.5, omega=1.14, l=2.1)
sim.add(a=-2.7, e=1.4, f=-1.5,omega=-0.7) # hyperbolic orbit
"""
Explanation: Orbit Plot
REBOUND c... |
computational-class/cjc2016 | code/12.topic-models-with-turicreate.ipynb | mit | import turicreate as tc
"""
Explanation: Topic Modeling Using Turicreate
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
End of explanation
"""
sf = tc.SFrame.read_csv("/Users/datalab/bigdata/cjc/w15",
header=False)
sf
"""
Explanation: Download Data: <del>h... |
quantumlib/ReCirq | docs/quantum_chess/quantum_chess_rest_api.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-aerchem/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-aerchem', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-AERCHEM
Sub-To... |
ddebrunner/streamsx.topology | samples/python/topology/notebooks/ViewDemo/ViewDemo.ipynb | apache-2.0 | from streamsx.topology.topology import Topology
from streamsx.topology import context
from some_module import jsonRandomWalk
#from streamsx import rest
import json
import logging
# Define topology & submit
rw = jsonRandomWalk()
top = Topology("myTop")
stock_data = top.source(rw)
# The view object can be used to retri... |
mauriciogtec/PropedeuticoDataScience2017 | Alumnos/JuanPabloDeBotton/Tarea1_JuanPabloDeBotton.ipynb | mit | import numpy as np
"""
Explanation: Tarea 1: Creando una sistema de Álgebra Lineal
En esta tarea seran guiados paso a paso en como realizar un sistema de arrays en Python para realizar operaciones de algebra lineal.
Pero antes... (FAQ)
Como se hace en la realidad? En la practica, se usan paqueterias funcionales ya pr... |
antongrin/EasyMig | EasyMig_v3-interact2.ipynb | apache-2.0 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 13:21:45 2016
@author: GrinevskiyAS
"""
from __future__ import division
import numpy as np
from numpy import sin,cos,tan,pi,sqrt
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from ipywidgets import interact, interactive, fixed
im... |
xdnian/pyml | code/bonus/softmax-regression.ipynb | mit | %load_ext watermark
%watermark -a '' -u -d -v -p matplotlib,numpy,scipy
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
%matplotlib inline
"""
Explanation: Sebastian Raschka, 2016
https://github.com/1iyiwei/pyml
Note that t... |
hunterherrin/phys202-2015-work | assignments/assignment03/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
BinRoot/TensorFlow-Book | ch04_classification/Concept03_logistic2d.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
learning_rate = 0.1
training_epochs = 2000
"""
Explanation: Ch 04: Concept 03
Logistic regression in higher dimensions
Set up the imports and hyper-parameters
End of explanation
"""
x1_label1 = np.random.normal(3, 1, 1000)... |
tpin3694/tpin3694.github.io | machine-learning/convert_pandas_categorical_column_into_integers_for_scikit-learn.ipynb | mit | # Import required packages
from sklearn import preprocessing
import pandas as pd
"""
Explanation: Title: Convert Pandas Categorical Data For Scikit-Learn
Slug: convert_pandas_categorical_column_into_integers_for_scikit-learn
Summary: Convert Pandas Categorical Column Into Integers For Scikit-Learn
Date: 2016-11-30 12:... |
lwcook/horsetail-matching | notebooks/Gradients.ipynb | mit | import numpy
import matplotlib.pyplot as plt
from horsetailmatching import UniformParameter, IntervalParameter, HorsetailMatching
from horsetailmatching.demoproblems import TP1, TP2
"""
Explanation: In this notebook we look at how to use the gradient of the horsetail matching metric to speed up optimizations (in term... |
aapeebles/tibertraining | Markdown.ipynb | mit | Header 1
========
Header 2
--------
"""
Explanation: Markdown
What is it?
Markdown is a markup language with plain text formatting, designed so that it can be converted to HTML.
Markdown can be used to create rich text using a plain text editor.
Why should I care?
Markdown is your key to formatting the text you prov... |
andrenatal/DeepSpeech | DeepSpeech.ipynb | mpl-2.0 | import os
import time
import json
import datetime
import tempfile
import subprocess
import numpy as np
from math import ceil
from xdg import BaseDirectory as xdg
import tensorflow as tf
from util.log import merge_logs
from util.gpu import get_available_gpus
from util.shared_lib import check_cupti
from util.text import ... |
harrisonpim/bookworm | 03 - Visualising and Analysing Networks.ipynb | mit | from bookworm import *
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
plt.rcParams['figure.figsize'] = (12,9)
import pandas as pd
import numpy as np
book = load_book('data/raw/hp_philosophers_stone.txt')
characters = extract_character_names(book)
sequences = get_s... |
daviddesancho/BestMSM | example/fourstate/fourstate_tpt.ipynb | gpl-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import fourstate
import itertools
import networkx as nx
import numpy as np
import operator
bhs = fourstate.FourState()
"""
Explanation: Transition path theory tests
In what follows we are going to look at a simple four state model to better understand some fundamental... |
christophebertrand/ada-epfl | HW02-Data_from_the_Web/master_data_analysis.ipynb | mit | all_data = pd.read_csv('all_data.csv', usecols=['Civilité', 'Nom_Prénom', 'title', 'periode_acad', 'periode_pedago','Orientation_Master', 'Spécialisation', 'Filière_opt.', 'Mineur', 'Statut', 'Type_Echange', 'Ecole_Echange', 'No_Sciper'])
all_data.sort_values(by='No_Sciper', axis=0).head(10)
len(all_data)
"""
Explan... |
kongjy/hyperAFM | Notebooks/multiple regression_1-varun.ipynb | mit | len(Amatrix[0])
#performing multiple simple linear regression for only the a,Amatrix, because of error of the .fit function
from sklearn import linear_model
regr=linear_model.LinearRegression()#performing the simple linear regression
regr.fit(a[0].reshape(len(a),1),yactual.reshape(len(yactual),1))
"""
Explanation: I... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session08/Day1/OOP_problem.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
"""
Explanation: Building a Digital Orrery
An exercise in Object Oriented Programming
Version 0.1
It is your goal in this exercise to construct a Digital Orrery. An orrery is a mechanical model of the Solar System. Here, we will generalize this t... |
CalPolyPat/phys202-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
print(a+b)
"""
Explanation: Interact basics
Write... |
nathanielng/machine-learning | perceptron/logistic-regression.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from numpy.random import permutation
from sympy import var, diff, exp, latex, factor, log, simplify
from IPython.display import display, Math, Latex
%matplotlib inline
"""
Explanation: The Linear Model II
<hr>
linear classificatio... |
mne-tools/mne-tools.github.io | 0.18/_downloads/c3c186a71be1cfa94a34ecef5331099f/plot_brainstorm_phantom_elekta.ipynb | bsd-3-clause | # sphinx_gallery_thumbnail_number = 9
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import find_events, fit_dipole
from mne.datasets.brainstorm import bst_phantom_elekta
from mne.io import read_... |
olinguyen/self-driving-cars | p2-traffic-sign-classification/Traffic_Signs_Recognition.ipynb | mit | # Load pickled data
import pickle
import os
training_file = "./train.p"
testing_file = "./test.p"
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(testing_file, mode='rb') as f:
test = pickle.load(f)
X_train, y_train = train['features'], train['labels']
X_test, y_test = test['fe... |
rgerkin/sciunit | docs/chapter3.ipynb | mit | import sciunit
"""
Explanation: SciUnit is a framework for validating scientific models by creating experimental-data-driven unit tests.
Chapter 3. Testing with help from the SciUnit standard library
(or back to Chapter 2)
End of explanation
"""
from sciunit.models import ConstModel # One of many dummy models includ... |
wdwvt1/bcp | ipynbs/drinking.ipynb | mit | %matplotlib inline
from IPython.display import Image
Image('./drinking/water_usage_exp1.png')
# for y in [w1, w4, w7]:
# plt.plot(t, y, 'g')
# for y in [w2, w5, w6, w8]:
# plt.plot(t, y, 'r')
# plt.ylabel('Water remaining (g)')
# plt.xlabel('Day')
# plt.xticks([i[1] for i in e], ['End Night %s' % i for i in ra... |
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE | notebooks/14_standard_library.ipynb | mit | %%javascript
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')
"""
Explanation: A tour through the python standard library
python comes with "batteries included", the standard library is extremely
rich and powerfull
End of explanation
"""
import os
"""
Explanation: <h1 id... |
darkomen/TFG | medidas/03082015/.ipynb_checkpoints/datos-checkpoint.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... |
james-prior/cohpy | 20170615-dojo-days-of-months.ipynb | mit | MONTHS_PER_YEAR = 12
# for unknown year
def max_month_length(month):
"""Return maximum number of days for given month.
month is zero-based.
That is,
0 means January,
11 means December,
12 means January (again)
-2 means November (yup, wraps around both ways)"""
max_month_lengths = (
... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/emac-2-53-aerchem/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-aerchem', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: EMAC-2-53-AERCHEM
Topic: Ocean
Sub-T... |
samoturk/HUB-machine-learning | ipython/Prediction of diabetes with scikit-learn.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, roc_auc_score, auc, recall_score, accuracy_score, confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
import seaborn as sns
"""
Explanation... |
ComputationalModeling/spring-2017-danielak | past-semesters/spring_2016/homework_assignments/Homework_1.ipynb | agpl-3.0 | # write any code you need here!
# Create additional cells if you need them by using the
# 'Insert' menu at the top of the browser window.
"""
Explanation: Homework #1
This notebook contains the first homework for this class, and is due on Sunday, January 31st, 2016 at 11:59 p.m.. Please make sure to get started... |
tofgarion/lp-visu | lp_visu/lp_visu_ex.ipynb | gpl-3.0 | from lp_visu import LPVisu
from scipy.optimize import linprog
import numpy as np
"""
Explanation: This is a simple Jupyter Notebook example presenting how to use the LPVisu class.
First, import LPVisu class and necessary Python packages:
End of explanation
"""
A = [[1.0, 0.0], [1.0, 2.0], [2.0, 1.0]]
b = [8.0, 15.0... |
retnuh/deep-learning | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
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', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
QuantScientist/Deep-Learning-Boot-Camp | day03/2.2 CNN HandsOn - MNIST Dataset.ipynb | mit | import numpy as np
import keras
from keras.datasets import mnist
# Load the datasets
(X_train, y_train), (X_test, y_test) = mnist.load_data()
"""
Explanation: CNN HandsOn with Keras
Problem Definition
Recognize handwritten digits
Data
The MNIST database (link) has a database of handwritten digits.
The training set ... |
quantumlib/Cirq | docs/tutorials/google/echoes.ipynb | apache-2.0 | try:
import cirq
except ImportError:
!pip install --quiet cirq --pre
from typing import Optional, Sequence
import matplotlib.pyplot as plt
import numpy as np
import cirq
import cirq_google as cg
from cirq.experiments import random_rotations_between_grid_interaction_layers_circuit
"""
Explanation: Qubit pick... |
crystalzhaizhai/cs207_yi_zhai | lectures/L2/L2.ipynb | mit | %%bash
cd /tmp
rm -rf playground #remove if it exists
git clone https://github.com/dsondak/playground.git
%%bash
ls -a /tmp/playground
"""
Explanation: Lecture 2: Version Control with Git
This tutorial is largely based on the repository:
git@github.com:rdadolf/git-and-github.git
which was created for IACS's ac297r co... |
diogro/ode_examples | Numerical Integration Tutorial.ipynb | mit | %matplotlib inline
from numpy import *
from matplotlib.pyplot import *
# time intervals
tt = arange(0, 10, 0.5)
# initial condition
xx = [0.1]
def f(x):
return x * (1.-x)
# loop over time
for t in tt[1:]:
xx.append(xx[-1] + 0.5 * f(xx[-1]))
# plotting
plot(tt, xx, '.-')
ta = arange(0, 10, 0.01)
plot(ta, 0.1... |
ehongdata/Network-Analysis-Made-Simple | 4. Cliques, Triangles and Squares (Instructor).ipynb | mit | G = nx.Graph()
G.add_nodes_from(['a', 'b', 'c'])
G.add_edges_from([('a','b'), ('b', 'c')])
nx.draw(G, with_labels=True)
"""
Explanation: Cliques, Triangles and Squares
Let's pose a problem: If A knows B and B knows C, would it be probable that A knows C as well? In a graph involving just these three individuals, it ma... |
pdhimal1/AI-Project | Predictor/notebook_predictor.ipynb | mit | %matplotlib inline
x_axis = np.arange(0+1, len(historical)+1)
plt.plot(x_axis, historical_opening, 'b', x_axis, historical_closing, 'r')
plt.xlabel('Day')
plt.ylabel('Price ($)')
#plt.figure(figsize=(20,10))
plt.title("Stock price: Opening vs Closing")
plt.show();
"""
Explanation: Plots
Opening vs Closing
blue - ope... |
tiffanyj41/hermes | notebooks/CF - Bayes, Pearson Correlation, etc.ipynb | apache-2.0 | import datetime, time
# timestamp is not correct; it is 8 hours ahead
print (datetime.datetime.now() - datetime.timedelta(hours=8)).strftime('%Y-%m-%d %H:%M:%S')
"""
Explanation: Comparing Collaborative Filtering Systems
According to studies done by the article "Comparing State-of-the-Art Collaborative Filtering Syst... |
MatteusDeloge/opengrid | notebooks/Water Leak Detection.ipynb | apache-2.0 | import os
import sys
import pytz
import inspect
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import tmpo
from opengrid import config
from opengrid.library import plotting
from opengrid.library import houseprint
c=config.Config()
%matplotlib inline
plt.rcParams['figure.... |
EuroPython/ep-tools | notebooks/session_instructions_toPDF.ipynb | mit | %%javascript
IPython.OutputArea.auto_scroll_threshold = 99999;
//increase max size of output area
import json
import datetime as dt
from operator import itemgetter
from collections import OrderedDict
from operator import itemgetter
from IPython.display import display, HTML
from nbconvert.filters.markdown import mar... |
IsacLira/data-science-cookbook | 2016/network-analysis/Centrality.ipynb | mit | import network_analysis_utils as nau
import networkx as nx
# Available functions:
#
# - nau.facebook_nx_graph(): Obtém o grafo Networkx do facebook
#
# - nau.random_nx_graph(): Obtém o grafo Networkx randômico
#
# - nau.write_btwns_graph(nx_graph, weight_dict, output_filename):
# Plota o grafo em um arqui... |
jorisvandenbossche/DS-python-data-analysis | notebooks/python_recap/01-basic.ipynb | bsd-3-clause | # Two general packages
import os
import sys
"""
Explanation: Python the basics: datatypes
DS Data manipulation, analysis and visualization in Python
May/June, 2021
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbossch
... |
QuantCrimAtLeeds/PredictCode | examples/Networks/Case study Chicago/Input data.ipynb | artistic-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.collections
import geopandas as gpd
import open_cp.network
import open_cp.sources.chicago
import open_cp.geometry
#data_path = os.path.join("/media", "disk", "Data")
data_path = os.path.join("..", "..", "..", "..", "..", "..", "Data")
open_cp.source... |
ContinualAI/avalanche | notebooks/from-zero-to-hero-tutorial/06_loggers.ipynb | mit | !pip install avalanche-lib==0.2.0
"""
Explanation: description: "Logging... logging everywhere! \U0001F52E"
Loggers
Welcome to the "Logging" tutorial of the "From Zero to Hero" series. In this part we will present the functionalities offered by the Avalanche logging module.
End of explanation
"""
from torch.optim im... |
shngli/Data-Mining-Python | UMSI course recommender/Course database.ipynb | gpl-3.0 | import re
import math
from operator import itemgetter
enrolled = {}
numstudents = {}
numincommon = {}
scores = {}
titles = {}
for line in open("courseenrollment.txt", "r"):
line = line.rstrip('\s\r\n')
(student, graddate, spec, term, dept, courseno) = line.split('\t')
# Create a variable course that ... |
csdms/pymt | notebooks/cem.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
#Some magic that allows us to view images within the notebook.
%matplotlib inline
"""
Explanation: Coastline Evolution Model
The Coastline Evolution Model (CEM) addresses predominately sandy, wave-dominated coastlines on time-scales ranging from years to millenia and... |
jrg365/gpytorch | examples/02_Scalable_Exact_GPs/KeOps_GP_Regression.ipynb | mit | import math
import torch
import gpytorch
from matplotlib import pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: GPyTorch Regression With KeOps
Introduction
KeOps is a recently released software package for fast kernel operations that integrates wih PyTorch. We can use the ability ... |
harmsm/pythonic-science | labs/02_regression/02_model-fitting_key.ipynb | unlicense | def first_order(t,A,k):
"""
First-order kinetics model.
"""
return A*(1 - np.exp(-k*t))
def first_order_r(param,t,obs):
"""
Residuals function for first-order model.
"""
return first_order(t,param[0],param[1]) - obs
def fit_model(t,obs,param_guesses=(1,1)):
"""
Fit the fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.