repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ProfessorKazarinoff/staticsite | content/code/matplotlib_plots/bar_plot_with_statistics_module_and_matplotlib.ipynb | gpl-3.0 | # import packages
from statistics import mean, stdev
import matplotlib.pyplot as plt
#include if using a jupyter notebook, remove if using a .py file
%matplotlib inline
"""
Explanation: Engineers collect data and make conclusions based on the results. An important way to view results is with statistica... |
ivannz/study_notes | year_14_15/spring_2015/netwrok_analysis/notebooks/assignments/networks_ha_final.ipynb | mit | G = nx.read_gml( path =
"./data/ha5/huge_100004196072232_2015_03_24_11_20_1d58b0ecdf7713656ebbf1a177e81fab.gml", relabel = False )
"""
Explanation: ToDo
Your Network Summary
Network source and preprocessing
Node/Edge attributes
Size, Order
Gorgeous network layout. Try to show that your network has some structure, ... |
google/jax | docs/jax-101/07-state.ipynb | apache-2.0 | import jax
import jax.numpy as jnp
class Counter:
"""A simple counter."""
def __init__(self):
self.n = 0
def count(self) -> int:
"""Increments the counter and returns the new value."""
self.n += 1
return self.n
def reset(self):
"""Resets the counter to zero."""
self.n = 0
counter =... |
rolando/scrapydo | notebooks/scrapydo-overview.ipynb | mit | import scrapydo
scrapydo.setup()
"""
Explanation: ScrapyDo Overview
ScrapyDo is a crochet-based blocking API for Scrapy. It allows the usage of Scrapy as a library, mainly aimed to be used in spiders prototyping and data exploration in IPython notebooks.
In this notebook we are going to show how to use scrapydo and ho... |
mediagestalt/Adding-Context | Adding Context to Word Frequency Counts.ipynb | mit | # This is where the modules are imported
import nltk
from os import listdir
from os.path import splitext
from os.path import basename
from tabulate import tabulate
# These functions iterate through the directory and create a list of filenames
def list_textfiles(directory):
"Return a list of filenames ending in '... |
dataspecialiste/sagacite | DSE220x-MLFundamentals/Week-1/NN_spine/Nearest_neighbor_spine.ipynb | mit | import numpy as np
"""
Explanation: Nearest neighbor for spine injury classification
In this homework notebook we use nearest neighbor classification to classify back injuries for patients in a hospital, based on measurements of the shape and orientation of their pelvis and spine.
The data set contains information fro... |
gshguru/uwseds | Homework1/analysis/Homework1 - Analysis.ipynb | mit | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn
seaborn.set()
matplotlib.rcParams['figure.figsize'] = (15, 8)
import numpy as np
import pandas as pd
data = pd.read_csv("../data/4xy5-26gy.csv", parse_dates=['date'], index_col=['date'])
data.head()
"""
Explanation: Homework 1: Dat... |
kfollette/AST337-Fall2017 | Labs/Lab10/Lab10.ipynb | mit | # The standard fare, plus a few extra packages:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import astropy.io.fits as fits
import os.path
%matplotlib inline
# Newer packages:
from astropy.stats import mad_std
from astropy.stats import sigma_clip
from photutils.utils import calc_total_error
i... |
hunterherrin/phys202-2015-work | assignments/midterm/AlgorithmsEx03.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact
"""
Explanation: Algorithms Exercise 3
Imports
End of explanation
"""
o='ahjshd'
list(o)
x,y=letter_prob(list(o))
dict(zip(x,y))
def letter_prob(data):
letter_dictionary={}
for i in data:
... |
TakayukiSakai/tensorflow | tensorflow/examples/udacity/3_regularization.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
"""
Explanation: Deep Learning
Assignment 3
Previously in 2_fullyconnected.ipynb, you tra... |
DTOcean/dtocean-core | notebooks/DTOcean Installation Module Example.ipynb | gpl-3.0 | %matplotlib inline
from IPython.display import display, HTML
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (14.0, 8.0)
import numpy as np
from dtocean_core import start_logging
from dtocean_core.core import Core
from dtocean_core.menu import ModuleMenu, ProjectMenu, ThemeMenu
from dtocean_core.pi... |
evangelistalab/forte | tutorials/Tutorial_01.03_forte_sparse.ipynb | lgpl-3.0 | import math
import forte
from IPython.display import display, Math, Latex
def latex(obj):
"""Call the latex() function on an object and display the returned value in LaTeX"""
display(Math(obj.latex()))
"""
Explanation: Forte Tutorial 1.03: Forte's sparse operator class
Forte exposes several functions to crea... |
utds/workshops | workshop_1/Speed_Dating_EDA.ipynb | mit | #First let's import the necessary modules
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import os
from IPython.display import display, HTML
pd.set_option('display.max_columns', 500)
#Specifying the Data Path
cwd = os.getcwd()
file_path = os.path.join(cwd, 'cleaned_speed_d... |
rgerkin/sciunit | docs/chapter2.ipynb | mit | import sciunit
"""
Explanation: SciUnit is a framework for validating scientific models by creating experimental-data-driven unit tests.
Chapter 2. Writing a model and test in SciUnit from scratch
(or back to Chapter 1)
End of explanation
"""
class ProducesNumber(sciunit.Capability):
"""An example capability for... |
mne-tools/mne-tools.github.io | 0.22/_downloads/f5772cd483591ac49331a1b66e9b292b/plot_fix_bem_in_blender.ipynb | bsd-3-clause | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Ezequiel Mikulan <e.mikulan@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import shutil
import mne
data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
bem_dir = op.join(subjects_dir, 'sample'... |
klavinslab/coral | docs/tutorial/sequences.ipynb | mit | import coral as cor
"""
Explanation: Sequences
sequence.DNA
coral.DNA is the core data structure of coral. If you are already familiar with core python data structures, it mostly acts like a container similar to lists or strings, but also provides further object-oriented methods for DNA-specific tasks, like reverse co... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/text_classification/solutions/rnn_encoder_decoder.ipynb | apache-2.0 | pip freeze | grep nltk || pip install nltk
import os
import pickle
import sys
import nltk
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.keras.layers import (
Dense,
Embedding,
GRU,
Input,
)
from tensorflow.keras.mode... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/notebooks/lectures/Leverage/notebook.ipynb | unlicense | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from __future__ import division
capital_base = 100000
r_p = 0.05 # Aggregate performance of assets in the portfolio
r_no_lvg = capital_base * r_p
print 'Portfolio returns without leverage: {0}'.format(r_no_lvg)
"""
Explanation: Leverage
by Maxwel... |
theandygross/HIV_Methylation | Benchmarks/Cell_Composition_Bechmark.ipynb | mit | import os
if os.getcwd().endswith('Benchmarks'):
os.chdir('..')
"""
Explanation: Exploration of Cell Composition
We know that cell composition is a key confounder when looking at changes in the methylome and how they relate to HIV infected patients. It is well understood that individuals with HIV have lower CD4 c... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcin... |
tpin3694/tpin3694.github.io | python/how_to_use_default_dicts.ipynb | mit | import collections
"""
Explanation: Title: How To Use Default Dicts
Slug: how_to_use_default_dicts
Summary: How To Use Default Dicts in Python.
Date: 2016-01-23 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Interesting in learning more? Check out Fluent Python
Preliminaries
End of explanation
"""
# ... |
ChadFulton/statsmodels | examples/notebooks/regression_plots.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function
from statsmodels.compat import lzip
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import ols
"""
Explanation: Regression Plots
End of explanation
"""
prestige = sm.datasets.get... |
GoogleCloudDataproc/spark-bigquery-connector | examples/notebooks/Distribute_Generic_Functions.ipynb | apache-2.0 | %reload_ext google.cloud.bigquery
%%bigquery pd_results --use_bqstorage_api
SELECT original_url, title
FROM `bigquery-public-data.open_images.images`
WHERE license = 'https://creativecommons.org/licenses/by/2.0/'
LIMIT 10
#review what our image database contains.
import pandas as pd
pd.set_option('display.max_c... |
radhikapc/foundation-homework | homework05/Homework05_Spotify_radhika_graded.ipynb | mit | import requests
Lil_response = requests.get('https://api.spotify.com/v1/search?query=Lil&type=artist&limit=50&country=US')
Lil_data = Lil_response.json()
#Lil_data
Lil_data.keys()
Lil_data['artists'].keys()
Lil_artists = Lil_data['artists']['items']
"""
Explanation: Grade: 6 / 8 -- check for TA-COMMENTS
End of e... |
ZwickyTransientFacility/simsurvey-examples | skymap_demo.ipynb | bsd-3-clause | import os
home_dir = os.getcwd()
# Please enter the path to where you have placed the Schlegel, Finkbeiner & Davis (1998) dust map files
# You can also set the environment variable SFD_DIR to this path (in that case the variable below should be None)
sfd98_dir = os.path.join(home_dir, 'data/sfd98')
import simsurvey
i... |
phoebe-project/phoebe2-docs | 2.3/tutorials/beaming_boosting.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Beaming and Boosting
Due to concerns about accuracy, support for Beaming & Boosting has been disabled as of the 2.2 release of PHOEBE (although we hope to bring it back in a future release).
It may come as surprise that support for Doppler boosting has been dropped ... |
kerimlcr/ab2017-dpyo | ornek/osmnx/osmnx-0.3/examples/08-example-line-graph.ipynb | gpl-3.0 | import osmnx as ox, networkx as nx, matplotlib.cm as cm, matplotlib.colors as colors
%matplotlib inline
ox.config(log_console=True, use_cache=True)
"""
Explanation: Street network analysis when a street is a node
In some traditions of street network research, street becomes a node. The edges are connected when these s... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_channel_epochs_image.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Visualize channel over epochs as an ima... |
mbakker7/ttim | notebooks/ttim_slugtest.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fmin
import pandas as pd
from ttim import *
# problem definitions
rw = 0.125 # well radius
rc = 0.064 # well casing radius
L = 1.52 # screen length
zbot = -47.87 # aquifer thickness
welltop = -16.77 # top of screen
del... |
OceanPARCELS/parcels | parcels/examples/tutorial_Agulhasparticles.ipynb | mit | from parcels import FieldSet, ParticleSet, JITParticle, AdvectionRK4, ErrorCode
from datetime import timedelta
import numpy as np
"""
Explanation: Tutorial showing how to create Parcels in Agulhas animated gif
This brief tutorial shows how to recreate the animated gif showing particles in the Agulhas region south of A... |
robertoalotufo/ia898 | src/pconv.ipynb | mit | def pconv(f,h):
import numpy as np
h_ind=np.nonzero(h)
f_ind=np.nonzero(f)
if len(h_ind[0])>len(f_ind[0]):
h, f = f, h
h_ind,f_ind= f_ind,h_ind
gs = np.maximum(np.array(f.shape),np.array(h.shape))
if (f.dtype == 'complex') or (h.dtype == 'complex'):
g = np.zero... |
google-aai/sc17 | cats/nn_demo_part2.ipynb | apache-2.0 | import numpy as np
# Set up the data and network:
n_outputs = 5 # We're attempting to learn XOR in this example, so our inputs and outputs will be the same.
n_hidden_units = 10 # We'll use a single hidden layer with this number of hidden units in it.
n_obs = 500 # How many observations of the XOR input to output ve... |
miaecle/deepchem | examples/tutorials/19_Large_Scale_Chemical_Screens.ipynb | mit | from deepchem.molnet.load_function import hiv_datasets
from deepchem.models import GraphConvModel
from deepchem.data import NumpyDataset
from sklearn.metrics import average_precision_score
import numpy as np
tasks, all_datasets, transformers = hiv_datasets.load_hiv(featurizer="GraphConv")
train, valid, test = [NumpyD... |
jseabold/statsmodels | examples/notebooks/tsa_arma_0.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.graphics.api import qqplot
"""
Explanation: Autoregressive Moving Average (ARMA): Sunspots data
End of explana... |
ES-DOC/esdoc-jupyterhub | notebooks/inpe/cmip6/models/besm-2-7/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inpe', 'besm-2-7', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: INPE
Source ID: BESM-2-7
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbulen... |
meli-lewis/rp_hajcak-foti | RP_Hajcak_Foti.ipynb | mit | data = pd.read_csv("rp.csv")
qgrid.show_grid(data, remote_js=True)
# subset trials depending on whether participant made an error,
# made an error in the previous trial ('predict'), or
# was correct in current and previous trial ('unpred')
error_trials = data[data['startle_type'] == 'error']
pred_trials = data[data['... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-3/cmip6/models/sandbox-3/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-3', 'sandbox-3', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: TEST-INSTITUTE-3
Source ID: SANDBOX-3
Topic: Aerosol
Sub-Topics: Tra... |
natashabatalha/PandExo | notebooks/JWST_Analyzing_Pandexo.ipynb | gpl-3.0 | #load in output from run
out = pk.load(open('singlerun.p','rb'))
#for a single run
x,y, e = jpi.jwst_1d_spec(out, R=100, num_tran=1, model=False, x_range=[1,12])
"""
Explanation: Plot 1D Data with Errorbars
Multiple plotting options exist within jwst_1d_spec
1. Plot a single run
End of explanation
"""
#load in outp... |
jswoboda/GeoDataPython | Examples/MadrigalExample1.ipynb | mit | %matplotlib inline
import matplotlib
import os
import scipy as sp
import matplotlib.pyplot as plt
from GeoData.GeoData import GeoData
from GeoData.utilityfuncs import readMad_hdf5
from GeoData.plotting import rangevsparam, rangevstime
"""
Explanation: Using GeoData With Madgrigal
This notebook will give an example of ... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/statespace_cycles.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
from pandas_datareader.data import DataReader
endog = DataReader('UNRATE', 'fred', start='1954-01-01')
endog.index.freq = endog.index.inferred_freq
"""
Explanation: Trends and cycles in unemployment... |
ethen8181/machine-learning | model_selection/imbalanced/imbalanced_metrics.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(plot_style=False)
os.chdir(path)
# 1. magic for inline plot
# 2. magic to print vers... |
willsa14/ras2las | curvefit/CNN_log-data_extraction.ipynb | mit | import pylab as plt
# %matplotlib inline
import numpy as np
"""
Explanation: Using CNN to extract data from plots
We'll start by making synthetic images of plots that look like "real" log plots
Train a 5-6 layer CNN using Keras
Return 20 inferred points from the RGB image fed. (the idea is to segment the log in chun... |
tensorflow/docs-l10n | site/zh-cn/tfx/tutorials/data_validation/tfdv_basic.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... |
bbfamily/abu | abupy_lecture/30-趋势跟踪与均值回复的长短线搭配.ipynb | gpl-3.0 | # 基础库导入
from __future__ import print_function
from __future__ import division
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import os
import sys
# 使用insert 0即只使用github,避免交叉使用了pip安装的abupy,导致的... |
kpolimis/paa_2017_social_media | Estimate_Facebook_Audience/notebooks/facebook_demographic_research.ipynb | mit | # uncomment the line below to view the functions in utils.py
#% cat utils.py
import os
import re
import sys
import csv
import json
import glob
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
from collections import OrderedDict
from pysocialwatcher import watcherAP... |
astarostin/MachineLearningSpecializationCoursera | course4/week2 - Двухвыборочные непараметрические критерии (связанные выборки) - demo.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import itertools
from scipy import stats
from statsmodels.stats.descriptivestats import sign_test
from statsmodels.stats.weightstats import zconfint
%pylab inline
"""
Explanation: Непараметрические критерии
Критерий | Одновыборочный | Двухвыборочный | Двухвыборочный (связанные ... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_metadata_epochs.ipynb | bsd-3-clause | # Authors: Chris Holdgraf <choldgraf@gmail.com>
# Jona Sassenhagen <jona.sassenhagen@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import mne
import numpy as np
import matplotlib.pyplot as plt
# Load the data from the internet
path = mne.datasets.kiloword.data_path() ... |
softEcon/course | lectures/basics/version_control/lecture.ipynb | mit | import os
try:
os.mkdir('me')
except OSError:
pass
os.chdir('me')
"""
Explanation: Version Control and Error Tracking
This tutorial is an showcasing the material collected in the Pro Git book which is avilable for free online. I also draw on a set of excellent Scientific Python Lecture Notes ... |
uber/pyro | tutorial/source/air.ipynb | apache-2.0 | %pylab inline
import os
from collections import namedtuple
import pyro
import pyro.optim as optim
from pyro.infer import SVI, TraceGraph_ELBO
import pyro.distributions as dist
import pyro.poutine as poutine
import pyro.contrib.examples.multi_mnist as multi_mnist
import torch
import torch.nn as nn
from torch.nn.function... |
abevieiramota/data-science-cookbook | 2016/naive-bayes/NaiveBayesAlgorithm.ipynb | mit | from collections import defaultdict
from functools import reduce
import math
class NaiveBayes:
def __init__(self):
self.freqFeature = defaultdict(int)
self.freqLabel = defaultdict(int)
# condFreqFeature[label][feature]
self.condFreqFeature = defaultdict(lambda: defaultdict(int))
... |
jameshensman/GPclust | notebooks/OMGP_demo.ipynb | gpl-3.0 | %matplotlib inline
import GPy
from GPclust import OMGP
import matplotlib
matplotlib.rcParams['figure.figsize'] = (12,6)
from matplotlib import pyplot as plt
"""
Explanation: Overlapping Mixtures of Gaussian Processses
Valentine Svensson 2015 <br> (with small edits by James Hensman November 2015)
This illustrates use o... |
google/jax-md | notebooks/npt_simulation.ipynb | apache-2.0 | %%capture
#@title Imports & Utils
!pip install jax-md
import numpy as onp
from jax.config import config ; config.update('jax_enable_x64', True)
import jax.numpy as np
from jax import random
from jax import jit
from jax import lax
from jax import ops
import time
from jax_md import space, smap, energy, minimize, qua... |
NazBen/impact-of-dependence | examples/archive/grid-search-Copy1.ipynb | mit | import openturns as ot
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
random_state = 123
np.random.seed(random_state)
"""
Explanation: Conservative Estimation using a Grid Seach Minimization
This notebook illustrates the different steps ... |
nerdcommander/scientific_computing_2017 | lesson18/Lesson18_team.ipynb | mit | import time
time.time()
"""
Explanation: Unit 3: Simulation
Lesson 18: Non-uniform distributions
Notebook Authors
(fill in your two names here)
Facilitator: (fill in name)
Spokesperson: (fill in name)
Process Analyst: (fill in name)
Quality Control: (fill in name)
If there are only three people in your group, have ... |
boffi/boffi.github.io | dati_2015/ha03/02_Isolation.ipynb | mit | from math import atan2, cos, exp, pi, sin, sqrt, tan
def plvu(label, value, units=""):
print("%40s: %10g %s"%(label, value, units))
"""
Explanation: Vibration Isolation
Preliminaries
We have to import the mathematical functions that will be used in the following. Also, we want to define a helper function to prope... |
tensorflow/docs-l10n | site/zh-cn/lattice/tutorials/premade_models.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... |
icoxfog417/number_recognizer | machines/number_recognizer/number_recognizer.ipynb | mit | # グラフが文章中に表示されるようにするおまじない
%matplotlib inline
"""
Explanation: Number Recognizer
今回は、ブラウザ上に書いた手書きの数字を認識させます。具体的には、canvasに書かれた数字が0~9のどれであるかを当てさせます。
その予測を行うためのモデルを、以下のステップに沿って作成していきます。
データロード
モデル構築
学習
評価
保存
End of explanation
"""
def load_data():
from sklearn import datasets
dataset = datasets.load_digits()
... |
grantvk/aima-python | rl.ipynb | mit | from rl import *
"""
Explanation: Reinforcement Learning
This IPy notebook acts as supporting material for Chapter 21 Reinforcement Learning of the book Artificial Intelligence: A Modern Approach. This notebook makes use of the implementations in rl.py module. We also make use of implementation of MDPs in the mdp.py m... |
dsbrown1331/CoRL2019-DREX | drex-mujoco/learner/baselines/docs/viz/viz.ipynb | mit | !pip install git+https://github.com/openai/baselines > ~/pip_install_baselines.log
"""
Explanation: Loading and visualizing results (open in colab)
In order to compare performance of algorithms, we often would like to visualize learning curves (reward as a function of time steps), or some other auxiliary information a... |
dandtaylor/MetroShare | bike_station_locations.ipynb | mit | import pickle
import xml.etree.ElementTree as ET
import urllib.request
"""
Explanation: Import and save locations of bikeshare stations
End of explanation
"""
xml_path = 'https://feeds.capitalbikeshare.com/stations/stations.xml'
tree = ET.parse(urllib.request.urlopen(xml_path))
root = tree.getroot()
"""
Explanation... |
Se7ge/mlhep2015_starterkit | MLHEP 2015 starterkit.ipynb | mit | ! pwd
hits_train = pd.read_csv("mlhep2015_starterkit/data/train.csv", index_col='global_id')
hits_train.head()
hits_test = pd.read_csv("mlhep2015_starterkit/data/test.csv", index_col='global_id')
hits_test.head()
"""
Explanation: The data from Kaggle is already here in the "data" folder. Let's take a look at it.
End... |
karimsayadi/karimsayadi.github.io | teaching/python2/notebooks/Exercices_220217.ipynb | gpl-3.0 | import sys, os
import re
from os import listdir
from os.path import isfile, join
"""
Explanation: Exercice 1
Dans cet exercice, nous allons créer un fichier csv qui contiendra deux colonnes. La première est relative au nom du fichier et la deuxième à son identifiant. Nous allons dans une première étape parcourir l'ens... |
nudomarinero/mltier1 | PanSTARRS_WISE_pre_ml.ipynb | gpl-3.0 | import numpy as np
from astropy.table import Table
from astropy import units as u
from astropy.coordinates import SkyCoord
import pickle
from mltier1 import get_center, get_n_m, estimate_q_m, Field
%pylab inline
field = Field(170.0, 190.0, 45.5, 56.5)
"""
Explanation: PanSTARRS - WISE crossmatch: Pre-configure the ... |
BrownDwarf/ApJdataFrames | notebooks/Allers2006.ipynb | mit | %pylab inline
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
"""
Explanation: ApJdataFrames: Allers2006
Title: Young, Low-Mass Brown Dwarfs with Mid-Infrared Excesses
Authors: AKCJ
Data is from this paper:
http://iopscience.iop.org/0004-637X/644/1/364/
End of explanation
... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session09/Day4/workbook_globalsignals.ipynb | mit | n_bins = 8192 ## number of total frequency bins in a FT segment; same as number of time bins in the light curve
dt = 1./16. # time resolution of the output light curve
df = 1. / dt / n_bins
"""
Explanation: Global Signals in Time Series Data
By Abigail Stevens
Problem 1: Timmer and Koenig algorithm
The algorithm out... |
melissawm/oceanobiopython | Notebooks/Aula_5.ipynb | gpl-3.0 | import numpy as np
A = np.zeros((10,10))
print(A)
"""
Explanation: NumPy
Para lidarmos com matrizes e vetores, e realizar operações matemáticas nesses objetos, usamos a biblioteca NumPy e um formato de dados específico: a numpy-array, ou ndarray, que é uma estrutura de dados homogêneos multidimensional, que é uma tab... |
omimo/xRBM | examples/01-RBM-MNIST.ipynb | mit | import numpy as np
import tensorflow as tf
%matplotlib inline
import matplotlib.pyplot as plt
from IPython import display
#Uncomment the below lines if you didn't install xRBM using pip and want to use the local code instead
#import sys
#sys.path.append('../')
"""
Explanation: Tutorial 1: Training an RBM on MNIST D... |
nilmtk/nilmtk | docs/manual/user_guide/siteonlyapi_tutorial.ipynb | apache-2.0 | from nilmtk.dataset_converters.caxe import convert_caxe
convert_caxe('ac_seconds4.csv')
"""
Explanation: Diasaggregate your Home/Building Mains Meter Data
This notebook demonstrates the use of siteonlyapi - a new NILMTK interface which is a modification of NILMTK's ExperimentAPI. It allows NILMTK users to get their h... |
MasterRobotica-UVic/Control-and-Actuators | proportional_sum_delta.ipynb | gpl-3.0 | lmbda = np.array([0.25 + 1j*0.433, 0.25 - 1j*0.433])
circlePlot(lmbda)
"""
Explanation: Oscillations and complex roots
System:
$8y[n] = -2y[n-2] + 4y[n-1] + 5x[n-1]$
Roots are:
$\lambda = 0.25 \pm j0.433$
End of explanation
"""
def complexSystem(n):
if n == 0: # first initial condition
return 0
el... |
davidbrough1/pymks | notebooks/localization_elasticity_polycrystal_hex_3D.ipynb | mit | import pymks
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Linear Elasticity in 3D for Polycrystalline Microstructures
Authors: Noah Paulson, Andrew Medford, David Brough
Introduction
This example demonstrates the use of MKS to predict stra... |
RobinCPC/algorithm-practice | Basic/LinkedList.ipynb | mit | class ListNode:
def __init__(self, val):
self.val = val
self.next = None
# in python next is a reversed word
def reverse(self, head):
prev = None
head = self
while head:
temp = head.next
head.next = prev
prev = head
... |
jasontlam/snorkel | tutorials/intro/Intro_Tutorial_1.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
# TO USE A DATABASE OTHER THAN SQLITE, USE THIS LINE
# Note that this is necessary for parallel execution amongst other things...
# os.environ['SNORKELDB'] = 'postgres:///snorkel-intro'
from snorkel import SnorkelSession
session = SnorkelSession()
# Her... |
deepmind/dm-haiku | examples/haiku_lstms.ipynb | apache-2.0 | #@title Full license text
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
rhenanbartels/hrv | notebooks/Heart Rate Variability analyses using RRi series.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (10, 6)
"""
Explanation: Analysis of an RRi series registered during REST condition and RECOVERY from maximal effort exercise
End of explanation
"""
from hrv.io import read_from_text
rri = read_from_text("data/08012805.txt")
"""
Explanation: Reading... |
darioizzo/d-CGP | doc/sphinx/notebooks/real_world2.ipynb | gpl-3.0 | # Some necessary imports.
import dcgpy
import pygmo as pg
import numpy as np
# Sympy is nice to have for basic symbolic manipulation.
from sympy import init_printing
from sympy.parsing.sympy_parser import *
init_printing()
# Fundamental for plotting.
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanat... |
nproctor/phys202-2015-work | assignments/midterm/InteractEx06.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import Image
from IPython.html.widgets import interact, interactive, fixed
"""
Explanation: Interact Exercise 6
Imports
Put the standard imports for Matplotlib, Numpy and the IPython widgets in the following cell.
End of explan... |
Danghor/Formal-Languages | Ply/Look-Ahead.ipynb | gpl-2.0 | import ply.lex as lex
tokens = [ 'USELESS' ]
literals = ['U', 'V', 'W', 'X']
def t_USELESS(t):
r'This will never be used.'
__file__ = 'main'
lexer = lex.lex()
"""
Explanation: Dealing with Lookahead Conflicts
This notebook discusses conflicts that have their origin in insufficient looakahead.
We will discuss... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/sandbox-3/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Tim... |
petrs/ECTester | util/plot_dh.ipynb | mit | %matplotlib notebook
import numpy as np
from scipy.stats import describe
from scipy.stats import norm as norm_dist
from scipy.stats.mstats import mquantiles
from math import log, sqrt
import matplotlib.pyplot as plt
from matplotlib import ticker, colors, gridspec
from copy import deepcopy
from utils import plot_hist, m... |
scoyote/RHealthDataImport | AllValues.ipynb | mit | import xml.etree.ElementTree as et
import pandas as pd
import numpy as np
from datetime import *
import matplotlib.pyplot as plt
import re
import os.path
import zipfile
import pytz
%matplotlib inline
plt.rcParams['figure.figsize'] = 16, 8
"""
Explanation: Download, Parse and Interrogate Apple Health Export Data
Th... |
cmshobe/landlab | notebooks/tutorials/flow_direction_and_accumulation/compare_FlowDirectors.ipynb | mit | %matplotlib inline
# import plotting tools
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib as mpl
# import numpy
import numpy as np
# import necessary landlab components
from landlab im... |
tritemio/pybroom | doc/notebooks/pybroom-example.ipynb | mit | import numpy as np
from numpy import sqrt, pi, exp, linspace
from lmfit import Model
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format='retina' # for hi-dpi displays
import lmfit
print('lmfit: %s' % lmfit.__version__)
import pybroom as br
"""
Explanation: PyBroom Example - Simpl... |
RNAer/Calour | doc/source/notebooks/microbiome_databases.ipynb | bsd-3-clause | import calour as ca
ca.set_log_level(11)
%matplotlib notebook
"""
Explanation: Calour microbiome databases interface tutorial
Setup
End of explanation
"""
cfs=ca.read_amplicon('data/chronic-fatigue-syndrome.biom',
'data/chronic-fatigue-syndrome.sample.txt',
normalize=10000... |
kpn-advanced-analytics/modelFactoryPy | Template/Template_Aster.ipynb | mit | registry.register('aster', 'sqlalchemy_mf_aster.jdbc', 'AsterDialect_jdbc')
main.getConnection('aster')
# this will also create main.engine variable
model_id = 'titanic_training'
#main.addModelId('titanic_training','Training on titanic data','passengerid')
main.getSessionId(model_id)
# this will also create main.ses... |
piskvorky/gensim | docs/notebooks/pivoted_document_length_normalisation.ipynb | lgpl-2.1 | #
# Download our dataset
#
import gensim.downloader as api
nws = api.load("20-newsgroups")
#
# Pick texts from relevant newsgroups, split into training and test set.
#
cat1, cat2 = ('sci.electronics', 'sci.space')
#
# X_* contain the actual texts as strings.
# Y_* contain labels, 0 for cat1 (sci.electronics) and 1 fo... |
mne-tools/mne-tools.github.io | 0.19/_downloads/e71fac7e5d7784759a26529dd6e63da5/plot_whitened.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
"""
Explanation: Plotting whitened data
This tutorial demonstrates how to plot whitened evoked data.
Data are whitened for many processes, including dipole fitting, source
localization and some decoding algorithms. Viewing whitened data thus gives
a different perspective on t... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, ... |
wei-Z/Python-Machine-Learning | code/ch13/ch13.ipynb | mit | %load_ext watermark
%watermark -a 'Sebastian Raschka' -u -d -v -p numpy,matplotlib,theano,keras
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
"""
Explanation: Sebastian Raschka, 2015
https://github.com/rasbt/python-machine... |
chapagain/kaggle-competitions-solution | Sentiment Analysis on Movie Reviews/Sentiment-Analysis-on-Movie-Reviews-Logistic-Regression.ipynb | mit | import nltk
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.pipeline import Pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
"""
Explanation: Sentiment Analysis on Movie Re... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_read_and_write_raw_data.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
# Set up pick list: MEG + STI 014 - b... |
jdhp-docs/python_notebooks | nb_sci_maths/maths_stats_chi_squared_min_fr.ipynb | mit | n = 100
p = 0.25
data = np.random.binomial(n=n, p=p, size=100000)
plt.hist(data,
bins=np.linspace(data.min(), data.max(), data.max() - data.min() + 1));
"""
Explanation: Minimisation du $\chi^2$
Chi-squared test
To see:
- http://hamelg.blogspot.fr/2015/11/python-for-data-analysis-part-25-chi.html
- https://d... |
Kismuz/btgym | examples/portfolio_setup_BETA.ipynb | lgpl-3.0 |
from logbook import INFO, WARNING, DEBUG
import warnings
warnings.filterwarnings("ignore") # suppress h5py deprecation warning
import numpy as np
import os
import backtrader as bt
from btgym.research.casual_conv.strategy import CasualConvStrategyMulti
from btgym.research.casual_conv.networks import conv_1d_casual_a... |
ihmeuw/dismod_mr | examples/expert_prior_explorer.ipynb | agpl-3.0 | # if dismod_mr is not installed, it should possible to use
# !conda install --yes pymc
# !pip install dismod_mr
import dismod_mr
"""
Explanation: Expert priors in DisMod-MR
Take a look at some of the expert priors for the age-specific rate model in DisMod-MR.
End of explanation
"""
from IPython.core.pylabtools impo... |
google-coral/tutorials | run_colab_on_devboard.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
xpharry/Udacity-DLFoudation | tutorials/sentiment_network/.ipynb_checkpoints/Sentiment Classification - How to Best Frame a Problem for a Neural Network - -checkpoint.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r')
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r')
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()
reviews[0]
labels[0]
print("labels.t... |
Kaggle/learntools | notebooks/embeddings/raw/3-gensim.ipynb | apache-2.0 | import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import tensorflow as tf
from tensorflow import keras
#_RM_
input_dir = '../input/movielens_preprocessed'
#_UNCOMMENT_
#input_dir = '../input/movielens-preprocessing'
#_RM_
model_dir = '.'
#_UNCOMMENT_
#model_dir = '../input/movielen... |
ethen8181/machine-learning | recsys/calibration/calibrated_reco.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(css_style='custom2.css', plot_style=False)
os.chdir(path)
# 1. magic for inline plot... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/recursive_ls.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
from pandas_datareader.data import DataReader
np.set_printoptions(suppress=True)
"""
Explanation: Recursive least squares
Recursive least squares is an expanding window version of ordinary least squa... |
daniel-koehn/Theory-of-seismic-waves-II | 00_Intro_Python_Jupyter_notebooks/5_Linear_Regression_with_Real_Data.ipynb | gpl-3.0 | # Execute this cell to load the notebook's style sheet, then ignore it
from IPython.core.display import HTML
css_file = '../style/custom.css'
HTML(open(css_file, "r").read())
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2017 L.A. Barba, N.C. Clementi
... |
MMesch/SHTOOLS | examples/notebooks/tutorial_2.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import print_function # only necessary if using Python 2.x
import matplotlib.pyplot as plt
import numpy as np
from pyshtools.shclasses import SHCoeffs, SHWindow, SHGrid
nl = 100 # l = [0, 199]
lmax = nl - 1
a = 4 # scale length
ls = np.arange(nl, dtype=np.float)
power = 1. / (1. +... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.