repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
jbwhit/coal-exploration | deliver/Coal prediction of production.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import explained_variance_score, r2_score, mean_squared_error
sns.set();
"""
Ex... |
snurk/meta-strains | scripts/others/clomial_genotypes.ipynb | mit | def draw_legend(class_colours, classes, right=False):
recs = []
for i in range(0, len(classes)):
recs.append(mpatches.Rectangle((0,0), 1, 1, fc=class_colours[i]))
if right:
plt.legend(recs, classes, bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
else:
plt.legend(recs, classes... |
amcdawes/QMlabs | Lab 7 - Time Evolution.ipynb | mit | import matplotlib.pyplot as plt
from numpy import sqrt,pi,arange,cos,sin
from qutip import *
%matplotlib inline
pz = Qobj([[1],[0]])
mz = Qobj([[0],[1]])
px = Qobj([[1/sqrt(2)],[1/sqrt(2)]])
mx = Qobj([[1/sqrt(2)],[-1/sqrt(2)]])
py = Qobj([[1/sqrt(2)],[1j/sqrt(2)]])
my = Qobj([[1/sqrt(2)],[-1j/sqrt(2)]])
Sx = 1/2.0*s... |
ozorich/phys202-2015-work | assignments/assignment09/IntegrationEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import integrate
"""
Explanation: Integration Exercise 2
Imports
End of explanation
"""
def integrand(x, a):
return 1.0/(x**2 + a**2)
def integral_approx(a):
# Use the args keyword argument to feed extra a... |
palandatarxcom/sklearn_tutorial_cn | notebooks/03.1-Classification-SVMs.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# 使用seaborn的一些默认配置
import seaborn as sns; sns.set()
"""
Explanation: 这个分析笔记由Jake Vanderplas编辑汇总。 源代码和license文件在GitHub。 中文翻译由派兰数据在派兰大数据分析平台上完成。 源代码在GitHub上。
深度探索监督学习:支持向量机
之前我们已经介绍了监督学习。监督学习中有很多算法,在这里我们深入探索其中一种最强大的也最有趣的算法之一:支... |
IST256/learn-python | content/lessons/13-Visualization/Slides.ipynb | mit | import pandas as pd
x = [ { 'a' :2, 'b' : 'x', 'c' : 10},
{ 'a' :4, 'b' : 'y', 'c' : 3},
{ 'a' :1, 'b' : 'x', 'c' : 6} ]
y = pd.DataFrame(x)
"""
Explanation: IST256 Lesson 13
Visualizations
Zybook Ch10
Links
Participation: https://poll.ist256.com
Zoom Chat!
Agenda
Last Lecture... but we ain't gone!
G... |
calebmadrigal/radio-hacking-scripts | auto_crop.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy
#import scipy.io.wavfile
def setup_graph(title='', x_label='', y_label='', fig_size=None):
fig = plt.figure()
if fig_size != None:
fig.set_size_inches(fig_size[0], fig_size[1])
ax = fig.add_subplot(111)
ax.set_ti... |
Quadrocube/rep | howto/03-howto-gridsearch(Higgs).ipynb | apache-2.0 | %pylab inline
"""
Explanation: About
This notebook demonstrates several additional 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 ar... |
vaibhavi-r/CSE-415 | Assignment 7 - Part A.ipynb | mit | import re
from time import time
import string
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pprint import pprint
#Sklearn Imports
from sklearn import metrics
from sklearn.datasets import fetch_20newsgroups
from sklearn import preprocessing
from sklearn.pipeline import Pipeline
from sklear... |
wanderer2/pymc3 | docs/source/notebooks/Euler-Maruyama and SDEs.ipynb | apache-2.0 | %pylab inline
import pymc3 as pm
import theano.tensor as tt
import scipy
from pymc3.distributions.timeseries import EulerMaruyama
"""
Explanation: Inferring parameters of SDEs using a Euler-Maruyama scheme
This notebook is derived from a presentation prepared for the Theoretical Neuroscience Group, Institute of Syste... |
saketkc/notebooks | python/Expectation Maximisation.ipynb | bsd-2-clause | %matplotlib notebook
from __future__ import division
from collections import OrderedDict
from scipy.stats import binom as binomial
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#from ipywidgets import StaticInteract, RangeWidget
import pandas as pd
from IPython.display import display, Image
f... |
stijnvanhoey/flexible_vhm_implementation | vhm_run_examples.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from matplotlib.ticker import LinearLocator
sns.set_style('whitegrid')
mpl.rcParams['font.size'] = 16
mpl.rcParams['axes.labelsize'] = 16
mpl.rcParams['xtick.labelsize'] = 14
mpl.rc... |
google/uncertainty-baselines | baselines/notebooks/Hyperparameter_Ensembles.ipynb | apache-2.0 | import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
import uncertainty_baselines as ub
def _ensemble_accuracy(labels, logits_list):
"""Compute the accuracy resulting from the ensemble prediction."""
per_probs = tf.nn.softmax(logits_list)
probs = tf.reduce_mean(per_probs, axis=0)
acc ... |
jviada/QuantEcon.py | solutions/lakemodel_solutions.ipynb | bsd-3-clause | %pylab inline
import LakeModel
alpha = 0.012
lamb = 0.2486
b = 0.001808
d = 0.0008333
g = b-d
N0 = 100.
e0 = 0.92
u0 = 1-e0
T = 50
"""
Explanation: Lake Model Solutions
Excercise 1
We begin by initializing the variables and import the necessary modules
End of explanation
"""
LM0 = LakeModel.LakeModel(lamb,alpha,b,d... |
fastai/fastai | nbs/41_tabular.data.ipynb | apache-2.0 | #|export
class TabularDataLoaders(DataLoaders):
"Basic wrapper around several `DataLoader`s with factory methods for tabular data"
@classmethod
@delegates(Tabular.dataloaders, but=["dl_type", "dl_kwargs"])
def from_df(cls,
df:pd.DataFrame,
path:(str,Path)='.', # Location of `df`, defaul... |
rvperry/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 the sum of the arguments a and b."""
... |
lknelson/text-analysis-2017 | 05-TextExploration/00-IntroductionToTopicModeling_ExerciseSolutions.ipynb | bsd-3-clause | import pandas
import numpy as np
import matplotlib.pyplot as plt
df_lit = pandas.read_csv("../Data/childrens_lit.csv.bz2", sep='\t', index_col=0, encoding = 'utf-8', compression='bz2')
#drop rows where the text is missing.
df_lit = df_lit.dropna(subset=['text'])
#view the dataframe
df_lit
"""
Explanation: Introducti... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/keys-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
0x4a50/udacity-0x4a50-deep-learning-nanodegree | 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... |
phoebe-project/phoebe2-docs | development/tutorials/plotting_advanced.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Advanced: Plotting Options
For basic plotting usage, see the plotting tutorial
PHOEBE 2.4 uses autofig 1.1 as an intermediate layer for highend functionality to matplotlib.
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment thi... |
goodwordalchemy/thinkstats_notes_and_exercises | code/chap06_Pdfs_notes.ipynb | gpl-3.0 | %matplotlib inline
import thinkstats2
import thinkplot
import pandas as pd
import numpy as np
import math, random
mean, var = 163, 52.8
std = math.sqrt(var)
pdf = thinkstats2.NormalPdf(mean, std)
print "Density:",pdf.Density(mean + std)
thinkplot.Pdf(pdf, label='normal')
thinkplot.Show()
#by default, makes pmf stetch... |
mdeff/ntds_2016 | toolkit/04_sol_visualization.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# Random time series.
n = 1000
rs = np.random.RandomState(42)
data = rs.randn(n, 4).cumsum(axis=0)
plt.figure(figsize=(15,5))
plt.plot(data[:, 0], label='A')
plt.plot(data[:, 1], '.-k', label='B')
plt.plot(data[:, 2], '--m', lab... |
tensorflow/workshops | tfx_colabs/TFX_Workshop_Colab.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... |
sgratzl/ipython-tutorial-VA2015 | 04_MachineLearning_solution.ipynb | cc0-1.0 | measurements = [
{'city': 'Dubai', 'temperature': 33.},
{'city': 'London', 'temperature': 12.},
{'city': 'San Francisco', 'temperature': 18.},
]
from sklearn.feature_extraction import DictVectorizer
vec = DictVectorizer()
tf_measurements = vec.fit_transform(measurements)
tf_measurements.toarray()
vec.get_... |
pfschus/fission_bicorrelation | methods/singles_correction_e.ipynb | mit | import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import imageio
import pandas as pd
import seaborn as sns
sns.set(style='ticks')
sys.path.append('../scripts/')
import bicorr as bicorr
import bicorr_e as bicorr_e
import bicorr_plot as bicorr_plot
import bicorr_sums as bicorr_sums
import bicorr... |
jokedurnez/neuropower_extended | peakdistribution/chengschwartzman_thresholdfree_distribution_simulation.ipynb | mit | % matplotlib inline
import numpy as np
import math
import nibabel as nib
import scipy.stats as stats
import matplotlib.pyplot as plt
from nipy.labs.utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset
import palettable.colorbrewer as cb
from nipype.interfaces import fsl
import os
import pandas as pd
import... |
cleuton/datascience | covid19_Brasil/Covid19_no_Brasil.ipynb | apache-2.0 | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv('./covid19-86691a57080d4801a240e49035b292fc.csv')
df.head()
list_cidades = df.groupby("city").count().index.tolist()
list_cidades
"""
Explanation: Covid 19 - Visualização Brasil
Dados oriundos de https://brasil.io/dataset/covid... |
SIMEXP/Projects | metaad/network_level_meta-clusters.ipynb | mit | #seed_data = pd.read_csv('20160128_AD_Decrease_Meta_Christian.csv')
template_036= nib.load('/home/cdansereau/data/template_cambridge_basc_multiscale_nii_sym/template_cambridge_basc_multiscale_sym_scale036.nii.gz')
template_020= nib.load('/home/cdansereau/data/template_cambridge_basc_multiscale_nii_sym/template_cambrid... |
mikecassell/Deep-Learning-ND | first-neural-network/.ipynb_checkpoints/Your_first_neural_network-checkpoint.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
pastas/pastas | examples/groundwater_paper/Ex2_monitoring_network/Example2.ipynb | mit | # Import the packages
import pandas as pd
import pastas as ps
import numpy as np
import os
import matplotlib.pyplot as plt
ps.show_versions()
ps.set_log_level("ERROR")
"""
Explanation: Example 2: Analysis of groundwater monitoring networks using Pastas
This notebook is supplementary material to the following paper s... |
mdpiper/dakota-tutorial | notebooks/3-Python.ipynb | mit | %pylab inline
"""
Explanation: <img src="images/csdms_logo.jpg">
Example 3
Use the CSDMS Dakota interface in Python to perform a centered parameter study on HydroTrend and evaluate the output.
Use pylab magic:
End of explanation
"""
import os
import shutil
"""
Explanation: And include other necessary imports:
End o... |
franzpl/StableGrid | jupyter_notebooks/mains_frequency_measurement_one_day.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
data = np.genfromtxt('frequency_data.txt')
frequency_data = data[:, 0]
hour = data[:, 1]
%pylab inline
pylab.rcParams['figure.figsize'] = (15, 10)
fig, ax = plt.subplots()
plt.title("Frequency characteristic 16/06/2... |
Kreiswolke/gensim | docs/notebooks/doc2vec-IMDB.ipynb | lgpl-2.1 | import locale
import glob
import os.path
import requests
import tarfile
import sys
import codecs
dirname = 'aclImdb'
filename = 'aclImdb_v1.tar.gz'
locale.setlocale(locale.LC_ALL, 'C')
if sys.version > '3':
control_chars = [chr(0x85)]
else:
control_chars = [unichr(0x85)]
# Convert text to lower-case and stri... |
deepmind/dm_pix | examples/image_augmentation.ipynb | apache-2.0 | %%capture
!pip install dm-pix
!git clone https://github.com/deepmind/dm_pix.git
import dm_pix as pix
import jax.numpy as jnp
import numpy as np
import PIL.Image as pil
from jax import random
IMAGE_PATH = '/content/dm_pix/examples/assets/jax_logo.jpg'
# Helper functions to read images and display them
def get_image(... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160601수_11일차_데이터 전처리 Data Preprocessing, (결정론적)선형 회귀 분석 Linear Regression Analysis/2.회귀 분석용 가상 데이터 생성 방법.ipynb | mit | from sklearn.datasets import make_regression
X, y, c = make_regression(n_samples=10, n_features=1, bias=0, noise=0, coef=True, random_state=0)
print("X\n", X)
print("y\n", y)
print("c\n", c)
plt.scatter(X, y, s=100)
plt.show()
"""
Explanation: 회귀 분석용 가상 데이터 생성 방법
Scikit-learn 의 datasets 서브 패키지에는 회귀 분석 시험용 가상 데이터를 생성하... |
willettk/insight | notebooks/Kyle_Willett_BenignOrNot.ipynb | apache-2.0 | # Load some basic plotting and data analysis packages from Python
%matplotlib inline
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sns;
"""
Explanation: Benign or not?
Predicting the incidence of breast cancer diagnosis using multiple cytological characteristics
Kyle Willett (12 Jul 2016... |
pligor/predicting-future-product-prices | 04_time_series_prediction/.ipynb_checkpoints/07_price_history_varlen_rnn_cells-checkpoint.ipynb | agpl-3.0 | from __future__ import division
import tensorflow as tf
from os import path
import numpy as np
import pandas as pd
import csv
from sklearn.model_selection import StratifiedShuffleSplit
from time import time
from matplotlib import pyplot as plt
import seaborn as sns
from mylibs.jupyter_notebook_helper import show_graph
... |
tensorflow/docs-l10n | site/en-snapshot/lite/guide/model_analyzer.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... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/lifegame.ipynb | apache-2.0 | import sys
try:
import docplex.mp
except:
raise Exception('Please install docplex. See https://pypi.org/project/docplex/')
"""
Explanation: Using logical constraints: Conway's Game of Life
This tutorial includes everything you need to set up decision optimization engines, build a mathematical programming model... |
EnergyID/opengrid | scripts/SynchronizeData.ipynb | gpl-2.0 | import os, sys
import inspect
# Obtain path of the opengrid codebase and import opengrid libraries
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(os.path.join(script_dir, os.pardir, os.pardir))
from opengrid.library import fluksoapi
from opengrid.library import c... |
azhurb/deep-learning | sentiment_network/Sentiment Classification - How to Best Frame a Problem for a Neural Network (Project 4).ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
mbeyeler/opencv-machine-learning | notebooks/09.02-Implementing-a-Multi-Layer-Perceptron-in-OpenCV.ipynb | mit | from sklearn.datasets.samples_generator import make_blobs
X_raw, y_raw = make_blobs(n_samples=100, centers=2,
cluster_std=5.2, random_state=42)
"""
Explanation: <!--BOOK_INFORMATION-->
<a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank... |
huajianmao/learning | coursera/deep-learning/5.nlp-sequence-models/week1/Dinosaurus Island -- Character level language model final - v3.ipynb | mit | import numpy as np
from utils import *
import random
"""
Explanation: Character level language model - Dinosaurus land
Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of... |
kubeflow/code-intelligence | Issue_Embeddings/notebooks/09_LangModel_API_Demo.ipynb | mit | import requests
import json
import numpy as np
from passlib.apps import custom_app_context as pwd_context
API_ENDPOINT = 'https://embeddings.gh-issue-labeler.com/text'
API_KEY = 'YOUR_API_KEY' # Contact maintainers for your api key
"""
Explanation: <h1 align="center">GitHub Issue Embeddings API</h1>
This tutorial sho... |
jtwhite79/pyemu | verification/Freyberg/.ipynb_checkpoints/verify_unc_results-checkpoint.ipynb | bsd-3-clause | %matplotlib inline
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
"""
Explanation: verify pyEMU results with the henry problem
End of explanation
"""
la = pyemu.Schur("freyberg.jcb",verbose=False,forecasts=[])
la.drop_prior_information()
jco_ord = la.jco.get(la.pst.obs_... |
sony/nnabla | tutorial/vat_semi_supervised_learning.ipynb | apache-2.0 | !pip install nnabla-ext-cuda100
!git clone https://github.com/sony/nnabla-examples.git
%cd nnabla-examples
"""
Explanation: Deep learning frequently requires a large amount of labeled data, but in practice, it can be very costly to collect data with labels. Semi-supervised setting has gained attention since it can lev... |
cuttlefishh/papers | red-sea-single-cell-genomes/code/singlecell_tara_heatmap_histogram.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import re
import math
from sys import argv
"""
Explanation: Single-cell Paper: Tara Heatmap and Histogram
Histograms for Proch and Pelag of all gene clusters and those missing in Tara metagenomes
Heatmaps f... |
knub/master-thesis | notebooks/Evaluation Results.ipynb | apache-2.0 | df_tc_results = pnd.DataFrame([
("topic.full.alpha-1-100.256-400.model", 0.469500859375, 0.00617111859067, 0.6463414634146342),
("topic.16-400.model", 0.43805875, 0.00390183951094, 0.5975609756097561),
("topic.256-1000.model", 0.473455351563, 0.00635883046394, 0.5853658536585366),
("topi... |
mne-tools/mne-tools.github.io | 0.19/_downloads/38f243960dd98f9910f9b981f0b54dd0/plot_fdr_stats_evoked.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
from mne.stats import bonferroni_correction, fdr_correction
print(__doc__)
"""
Explanation:... |
geekandtechgirls/Women-In-Django | Soluciones.ipynb | gpl-3.0 | x1 = int(input("Introduce un número: "))
x2 = int(input("Y ahora otro: "))
x = (20 * x1 - x2)/(x2 + 3)
print("x =",x)
"""
Explanation: Soluciones a los ejercicios propuestos
Nivel básico
1.
Haz un pequeño programa que le pida al usuario introducir dos números ($x_1$ y $x_2$), calcule la siguiente operación y muestre ... |
wtgme/labeldoc2vec | docs/notebooks/doc2vec-wikipedia.ipynb | lgpl-2.1 | from gensim.corpora.wikicorpus import WikiCorpus
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from pprint import pprint
import multiprocessing
"""
Explanation: Doc2Vec to wikipedia articles
We conduct the replication to Document Embedding with Paragraph Vectors (http://arxiv.org/abs/1507.07998).
In this p... |
SSDS-Croatia/SSDS-2017 | Day-3/3_SSDS_2017_CharLSTMs.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
import random
tf.logging.set_verbosity(tf.logging.ERROR)
"""
Explanation: Data Science Summer School - Split '17
Prerequisites: Please download the following zip archive which contains checkpoint you will need in this exercise ... |
takanory/python-machine-learning | Chapter05.ipynb | mit | from IPython.core.display import display
from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
import pandas as pd
# http://archive.ics.uci.edu/ml/datasets/Wine
df_wine = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data', header=Non... |
jiaphuan/models | research/deeplab/deeplab_demo.ipynb | apache-2.0 | import collections
import os
import StringIO
import sys
import tarfile
import tempfile
import urllib
from IPython import display
from ipywidgets import interact
from ipywidgets import interactive
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
from PIL import Image
import tenso... |
cdt15/lingam | examples/CausalEffect(LightGBM).ipynb | mit | import numpy as np
import pandas as pd
import graphviz
import lingam
print([np.__version__, pd.__version__, graphviz.__version__, lingam.__version__])
np.set_printoptions(precision=3, suppress=True)
np.random.seed(0)
"""
Explanation: Causal Effect for Non-linear Regression
Import and settings
In this example, we nee... |
santoshphilip/eppy | docs/Main_Tutorial.ipynb | mit | # you would normaly install eppy by doing
# python setup.py install
# or
# pip install eppy
# or
# easy_install eppy
# if you have not done so, uncomment the following three lines
import sys
# pathnameto_eppy = 'c:/eppy'
pathnameto_eppy = '../'
sys.path.append(pathnameto_eppy)
from eppy import modeleditor
from eppy... |
phoebe-project/phoebe2-docs | 2.1/tutorials/optimizing.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
import phoebe
b = phoebe.default_binary()
"""
Explanation: Advanced: Optimizing Performance with PHOEBE
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update ... |
phoebe-project/phoebe2-docs | 2.1/examples/binary_spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Binary with Spots
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 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
"""
%matplotlib inline
im... |
msanterre/deep_learning | 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... |
5hubh4m/CS231n | Assignment1/features.ipynb | mit | import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading extenrnal modu... |
jakeret/abcpmc | notebooks/2d_gauss.ipynb | gpl-3.0 | samples_size = 1000
sigma = np.eye(2) * 0.25
means = [1.1, 1.5]
data = np.random.multivariate_normal(means, sigma, samples_size)
matshow(sigma)
title("covariance matrix sigma")
colorbar()
"""
Explanation: ABC PMC on a 2D gaussian example
In this example we're looking at a dataset that has been drawn from a 2D gaussia... |
SheffieldML/notebook | compbio/periodic/figure2.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
import GPy
np.random.seed(1)
"""
Explanation: Supplementary materials : Details on generating Figure 2
This document is a supplementary material of the article Detecting periodicities with Gaussian
processes by N. Durrande, J. Hensman, M. Ratt... |
machinelearningnanodegree/stanford-cs231 | solutions/levin/assignment2/BatchNormalization.ipynb | mit | # As usual, a bit of setup
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradi... |
emredjan/emredjan.github.io | code/plot_normal.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn') # pretty matplotlib plots
plt.rcParams['figure.figsize'] = (12, 8)
"""
Explanation: Plotting Any Kind of Distribution with matplotlib and scipy
It's important to plot distributions of variables when doing exploratory analy... |
mne-tools/mne-tools.github.io | 0.19/_downloads/963786e591fc03946ca0f3b819f12772/plot_xdawn_denoising.ipynb | bsd-3-clause | # Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
from mne import (io, compute_raw_covariance, read_events, pick_types, Epochs)
from mne.datasets import sample
from mne.preprocessing import Xdawn
from mne.viz import plot_epochs_image
print(__doc__)
data_path = sample.data_pa... |
kaphka/ml-software | create_data.ipynb | apache-2.0 | def xor(X):
if not ft.reduce(lambda old, new: old == new,X >= 0):
return 1
else:
return 0
x_train = np.array([(np.random.random_sample(5000) - 0.5) * 2 for dim in range(2)]).transpose()
x_test = np.array([(np.random.random_sample(100) - 0.5) * 2 for dim in range(2)]).transpose()
y_train ... |
ebonnassieux/fundamentals_of_interferometry | 3_Positional_Astronomy/3_3_horizontal_coordinates.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
Positional Astronomy
Previous: 3.2 Hour Angle (HA) and Local Sidereal Time (LST)
Next: 3.4 Direction Cosine Coordinates ($l,m,n$)
... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/ukesm1-0-mmh/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-mmh', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MOHC
Source ID: UKESM1-0-MMH
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy... |
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/sandbox-1/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-1', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: SANDBOX-1
Topic: Aerosol
Sub-Topics: Transport, Emissi... |
jrieke/machine-intelligence-2 | sheet06/sheet05.ipynb | mit | from __future__ import division, print_function
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import scipy.io.wavfile
sig = np.loadtxt("sound1.dat")
# sound1 = np.asarray((2**16)*sig/(max(sig)-min(sig)), np.int16)
sound1 = sig
scipy.io.wavfile.write("sound1_orig.wav", 8192, ... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_automl_tabular_forecasting_batch.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: AutoML training tabular forecasting model for batch prediction
<table align="left">... |
tensorflow/gan | tensorflow_gan/examples/esrgan/colab_notebooks/ESRGAN_TPU.ipynb | apache-2.0 | import os
import tensorflow.compat.v1 as tf
import pprint
assert 'COLAB_TPU_ADDR' in os.environ, 'Did you forget to switch to TPU?'
tpu_address = 'grpc://' + os.environ['COLAB_TPU_ADDR']
with tf.Session(tpu_address) as sess:
devices = sess.list_devices()
pprint.pprint(devices)
device_is_tpu = [True if 'TPU' in str(x... |
dsevilla/bdge | hbase/sesion6.ipynb | mit | from pprint import pprint as pp
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
%matplotlib inline
matplotlib.style.use('ggplot')
"""
Explanation: NoSQL (HBase) (sesión 6)
Esta hoja muestra cómo acceder a bases de datos HBase y también a conectar la salida con Jupyter.
Se puede utilizar el shel... |
statsmodels/statsmodels.github.io | v0.13.0/examples/notebooks/generated/statespace_sarimax_internet.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
import requests
from io import BytesIO
from zipfile import ZipFile
# Download the dataset
dk = requests.get('http://www.ssfpack.com/files/DK-data.zip').content
f = Bytes... |
poppy-project/pypot | samples/notebooks/Benchmark your Poppy robot.ipynb | gpl-3.0 | from ipywidgets import interact
%pylab inline
"""
Explanation: Benchmark your Poppy robot
The goal of this notebook is to help you identify the performance of your robot and where the bottle necks are. We will measure:
* the time to read/write the position to one motor (for each of your dynamixel bus)
* the time to r... |
lyoung13/deep-learning-nanodegree | p3-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... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/fraud_detection_with_tensorflow_bigquery.ipynb | apache-2.0 | import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.layers as layers
from tensorflow_io.bigquery import BigQueryClient
import functools
"""
Explanation: Building a Fraud Detection model on Vertex AI with TensorFlow Enterprise and BigQuery
Learning objectives
Analyze the data in BigQuery... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/image_classification/labs/5_fashion_mnist_class.ipynb | apache-2.0 | # TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
"""
Explanation: Train a Neural Network Model to Classify Images
Learning Objectives
Pre-process image data
Build, compile, and train a neural ne... |
fonnesbeck/ngcm_pandas_2016 | notebooks/1.3 Data Manipulation with Pandas.ipynb | cc0-1.0 | import pandas as pd
pd.set_option('max_rows', 10)
"""
Explanation: Data Manipulation with Pandas
End of explanation
"""
c = pd.Categorical(['a', 'b', 'b', 'c', 'a', 'b', 'a', 'a', 'a', 'a'])
c
c.describe()
c.codes
c.categories
"""
Explanation: Categorical Types
Pandas provides a convenient dtype for reprsentin... |
softctrl/nd101-tv-script-generation | dlnd_tv_script_generation.ipynb | agpl-3.0 | """
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... |
dilipbobby/DataScience | Numpy/numpyclass.ipynb | apache-2.0 | import numpy as np
import numpy.matlib
"""
Explanation: cs-1
Numpy
Topics:
Intro to numpy,
Ndarray Object,
Eg Array creation,
Array Attributes
Numpy:
NumPy is the fundamental package needed for scientific computing with Python. It contains:
a powerful N-dimensional array object
basic linear algebra functions
basic ... |
magenta/ddsp | ddsp/colab/demos/train_autoencoder.ipynb | apache-2.0 | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Phosphorylation Sequence Tests -Bagging -dbptm+ELM-checkpoint.ipynb | mit | from pred import Predictor
from pred import sequence_vector
from pred import chemical_vector
"""
Explanation: Template for test
End of explanation
"""
par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"]
for i in par:
print("y", i)
y = Predictor()
y.load_data(file="Data/Trainin... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day20-monte-carlo-integration/MonteCarlo_Integration.ipynb | agpl-3.0 | # Put your code here!
"""
Explanation: A New Hope (for integrating functions)
Names of group members
// put your names here!
Goals of this assignment
The main goal of this assignment is to use https://en.wikipedia.org/wiki/Monte_Carlo_integration - a technique for numerical integration that uses random numbers to c... |
jmhsi/justin_tinker | data_science/lendingclub_bak/dataprep_and_modeling/0.2.1_investigate_min_score_to_use_for_selection.ipynb | apache-2.0 | import modeling_utils.data_prep as data_prep
from sklearn.externals import joblib
import time
platform = 'lendingclub'
store = pd.HDFStore(
'/Users/justinhsi/justin_tinkering/data_science/lendingclub/{0}_store.h5'.
format(platform),
append=True)
"""
Explanation: If I plan to run the scorer every batch to... |
AtmaMani/pyChakras | faas/sam-try/try-sam-ml/training.ipynb | mit | # Install required dependencies
! pip install -q torch==1.8.0 torchvision==0.9.0
# Torchvision provides an easy way to import MNIST dataset into DataLoaders
import torch
import torchvision
from torchvision.transforms import ToTensor
# mini-batch size when training and testing
mini_batch_size = 64
train_loader = to... |
ProfessorKazarinoff/staticsite | content/code/sympy/sympy_solving_equations.ipynb | gpl-3.0 | from sympy import symbols, nonlinsolve
"""
Explanation: Sympy is a Python package used for solving equations using symbolic math.
Let's solve the following problem with SymPy.
Given:
The density of two different polymer samples $\rho_1$ and $\rho_2$ are measured.
$$ \rho_1 = 1.408 \ g/cm^3 $$
$$ \rho_2 = 1.343 \ g/... |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/10 Case Study - Titanic Survival.ipynb | apache-2.0 | from sklearn.datasets import load_iris
iris = load_iris()
print(iris.data.shape)
"""
Explanation: SciPy 2016 Scikit-learn Tutorial
Case Study - Titanic Survival
Feature Extraction
Here we will talk about an important piece of machine learning: the extraction of
quantitative features from data. By the end of this se... |
transcranial/keras-js | notebooks/layers/convolutional/Cropping2D.ipynb | mit | data_in_shape = (3, 5, 4)
L = Cropping2D(cropping=((1,1),(1, 1)), 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(250)
data_in = 2 * np.random.random(data_in_shap... |
gfabieno/SeisCL | docs/notebooks/examples/2004_BP_velocity_model.ipynb | gpl-3.0 | from urllib.request import urlretrieve
import gzip
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate as intp
from mpl_toolkits.axes_grid1 import make_axes_locatable
import math
from SeisCL import SeisCL
%matplotlib inline
from IPython.core.pylabtools import figsize
figsize(8, 5... |
dacostaortiz/Modelado-Matematico | Homework01/01 - First approach.ipynb | mit | import os
import numpy as np
path = "/data/"
def read_dir(path, ext):
l = []
for f in os.listdir(os.getcwd()+path):
if f.endswith(ext):
r = open(os.getcwd()+path+f).read()
r = np.array(r[:-1].split())
l.append({f:r})
return l
"""
Explanation: Chapter 1 - Modell... |
keras-team/autokeras | docs/ipynb/timeseries_forecaster.ipynb | apache-2.0 | dataset = tf.keras.utils.get_file(
fname="AirQualityUCI.csv",
origin="https://archive.ics.uci.edu/ml/machine-learning-databases/00360/"
"AirQualityUCI.zip",
extract=True,
)
dataset = pd.read_csv(dataset, sep=";")
dataset = dataset[dataset.columns[:-2]]
dataset = dataset.dropna()
dataset = dataset.repla... |
ES-DOC/esdoc-jupyterhub | notebooks/mri/cmip6/models/mri-esm2-0/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mri', 'mri-esm2-0', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MRI
Source ID: MRI-ESM2-0
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
jkeung/yellowbrick | examples/rank2d.ipynb | apache-2.0 | # Imports
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from collections import OrderedDict
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import Imputer
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error a... |
sujitpal/intro-dl-talk-code | src/06-redrum-mt-lstm.ipynb | unlicense | from __future__ import division, print_function
from keras.layers.core import Activation, Dense, RepeatVector
from keras.layers.recurrent import LSTM
from keras.layers.wrappers import TimeDistributed
from keras.models import Sequential
from sklearn.cross_validation import train_test_split
import nltk
import numpy as np... |
materialsvirtuallab/ceng114 | lectures/Lecture 12 - Statistics.ipynb | bsd-2-clause | from __future__ import division
import matplotlib.pyplot as plt
import matplotlib as mpl
import palettable
import numpy as np
import math
import seaborn as sns
from collections import defaultdict
%matplotlib inline
# Here, we customize the various matplotlib parameters for font sizes and define a color scheme.
# As ... |
testedminds/sand | docs/Loading network data.ipynb | apache-2.0 | import sand
"""
Explanation: Loading network data
CSV -> List of Dictionaries -> igraph
sand's underlying graph implementation is igraph. igraph offers several ways to load data, but sand provides a few convenience functions that simplify the workflow:
End of explanation
"""
edgelist_file = './data/lein-topology-57a... |
rachellevanger/tda-persistence-explorer | doc/superlevel_filtration_stitch_with_rips.ipynb | mit | import PersistenceExplorer as PE
import os
from scipy import misc
from skimage import morphology as morph
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Superlevel set filtration with stitching to Vietoris-Rips-type filtration
This notebook takes in an... |
machine-learning-colombia/examples | notebooks/deep-learning-udacity/1_notmnist.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.line... |
navoj/ecell4 | ipynb/Tutorials/Spatiocyte.ipynb | gpl-2.0 | from ecell4 import *
with species_attributes():
A | B | C | {'D': '1'}
with reaction_rules():
A + B == C | (0.01, 0.3)
m = get_model()
w = lattice.LatticeWorld(Real3(1, 1, 1), 0.005) # The second argument is 'voxel_radius'.
w.bind_to(m)
w.add_molecules(Species('C'), 60)
sim = lattice.LatticeSimulator(w)
obs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.