repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ssunkara1/bqplot | examples/Interactions/Mark Interactions.ipynb | apache-2.0 | x_sc = LinearScale()
y_sc = LinearScale()
x_data = np.arange(20)
y_data = np.random.randn(20)
scatter_chart = Scatter(x=x_data, y=y_data, scales= {'x': x_sc, 'y': y_sc}, colors=['dodgerblue'],
interactions={'click': 'select'},
selected_style={'opacity': 1.0, 'fill': 'Dar... |
google/applied-machine-learning-intensive | content/05_deep_learning/04_transfer_learning/colab.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... |
davidparks21/qso_lya_detection_pipeline | papers/I/nb/Revisiting_Fig19.ipynb | mit | %matplotlib notebook
# imports
from matplotlib import pyplot as plt
from astropy import units as u
from dla_cnn.io import load_ml_dr12, load_garnett16
from specdb.specdb import IgmSpec
igmsp = IgmSpec()
## Systems
junk_plates = [6466, 5059, 4072, 3969]
junk_fibers = [740, 906, 162, 788]
wvoffs = [200., 200., 200.... |
keras-team/keras-io | examples/vision/ipynb/deeplabv3_plus.ipynb | apache-2.0 | import os
import cv2
import numpy as np
from glob import glob
from scipy.io import loadmat
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
!gdown https://drive.google.com/uc?id=1B9A9UCJYMwTL4oBEo4RZfbMZMaZhKJaz
!unzip -q instance-level-human-par... |
yevheniyc/Projects | 1j_NLP_Python/ex07.ipynb | mit | import pynlp
stopwords = pynlp.load_stopwords("stop.txt")
print(stopwords)
"""
Explanation: Exercise 07: TF-IDF
The following exercise uses results from our parsing to calculate a term frequency - inverse document frequency (TF-IDF) metric to construct feature vectors per document. First we'll load a stopword list, f... |
kdestasio/online_brain_intensive | nipype_tutorial/notebooks/basic_data_input.ipynb | gpl-2.0 | from nipype import DataGrabber, Node
# Create DataGrabber node
dg = Node(DataGrabber(infields=['subject_id', 'ses_name', 'task_name'],
outfields=['anat', 'func']),
name='datagrabber')
# Location of the dataset folder
dg.inputs.base_directory = '/data/ds000114'
# Necessary default para... |
nehal96/Deep-Learning-ND-Exercises | TensorBoard/Anna KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
guozheng/data-science-ml-basics | spam.ipynb | mit | import pandas as pd
import sklearn
df = pd.read_table('https://raw.githubusercontent.com/sinanuozdemir/sfdat22/master/data/sms.tsv', sep='\t', header=None, names=['label', 'msg'])
df
df.label.value_counts()
value_probablity = df.label.value_counts()/len(df)
spam_probability = value_probablity.spam
ham_probability = ... |
vinecopulib/pyvinecopulib | examples/bivariate_copulas.ipynb | mit | import pyvinecopulib as pv
"""
Explanation: Import the library
End of explanation
"""
pv.Bicop()
"""
Explanation: Create an independence bivariate copula
End of explanation
"""
pv.Bicop(family=pv.BicopFamily.gaussian)
"""
Explanation: Create a Gaussian copula
See help(pv.BicopFamily) for the available families
... |
kylepjohnson/notebooks | fluent_python/Chapter 2, An Array of Sequences.ipynb | mit | symbols = '$#%^&'
[ord(s) for s in symbols]
tuple(ord(s) for s in symbols)
(ord(s) for s in symbols)
for x in (ord(s) for s in symbols):
print(x)
import array
array.array('I', (ord(s) for s in symbols))
colors = ['black', 'white']
sizes = ['S', 'M', 'L']
for tshirt in ((c, s) for c in colors for s in sizes):
... |
mne-tools/mne-tools.github.io | 0.24/_downloads/8fdd7a9ad9a4bab4331f7c5da5e3bb1a/define_target_events.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD-3-Clause
import mne
from mne import io
from mne.event import define_target_events
from mne.datasets import sample
import matplotlib.pyplot as plt
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Define target events based on time la... |
kaslusimoes/MurphyProbabilisticML | chapters/Chapter 2.ipynb | mit | ax = plt.subplot(111)
plot_dist(stats.norm, -4, 4, ax)
"""
Explanation: Chapter 2 - Probability
This chapter introduces probability theory (and the differences between frequentists and baysians), some common statistics and examples of discrete and continous distributions. It also presents transformation of variables, ... |
ledeprogram/algorithms | class4/homework/Devulapalli_Harsha_4_1.ipynb | gpl-3.0 | df['duration'].max()
df['duration'].min()
"""
Explanation: But we notice that there are discrepancies in the data. For example:
End of explanation
"""
df['duration'].median()
"""
Explanation: There are complaints that take negative days! So it is essential we see the median, so that outliers like these don't affe... |
GoogleCloudPlatform/analytics-componentized-patterns | retail/recommendation-system/bqml-scann/perf_test.ipynb | apache-2.0 | import tensorflow as tf
import time
PROJECT_ID = 'ksalama-cloudml'
BUCKET = 'ksalama-cloudml'
INDEX_DIR = f'gs://{BUCKET}/bqml/scann_index'
BQML_MODEL_DIR = f'gs://{BUCKET}/bqml/item_matching_model'
LOOKUP_MODEL_DIR = f'gs://{BUCKET}/bqml/embedding_lookup_model'
songs = {
'2114406': 'Metallica: Nothing Else Matte... |
darioflute/CS4A | Lecture-notebook.ipynb | gpl-3.0 | ! pwd
names = !ls *.py
names[:3]
"""
Explanation: How to use notebook
Notebook is a wonderful environment to write your research notes.
You can merge comments and code in a single document, pass this to
your colleagues and let them check what you did.
Starting is super easy. It comes with the anaconda distribution.
S... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_07_Complete.ipynb | mit | # Initialize parameter values
y0 = 0
rho = 0.5
w1 = 1
# Compute the period 1 value of y
y1 = rho*y0 + w1
# Print the result
print('y1 =',y1)
"""
Explanation: Class 7: Deterministic Time Series Models
Time series models are at the foundatation of dynamic macroeconomic theory. A time series model is an equation or sys... |
balarsen/pymc_learning | Foil Open Area/Open Area-pymc3.ipynb | bsd-3-clause | %matplotlib inline
#%matplotlib notebook
%load_ext version_information
%load_ext autoreload
import itertools
from pprint import pprint
from operator import getitem
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import numpy as np
import spacepy.plot as spp
import pymc3 as mc3
import tqdm
from... |
CLEpy/CLEpy-MotM | Tenacity/Tenacity.ipynb | mit | import random
from tenacity import retry
@retry
def do_something_unreliable():
# Pick a number between 0 and 10
if random.randint(0, 10) > 1:
# If it's greater than 1, raise an error
print("this number was bad...")
raise Exception
else:
print("...but this one is good! :D")
... |
debugger22/cte-python-notebooks | intro_to_python.ipynb | mit | '''
variable assignments
this is a variable assignment
'''
x = 1.0
my_variable = 12
print type(x)
print type(my_variable)
"""
Explanation: Variables
In computer programming, a variable is a storage location and an associated symbolic name (an identifier) which contains some known or unknown quantity or information, ... |
gprMax/gprMax | tools/Jupyter_notebooks/plot_source_wave.ipynb | gpl-3.0 | %matplotlib inline
from gprMax.waveforms import Waveform
from tools.plot_source_wave import check_timewindow, mpl_plot
w = Waveform()
w.type = 'ricker'
w.amp = 1
w.freq = 25e6
timewindow = 300e-9
dt = 8.019e-11
timewindow, iterations = check_timewindow(timewindow, dt)
plt = mpl_plot(w, timewindow, dt, iterations, fft... |
3upperm2n/notes-deeplearning | projects/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... |
Upward-Spiral-Science/team1 | code/regression_simulation.ipynb | apache-2.0 | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import urllib2
from __future__ import division
np.random.seed(1)
url = ('https://raw.githubusercontent.com/Upward-Spiral-Science'
'/data/master/syn-density/output.csv')
data = urllib2.urlopen(url)
csv = np.genfromtxt(data, delimiter=",")[1:] ... |
macks22/gensim | docs/notebooks/dtm_example.ipynb | lgpl-2.1 | import logging
import os
from gensim import corpora, utils
from gensim.models.wrappers.dtmmodel import DtmModel
import numpy as np
if not os.environ.get('DTM_PATH', None):
raise ValueError("SKIP: You need to set the DTM path")
"""
Explanation: DTM Example
In this example we will present a sample usage of the DTM ... |
mit-crpg/openmc | examples/jupyter/tally-arithmetic.ipynb | mit | import glob
from IPython.display import Image
import numpy as np
import openmc
"""
Explanation: Tally Arithmetic
This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed... |
Startupsci/data-science-notebooks | python-data-structures-list.ipynb | mit | # Define a list of integers
number_list = [3, 2, 1, 3, 5, 9, 6, 3, 9]
number_list
# List can contain strings
word_list = ['Jan', 'Feb', 'Mar', 'Apr']
word_list
# List can contain mixed data types
mixed_list = [1, 'Jan', 2, 'Feb', 3, 'Mar']
mixed_list
# Lists can be n-dimensional or list of lists of...
matrix_list = ... |
metpy/MetPy | v0.10/_downloads/bde7bfb97b4a7184a1b01143438361ff/Find_Natural_Neighbors_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Delaunay
from metpy.interpolate.geometry import find_natural_neighbors
# Create test observations, test points, and plot the triangulation and points.
gx, gy = np.meshgrid(np.arange(0, 20, 4), np.arange(0, 20, 4))
pts = np.vstack([gx.ravel()... |
PyPSA/PyPSA | examples/notebooks/battery-electric-vehicle-charging.ipynb | mit | import pypsa
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# use 24 hour period for consideration
index = pd.date_range("2016-01-01 00:00", "2016-01-01 23:00", freq="H")
# consumption pattern of BEV
bev_usage = pd.Series([0.0] * 7 + [9.0] * 2 + [0.0] * 8 + [9.0] * 2 + [0.0] * 5, index)
# so... |
quantopian/research_public | notebooks/lectures/Introduction_to_Pandas/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Introduction to pandas
by Maxwell Margenot
Part of the Quantopian Lecture Series:
www.quantopian.com/lectures
github.com/quantopian/research_public
pandas is a Python library that provides a collection of powerful data structures... |
johnpfay/environ859 | 07_DataWrangling/Geopandas/0-GetCounties-Documented.ipynb | gpl-3.0 | import requests
import pandas as pd
import geopandas as gpd
%matplotlib inline
"""
Explanation: GeoPandas Demo: Get Counties
This example demonstrates how to grab data from an ArcGIS MapService and pull it into a GeoPandas data frame.
End of explanation
"""
#Build the request and parameters to fetch county features... |
nmaynes/image-classifier-with-tensorflow | dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
nilmtk/nilmtk | docs/manual/user_guide/data.ipynb | apache-2.0 | from nilmtk.dataset_converters import convert_redd
convert_redd('/data/REDD/low_freq', '/data/redd.h5')
"""
Explanation: Convert data to NILMTK format and load into NILMTK
NILMTK uses an open file format based on the HDF5 binary file format to store both the power data and the metadata. The very first step when using... |
GustavoRP/IA369Z | dev/.ipynb_checkpoints/DTI_open_01-05-17_GRP-checkpoint.ipynb | gpl-3.0 | # import modules and libs
import io, os, sys, types
import numpy as np
# image and graphic
from IPython.display import Image
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib
#import notebook as module
sys.path.append('C:/iPython/DTIlib')
import DTIlib as DTI
"""
Explanation: Openig DTI... |
AllenDowney/ModSimPy | notebooks/spiderman.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
balarsen/pymc_learning | Deconvolution/convolution1.ipynb | bsd-3-clause | np.random.seed(8675309)
dat_len = 100
xval = np.arange(dat_len)
realdat = np.zeros(dat_len, dtype=int)
realdat[40:60] = 50
noisemean = 2
real_n = np.zeros_like(realdat)
for i in range(len(realdat)):
real_n[i] = np.random.poisson(realdat[i]+noisemean)
# make a detector
# triangular with FWFM 5 and is square
det =... |
vsmolyakov/kaggle | sberbank/sberbank_notebook.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from datetime import datetime
from scipy import stats
from sklearn.linear_model import LassoCV
from sklearn.ensemble import RandomForestRegressor
from sklearn.preprocessing import LabelEncoder
import xgbo... |
BojanPLOJ/Bipropagation | Welcome_To_Colaboratory.ipynb | gpl-3.0 | seconds_in_a_year = 24 * 60 * 60 * 365
seconds_in_a_year
"""
Explanation: <a href="https://colab.research.google.com/github/BojanPLOJ/Bipropagation/blob/master/Welcome_To_Colaboratory.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<p><img alt="Cola... |
altimesh/hybridizer-basic-samples | Jupyter/Labs/02_VectorAdd/HYB_CUDA_CSHARP.ipynb | mit | !hybridizer-cuda ./01-vector-add/01-vector-add.cs -o ./01-vector-add/vectoradd.exe -run
"""
Explanation: <div align="center"><h1>Vector Add on GPU</h1></div>
Vector Add
In the world of computing, the addition of two vectors is the standard "Hello World".
Given two sets of scalar data, such as the image above, we w... |
thesby/CaffeAssistant | tutorial/ipynb/net_surgery.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import Image
# Make sure that caffe is on the python path:
caffe_root = '../' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
# configure plotting
plt.rcParams['figure.figsi... |
maqnius/compscie-mc | jupyter_notebooks/presentation_notebook_jaap.ipynb | gpl-3.0 | creator = particlesim.utils.config_parser.ProblemCreator("/home/mark/Dokumente/Studium/Master/WS1617/CompSci/compscie-mc/jupyter_notebooks/config/8_particle_nacl_rand.cfg")
system_config = creator.generate_problem()
plot_systemconfig(system_config)
sampler = particlesim.api.Sampler(system_config)
"""
Explanation: C... |
mne-tools/mne-tools.github.io | stable/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_1samp_te... |
philmui/datascience2016fall | lecture04.data.wrangling/lecture04.merging.ipynb | mit | import pandas as pd
df = pd.DataFrame()
"""
Explanation: Merging Data
We will use this dataset from the EU member states trades for this notebook:
http://appsso.eurostat.ec.europa.eu/nui/show.do?dataset=ext_lt_invcur&lang=en
End of explanation
"""
for chunk in pd.read_csv('data/ext_lt_invcur.tsv', sep='\t', chunksi... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session03/Day4/Parallel.ipynb | mit | import random
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: Parallelization and Algorithm Development
By C Hummels (Caltech)
End of explanation
"""
# Create sorted random array and random element of that array; this just sets up the problem.
def rand_arr(n_elements=100000):
rando... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/06_structured/labs/5_train.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.1
# change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'... |
gloriakang/vax-sentiment | to_do/vax_temp/multigraph-analysis.ipynb | mit | import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from glob import glob
# read .gml file
graph = nx.read_gml('article0.gml')
# read pajek file
# graph = nx.read_pajek('article1.net')
# plot spring layout
plt.figure(figsize=(12,12))
nx.draw_spring(graph, arrows=True, with_lab... |
patryk-oleniuk/emotion_recognition | temp/main_emotion_recognition_Patryk.ipynb | gpl-3.0 | import random
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import csv
import scipy.misc
import time
import collections
import os
import utils as ut
import importlib
import copy
importlib.reload(ut)
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather... |
bashtage/statsmodels | examples/notebooks/metaanalysis1.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy import stats, optimize
from statsmodels.regression.linear_model import WLS
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.stats.meta_analysis import (
effectsize_smd,
effectsize_2proportions,
combine_effect... |
tensorflow/docs-l10n | site/en-snapshot/model_optimization/guide/combine/pcqat_example.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... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/TensorFlow_Distributions_Tutorial.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
daniel-koehn/Theory-of-seismic-waves-II | 04_FD_stability_dispersion/1_fd_stability_dispersion.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 © 2018 parts of this notebook are... |
molgor/spystats | notebooks/.ipynb_checkpoints/Spatial Model Fitting using GLS-checkpoint.ipynb | bsd-2-clause | ls
# Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps/external_plugins/spystats/spystats/')
sys.path.append('..')
import django
django.setup()
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
## Use the ggplot style
plt.style.use('ggplot')
import tools
"""
Ex... |
ES-DOC/esdoc-jupyterhub | notebooks/ipsl/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: IPSL
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
Ruediger-Braun/compana16 | Lektion09.ipynb | gpl-3.0 | from sympy import *
init_printing()
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import display
"""
Explanation: Lektion 9
End of explanation
"""
def komposition(f, g):
"gibt die Funktion f ∘ g zurück"
def func(x):
return f(g(x))
return func
h = komp... |
wegamekinglc/alpha-mind | notebooks/Example 12 - Machine Learning Model Prediction.ipynb | mit | %matplotlib inline
import os
import datetime as dt
import numpy as np
import pandas as pd
from alphamind.api import *
from PyFin.api import *
"""
Explanation: 本例展示如何在alpha-mind中使用机器学习模型
请在环境变量中设置DB_URI指向数据库
End of explanation
"""
freq = '10b'
universe = Universe('hs300')
batch = 8
neutralized_risk = industry_styl... |
therealAJ/python-sandbox | data-science/learning/ud2/Part 1 Exercise Solutions/Pandas Data Visualization Exercise .ipynb | gpl-3.0 | import pandas as pd
import matplotlib.pyplot as plt
df3 = pd.read_csv('df3')
%matplotlib inline
df3.info()
df3.head()
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Pandas Data Visualization Exercise
This is just a quick exercise for you to review the various plots... |
AllenDowney/DataExploration | distribution.ipynb | mit | from __future__ import print_function, division
import numpy as np
import thinkstats2
import nsfg
import thinkplot
%matplotlib inline
"""
Explanation: Visualizing distributions
Copyright 2015 Allen Downey
License: Creative Commons Attribution 4.0 International
End of explanation
"""
preg = nsfg.ReadFemPreg()
pre... |
rashikaranpuria/Machine-Learning-Specialization | Classification/Week 6/.ipynb_checkpoints/module-9-precision-recall-assignment-blank-checkpoint.ipynb | mit | import graphlab
from __future__ import division
import numpy as np
graphlab.canvas.set_target('ipynb')
"""
Explanation: Exploring precision and recall
The goal of this second notebook is to understand precision-recall in the context of classifiers.
Use Amazon review data in its entirety.
Train a logistic regression m... |
QuantStack/quantstack-talks | 2018-03-06-Polytechnique-Jupyter/notebooks/08 - PyThreejs.ipynb | bsd-3-clause | ball = Mesh(geometry=SphereGeometry(radius=1),
material=MeshLambertMaterial(color='red'),
position=[2, 1, 0])
c = PerspectiveCamera(position=[0, 5, 5], up=[0, 1, 0],
children=[DirectionalLight(color='white', position=[3, 5, 1], intensity=0.5)])
scene = Scene(children=[ba... |
dato-code/tutorials | notebooks/link_prediction.ipynb | apache-2.0 | import graphlab as gl
# Loading the links dataset into a SFrame object
sf_links = gl.SFrame.read_csv("https://static.turi.com/datasets/bgu_directed_network_googleplus/g_plus_pos_and_neg_links.csv.gz")
# Let's view the data
print sf_links.head(3)
# Creating SGraph object from the SFrame object
g = gl.SGraph().add_edg... |
fdcl-gwu/MAE3134_examples | Partial Fraction Expansion.ipynb | gpl-3.0 | import sympy
import numpy as np
sympy.init_printing()
"""
Explanation: Partial Fraction Expansion using Sympy
This is an example for using partial fraction expansion within Python
This only covers a tiny fraction of what is possible.
As always it's a good idea to look at the documentation
http://docs.sympy.org/lates... |
hasadna/knesset-data-pipelines | jupyter-notebooks/running kns_documentcommitteesession pipeline.ipynb | mit | %%bash
curl 172.17.0.1:9998 | tail
"""
Explanation: The pipeline takes a long time to run for all committee sessions
You should limit to running on a subset of sessions with cache by adding a filter step to kns_documentcommitteesession
additional-steps:
- run: filter
cache: true
parameters:
in:
-... |
kubernetes-client/python | examples/notebooks/create_pod.ipynb | apache-2.0 | from kubernetes import client, config
"""
Explanation: How to start a Pod
In this notebook, we show you how to create a single container Pod.
Start by importing the Kubernetes module
End of explanation
"""
config.load_incluster_config()
"""
Explanation: If you are using a proxy, you can use the client Configuration... |
keras-team/keras-io | examples/graph/ipynb/gnn_citations.ipynb | apache-2.0 | import os
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Node Classification with Graph Neural Networks
Author: Khalid Salama<br>
Date created: 2021/05/30<br>
Last mod... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.filter.ipynb | gpl-3.0 | import vcsn
%%automaton aut
context = "lal_char(a), b"
0 -> 1 a
1 -> 0 a
0 -> 4 a
1 -> $
1 -> 2 a
$ -> 0
3 -> 4 a
4 -> 0 a
4 -> 5 a
"""
Explanation: automaton.filter(states)
Return a subautomaton such that their states are in the input states set.
Postcondition:
- The result automaton is subautomaton of input automat... |
ivannz/study_notes | year_15_16/fall_2015/game theoretic foundations of ml/labs/SVM-lab.ipynb | mit | import numpy as np, pandas as pd
import matplotlib.pyplot as plt
from sklearn import *
%matplotlib inline
random_state = np.random.RandomState( None )
def collect_result( grid_, names = [ ] ) :
df = pd.DataFrame( { "2-Отклонение" : [ np.std(v_[ 2 ] ) for v_ in grid_.grid_scores_ ],
"1-Т... |
tensorflow/docs-l10n | site/ja/hub/tutorials/semantic_similarity_with_tf_hub_universal_encoder.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. 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 app... |
goodwordalchemy/thinkstats_notes_and_exercises | code/chap05_modeling_distributions_notes.ipynb | gpl-3.0 | %matplotlib inline
import math
import numpy as np
import pandas
import nsfg
import thinkplot
import thinkstats2
import analytic
"""
Explanation: empirical distributions - based on empirical observations. Necessarily finite.
analytic distribution - CDF is a mathematical function.
model - simplification that leaves ... |
Kaggle/learntools | notebooks/python/raw/ex_4.ipynb | apache-2.0 | from learntools.core import binder; binder.bind(globals())
from learntools.python.ex4 import *
print('Setup complete.')
"""
Explanation: Things get more interesting with lists. You'll apply your new knowledge to solve the questions below. Remember to run the following cell first.
End of explanation
"""
def select_se... |
GregDMeyer/dynamite | examples/0-Overview.ipynb | mit | from dynamite import config
from dynamite.operators import sigmax, sigmay, sigmaz, op_sum, index_sum
"""
Explanation: Overview of dynamite: implementing a long-range Ising model
Let's implement a power law long-range ZZ interaction with open boundary conditions and some uniform field. Our Hamiltonian is
$$H = \sum_{i... |
NYUDataBootcamp/Projects | UG_F16/Long-Stock.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from plotly.offline import init_notebook_mode,iplot
import plotly.graph_objs as go
%matplotlib inline
init_notebook_mode(connected=True)
"""
Explanation: Stock Trading Strategy Backtesting
Author: Long Shangshang (Cheryl)
Date: December 15,2016
S... |
zklgame/CatEyeNets | test/PyTorch.ipynb | mit | import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.data import sampler
import torchvision.datasets as dset
import torchvision.transforms as T
import numpy as np
import timeit
import os
os.chdir(os.getcwd() + '/.... |
fastai/course-v3 | zh-nbs/Lesson6_rossmann.ipynb | apache-2.0 | %reload_ext autoreload
%autoreload 2
from fastai.tabular import *
"""
Explanation: Practical Deep Learning for Coders, v3
Lesson6_rossmann
End of explanation
"""
path = Config().data_path()/'rossmann'
train_df = pd.read_pickle(path/'train_clean')
train_df.head().T
n = len(train_df); n
"""
Explanation: Rossmann
连... |
AllenDowney/ProbablyOverthinkingIt | trivers.ipynb | mit | from __future__ import print_function, division
import thinkstats2
import thinkplot
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
%matplotlib inline
"""
Explanation: Does Trivers-Willard apply to people?
This notebook contains a "one-day paper", my attempt to pose a research question... |
AllenDowney/DataExploration | sampling.ipynb | mit | from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
from IPython.html.widgets import interact, fixed
from IPython.html import widgets
# seed the random number generator so we all get the same results
numpy.random.seed(18)
# some nicer colors from http:... |
NYUDataBootcamp/Projects | UG_F16/Mongillo-Pakistan.ipynb | mit | import sys
import matplotlib.pyplot as plt
import datetime as dt
import numpy as np
from mpl_toolkits.basemap import Basemap
import pandas as pd
import seaborn as sns
from scipy.stats.stats import pearsonr
print('Python version: ', sys.versi... |
metpy/MetPy | v0.12/_downloads/591c50ddf519b58966833b985f7ca28b/Parse_Angles.ipynb | bsd-3-clause | import metpy.calc as mpcalc
"""
Explanation: Parse angles
Demonstrate how to convert direction strings to angles.
The code below shows how to parse directional text into angles.
It also demonstrates the function's flexibility
in handling various string formatting.
End of explanation
"""
dir_str = 'SOUTH SOUTH EAST'... |
jnarhan/Breast_Cancer | src/create_meta/MetaData.ipynb | mit | __version__ = '0.1.0'
__status__ = 'Development'
__date__ = '2017-May-25'
__author__ = 'Jay Narhan'
import os
import pandas as pd
import numpy as np
from collections import Counter
META_ROOT = os.path.realpath('../../Meta_Data_Files') + '/'
DDSM_META = META_ROOT + 'Ddsm_png.csv'
MIAS_META = META_ROOT +... |
campagnucci/api_sof | SOF_Execucao_Orcamentaria_SMESP.ipynb | gpl-3.0 | import pandas as pd
import requests
import json
import numpy as np
import matplotlib.pyplot as plt
TOKEN = '198f959a5f39a1c441c7c863423264'
base_url = "https://gatewayapi.prodam.sp.gov.br:443/financas/orcamento/sof/v2.1.0"
headers={'Authorization' : str('Bearer ' + TOKEN)}
anos = [2011, 2012, 2013, 2014, 2015, 2016... |
amcdawes/QMlabs | Chapter 10 - Position & Momentum_blank.ipynb | mit | from sympy import *
init_printing(use_unicode=True)
x, y, z = symbols('x y z', real=True)
a, c = symbols('a c', nonzero=True, real=True)
integrate?
"""
Explanation: Chapter 10 - Position and Momentum
We can start using sympy to handle symbolic math (integrals and other calculus):
End of explanation
"""
integrate(... |
statsmodels/statsmodels.github.io | v0.12.2/examples/notebooks/generated/chi2_fitting.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import statsmodels.api as sm
"""
Explanation: Least squares fitting of models to data
This is a quick introduction to statsmodels for physical scientists (e.g. physicists, astronomers) or engineers.
Why is this needed?
Because most of statsmodels was written by statisticians and ... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_sensor_permutation_test.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne import io
from mne.stats import permutation_t_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Permutation T-test on sensor data
One tests if the signal sign... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/kubeflow_pipelines/pipelines/labs/kfp_pipeline_vertex_lightweight.ipynb | apache-2.0 | from google.cloud import aiplatform
REGION = "us-central1"
PROJECT_ID = !(gcloud config get-value project)
PROJECT_ID = PROJECT_ID[0]
# Set `PATH` to include the directory containing KFP CLI
PATH = %env PATH
%env PATH=/home/jupyter/.local/bin:{PATH}
"""
Explanation: Continuous Training with Kubeflow Pipeline and Ver... |
karthikrangarajan/intro-to-sklearn | OCR_Example.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import math
import tensorflow as tf
from sklearn import datasets
digits = datasets.load_digits()
digits.images.shape
print(digits.images.shape)
# Sample image
print(digits.images[0])
"""
Explanation: Optical Character Recognition (OCR)
Optical Char... |
opengeostat/pygslib | doc/source/Ipython_templates/gamv3D.ipynb | mit | #general imports
import pygslib
"""
Explanation: PyGSLIB
Introduction
This is a simple example on how to use raw pyslib to compute variograms
End of explanation
"""
#get the data in gslib format into a pandas Dataframe
mydata= pygslib.gslib.read_gslib_file('../datasets/cluster.dat')
# This is a ... |
tcstewar/testing_notebooks | The Advantage of Low Spike Rates.ipynb | gpl-2.0 | n_neurons = 5000
T = 1
prediction_offset = 0.06
model = nengo.Network(seed=1)
with model:
stim = nengo.Node(nengo.processes.WhiteSignal(period=T, high=5, rms=0.5))
ens = nengo.Ensemble(n_neurons=n_neurons, dimensions=1,
seed=10)
nengo.Connection(stim, ens, synapse=None)
p_... |
fivetentaylor/rpyca | RPCA_Testing.ipynb | mit | %matplotlib inline
"""
Explanation: Robust PCA Example
Robust PCA is an awesome relatively new method for factoring a matrix into a low rank component and a sparse component. This enables really neat applications for outlier detection, or models that are robust to outliers.
End of explanation
"""
import matplotlib.... |
csdms/pymt | notebooks/cem_and_waves.ipynb | mit | %matplotlib inline
import numpy as np
"""
Explanation: <img src="../_static/pymt-logo-header-text.png">
Coastline Evolution Model + Waves
Link to this notebook: https://github.com/csdms/pymt/blob/master/notebooks/cem_and_waves.ipynb
Install command: $ conda install notebook pymt_cem
This example explores how to use ... |
PyladiesMx/Empezando-con-Python | 8. Classes/Python_Classes.ipynb | mit | class MiCasa(object):
"""Clase que va a crear un objeto casa con los atributos
cuartos, puertas, ventanas y tamaño"""
def __init__(self, cuartos, puertas, ventanas, tamaño):
self.cuartos = cuartos
self.puertas = puertas
self.ventanas = ventanas
sel... |
dynaryu/rmtk | rmtk/vulnerability/model_generator/DBELA_approach/DBELA.ipynb | agpl-3.0 | import DBELA
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Generation of capacity curves using DBELA
This notebook enables the user to generate capacity curves (in terms of spectral acceleration vs. spectral displacement) using the Displacement-based Earthquake Loss Assessment (DBELA)... |
chapmanbe/nlm_clinical_nlp | BasicSentenceMarkupPart2.ipynb | mit | import pyConTextNLP.pyConTextGraph as pyConText
import pyConTextNLP.itemData as itemData
import networkx as nx
"""
Explanation: Demonstration of Basic Sentence Markup with pyConTextNLP, Part 2.
An ever-so-slightly more complex sentence
Let's use a slightly more complex sentence that will illustrate pruning.
End of exp... |
4DGenome/Chromosomal-Conformation-Course | Notebooks/04-Bin-filtering_and_normalization.ipynb | gpl-3.0 | from pytadbit.parsers.hic_parser import load_hic_data_from_reads
r_enz = 'MboI'
reso = 1000000
hic_data = load_hic_data_from_reads(
'results/fragment/{0}/03_filtering/valid_reads12_{0}.tsv'.format(r_enz),
reso)
"""
Explanation: Table of Contents
The HiC_data object
Filter columns with too few interaction co... |
EmuKit/emukit | notebooks/Emukit-tutorial-constrained-optimization.ipynb | apache-2.0 | FIG_SIZE = (12, 8)
"""
Explanation: Emukit - Bayesian Optimization with Non-Linear Constraints
This notebook demonstrates the use of emukit to perform Bayesian optimization with non-linear constraints.
In Bayesian optimization we optimize an acquisition function to find the next point to evaluate the objective functi... |
opengeostat/pygslib | pygslib/Ipython_templates/trans_raw.ipynb | mit | #general imports
import matplotlib.pyplot as plt
import pygslib
import numpy as np
import pandas as pd
#make the plots inline
%matplotlib inline
"""
Explanation: PyGSLIB
Trans
The GSLIb equivalent parameter file is
```
Parameters for TRANS
****
START OF PARAMETERS:
1 ... |
maniacalbrain/Caves-of-Qud-analysis | 2. Ploting my Caves of Qud data.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%pylab inline
col_names = ["Name", "End Time", "Game End Time", "Enemy", "x hit", "Damage", "Weapon", "PV", "Pos Dam", "Score", "Turns", "Zones", "Storied Items", "Artifact"]
#read in the data from the text file, setting the seperator between each... |
c22n/ion-channel-ABC | docs/examples/human-atrial/courtemanche_isus_unified.ipynb | gpl-3.0 | import os, tempfile
import logging
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from ionchannelABC import theoretical_population_size
from ionchannelABC import IonChannelDistance, EfficientMultivariateNormalTransition, IonChannelAcceptor
from ionchannelABC.experimen... |
bassdeveloper/bassdeveloper.github.io-source | code/MLAZ/Part_1_Data_Preprocessing/Data_Preprocessing_Py.ipynb | mit | # Importing the libraries
import numpy as np # Mathematics (Linear Algebra). Makes Python programming like R.
import matplotlib.pyplot as plt # For plotting and viewing graphs from datasets
import pandas as pd # Importing and managing datasets
# Importing the dataset
dataset = pd.read_csv('Data.csv') # Read the datas... |
arviz-devs/arviz | doc/source/user_guide/Numba.ipynb | apache-2.0 | import arviz as az
import numpy as np
import timeit
from arviz.utils import conditional_jit, Numba
from arviz.stats.diagnostics import ks_summary
data = np.random.randn(1000000)
def variance(data, ddof=0): # Method to calculate variance without using numba
a_a, b_b = 0, 0
for i in data:
a_a = a_a + ... |
paladin74/xsede_2015 | 01_introduction-IPython-notebook.ipynb | mit | 2+4
print("hello")
print("Hello world!")
"""
Explanation: <img src='rc_logo.png' style="height:75px">
Efficient Data Analysis with the IPython Notebook
<img src='data_overview.png' style="height:500px">
Objectives
Become familiar with the IPython Notebook.
Introduce the IPython landscape.
Getting started with explo... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sam0-unicon/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sam0-unicon', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: SNU
Source ID: SAM0-UNICON
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Bal... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/labs/content_based_by_hand.ipynb | apache-2.0 | !pip3 install tensorflow
"""
Explanation: Content Based Filtering by hand
Learning Objectives
Create and compute a user feature matrix.
Compute where each user lies in the feature embedding space.
Create recommendations for new movies based on similarity measures between the user and movie feature vectors.
Introduct... |
whiterd/Tutorial-Notebooks | 2018-02-01-TUT-DFW-Debugging.ipynb | mit | # Get Cheatsheet
def bad_function():
for i in range(4):
i += 2
if i == 3:
print('Finished')
bad_function()
"""
Explanation: Debugging
End of explanation
"""
def meh_function():
for i in range(10):
print(i)
i += 2
print(i)
if i == 10:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.