repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
dsg-bielefeld/deep_disfluency | deep_disfluency/rnn/dev/Keras_experimentation.ipynb | mit | #Try decoding with just the one step as in training
model.reset_states()
model.predict([np.array([[[ 0.2]],[[ 0.1 ]]],[[[ 0.1]],[[ 0.4 ]]],dtype="float")] )
model.predict([np.array([[[0.1]]],dtype="float")] )
model.predict([np.array([[[0.4]]],dtype="float")] )
model.predict([np.array([[[0.1]]],dtype="float")] )
#N... |
parrt/dtreeviz | notebooks/classifier-boundary-animations.ipynb | mit | ! pip install --quiet -U pltvid # simple animation support by parrt
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression, Ridge, Lasso, LogisticRegression
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import RandomForestClassifier, R... |
newlawrence/poliastro | docs/source/examples/Natural and artificial perturbations.ipynb | mit | # Temporary hack, see https://github.com/poliastro/poliastro/issues/281
from IPython.display import HTML
HTML('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>')
import numpy as np
from plotly.offline import init_notebook_mode
init_notebook_mode(co... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-leakage-dir-ex-all-ph-out-17d.ipynb | mit | ph_sel_name = "None"
data_id = "17d"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:38:52 2017
Duration: 7 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from fretbursts import *
ini... |
informatics-isi-edu/deriva-py | docs/derivapy-datapath-example-2.ipynb | apache-2.0 | # Import deriva modules
from deriva.core import ErmrestCatalog, get_credential
# Connect with the deriva catalog
protocol = 'https'
hostname = 'www.facebase.org'
catalog_number = 1
credential = get_credential(hostname)
catalog = ErmrestCatalog(protocol, hostname, catalog_number, credential)
# Get the path builder int... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-1/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-1', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-1
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
bblais/Classy | examples/Example Bio.ipynb | mit | print("original sequence:")
print("\t",sequence_data.data[0])
print("the first few chunks:")
for vector in data.vectors[:10]:
print("\t",bio.vector_to_sequence(vector,data.letters))
"""
Explanation: here'a a little sanity check...
End of explanation
"""
save_csv('small sequence dataset.csv',data)
"""
Explanati... |
brettavedisian/phys202-2015-work | 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... |
HazyResearch/snorkel | tutorials/cdr/CDR_Tutorial_3.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import numpy as np
from snorkel import SnorkelSession
session = SnorkelSession()
from snorkel.models import candidate_subclass
ChemicalDisease = candidate_subclass('ChemicalDisease', ['chemical', 'disease'])
train = session.query(ChemicalDisease).filter(Chemica... |
openclimatedata/pymagicc | notebooks/Diagnose-TCR-ECS-TCRE.ipynb | agpl-3.0 | # NBVAL_IGNORE_OUTPUT
from datetime import datetime
from pymagicc.core import MAGICC6, MAGICC7
%matplotlib inline
from matplotlib import pyplot as plt
plt.style.use("ggplot")
"""
Explanation: Diagnosing MAGICC's TCR, ECS and TCRE
End of explanation
"""
with MAGICC6() as magicc:
# you can tweak whatever parame... |
vadim-ivlev/STUDY | handson-data-science-python/DataScience-Python3/DecisionTree.ipynb | mit | import numpy as np
import pandas as pd
from sklearn import tree
input_file = "e:/sundog-consult/udemy/datascience/PastHires.csv"
df = pd.read_csv(input_file, header = 0)
df.head()
"""
Explanation: Decison Trees
First we'll load some fake data on past hires I made up. Note how we use pandas to convert a csv file into... |
Xilinx/PYNQ | boards/Pynq-Z1/base/notebooks/pmod/pmod_tc1.ipynb | bsd-3-clause | from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
from pynq.lib import Pmod_TC1
# TC1 sensor is on PMODB
my_tc1 = Pmod_TC1(base.PMODB)
print('Raw Register Value: %08x hex' % my_tc1.read_raw())
print('Ref Junction Temp: %.4f' % my_tc1.read_junction_temperature())
print('Thermocouple Temp: %.2... |
dmlc/mxnet | example/svrg_module/benchmarks/svrg_benchmark.ipynb | apache-2.0 | import os
import json
import sys
import tempfile
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import mxnet as mx
from mxnet.contrib.svrg_optimization.svrg_module import SVRGModule
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.datasets import load_svmlight_file
sys.... |
mauroalberti/gsf | checks/Test divergence and curl module.ipynb | gpl-3.0 | from pygsf.mathematics.arrays import *
from pygsf.spatial.rasters.geotransform import *
from pygsf.spatial.rasters.fields import *
"""
Explanation: Test divergence and curl module
Created by Mauro Alberti
Last run: 2019-06-22
This document present tests on divergence and curl module calculation using pygsf.
Prelimin... |
MarsUniversity/ece387 | website/block_1_basics/lsn3/lsn3.ipynb | mit | from __future__ import print_function
from __future__ import division
import numpy as np
"""
Explanation: Python
Kevin J. Walchko
created 16 Nov 2017
Here we will use python as our programming language. Python, like any other language, is really vast and complex. We will just cover the basics we need.
Objectives
Und... |
jamessdixon/Kaggle.HomeDepot | ProjectSearchRelevance.Python/Home Depot Product Search Relevance TF-IDF.ipynb | mit | import graphlab as gl
"""
Explanation: Home Depot Product Search Relevance
The challenge is to predict a relevance score for the provided combinations of search terms and products. To create the ground truth labels, Home Depot has crowdsourced the search/product pairs to multiple human raters.
LabGraph Create
This not... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/scikit-learn/scikit-learn-gmm.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: Density Estimation: Gaussian Mixture Models
Credits: Forked from PyCon 2015 Scikit-learn Tutorial by Jake VanderPlas
Here we'll explore Gaussi... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_evoked_whitening.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import sample
from mne.cov import compute_covariance
print(__doc__)
"""
Explanation: Whitening evoked data with ... |
relopezbriega/mi-python-blog | content/notebooks/LinearAlgebraPython.ipynb | gpl-2.0 | # Vector como lista de Python
v1 = [2, 4, 6]
v1
# Vectores con numpy
import numpy as np
v2 = np.ones(3) # vector de solo unos.
v2
v3 = np.array([1, 3, 5]) # pasando una lista a las arrays de numpy
v3
v4 = np.arange(1, 8) # utilizando la funcion arange de numpy
v4
"""
Explanation: Algebra Lineal con Python
Esta not... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timestepping Framework, Advecti... |
geektoni/shogun | doc/ipython-notebooks/classification/Classification.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import os
import shogun as sg
%matplotlib inline
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
#Needed lists for the final plot
classifiers_linear = []*10
classifiers_non_linear = []*10
classifiers_names = []*10
fadings = []*10
"""
Explanation: Visua... |
tensorflow/docs | site/en/r1/guide/eager.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... |
uber/pyro | tutorial/source/bayesian_regression.ipynb | apache-2.0 | %reset -s -f
import os
from functools import partial
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pyro
import pyro.distributions as dist
# for CI testing
smoke_test = ('CI' in os.environ)
assert pyro.__version__.startswith('1.7.0')
pyro.set_rng_seed... |
Upward-Spiral-Science/team1 | code/Assignment11_Group.ipynb | apache-2.0 | from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import urllib2
import scipy.stats as stats
np.set_printoptions(precision=3, suppress=True)
url = ('https://raw.githubusercontent.com/Upward-Spiral-Science'
'/data/master/syn-density/output.csv')
data =... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/06_structured/labs/6_deploy.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'... |
dolittle007/dolittle007.github.io | notebooks/dependent_density_regression.ipynb | gpl-3.0 | %matplotlib inline
from IPython.display import HTML
from matplotlib import animation as ani, pyplot as plt
import numpy as np
import pandas as pd
import pymc3 as pm
import seaborn as sns
from theano import shared, tensor as tt
plt.rc('animation', writer='avconv')
blue, *_ = sns.color_palette()
SEED = 972915 # from r... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/migration/UJ6 AutoML for natural language with Vertex AI Text Classification.ipynb | apache-2.0 | ! pip3 install -U google-cloud-aiplatform --user
"""
Explanation: Vertex SDK: AutoML natural language text classification model
Installation
Install the latest (preview) version of Vertex SDK.
End of explanation
"""
! pip3 install google-cloud-storage
"""
Explanation: Install the Google cloud-storage library as wel... |
vanheck/blog-notes | QuantTrading/creating_trading_strategy_03-zipline.ipynb | mit | NB_VERSION = 1,0
import sys
import datetime
import pandas as pd
import zipline
%load_ext zipline
print('Verze notebooku:', '.'.join(map(str, NB_VERSION)))
print('Verze pythonu:', '.'.join(map(str, sys.version_info[0:3])))
print('---')
print('Zipline:', zipline.__version__)
print('Pandas:', pd.__version__)
"""
Expla... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_algo/knn_high_dimension_correction.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: 2A.algo - Plus proches voisins en grande dimension - correction
La méthodes des plus proches voisins est un algorithme assez simple qui devient très lent en grande dimension. Ce notebook propose un moyen d'aller plus v... |
guyk1971/deep-learning | batch-norm/Batch_Normalization_Lesson.ipynb | mit | # Import necessary packages
import tensorflow as tf
import tqdm
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Import MNIST data so we have something for our experiments
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"... |
jomavera/Work | Interior_Point_Method_Example.ipynb | mit | x = np.linspace(0, 4, 100)
y1 = 2*x
y2 = x/3
y3 = 4 - x
plt.figure(figsize=(8, 6))
plt.plot(x, y1)
plt.plot(x, y2)
plt.plot(x, y3)
plt.xlim((0, 3.5))
plt.ylim((0, 4))
plt.xlabel('x1')
plt.ylabel('x2')
y5 = np.minimum(y1, y3)
plt.fill_between(x[:-25], y2[:-25], y5[:-25], color='red', alpha=0.5)
"""
Explanation: G... |
cgpotts/cs224u | hw_rel_ext.ipynb | apache-2.0 | __author__ = "Bill MacCartney and Christopher Potts"
__version__ = "CS224u, Stanford, Fall 2020"
"""
Explanation: Homework and bake-off: Relation extraction using distant supervision
End of explanation
"""
import numpy as np
import os
import rel_ext
from sklearn.linear_model import LogisticRegression
import utils
"... |
dynaryu/rmtk | rmtk/vulnerability/model_generator/SPBELA_approach/SPBELA.ipynb | agpl-3.0 | import SPBELA
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Generation of capacity curves using SP-BELA
The Simplified Pushover-based Earthquake Loss Assessment (SP-BELA) methodology allows the calculation of the displacement capacity (i.e. spectral displacement) and collapse multipl... |
d-k-b/udacity-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... |
phoebe-project/phoebe2-docs | 2.1/tutorials/LP.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: 'lp' (Line Profile) Datasets and Options
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
"""
... |
letsgoexploring/economicData | us-convergence/python/state_income_data.ipynb | mit | # Import BEA API key or set manually to variable api_key
try:
items = os.getcwd().split('/')[:3]
items.append('bea_api_key.txt')
path = '/'.join(items)
with open(path,'r') as api_key_file:
api_key = api_key_file.readline()
except:
api_key = None
# Dictionary of state abbreviations
stateAbb... |
mbuchove/analysis-tools-m | GC/flux_lvl_detection_rough.ipynb | mit |
sig = 34. # roughly
time = 6406. / 60. # hours
sens = sig / np.sqrt(time) # sensitivity
t = (5./sens)**2 # time required to find 5 sigma
print(sens)
print(t)
"""
Explanation: Finding rough minimum flux level required to detect
End of explanation
"""
gam_rate = 0.1582244 * 60 # gamma / hour
gam_err = 0.006188... |
google/tf-quant-finance | tf_quant_finance/examples/jupyter_notebooks/Introduction_to_TensorFlow_Part_2_-_Debugging_and_Control_Flow.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... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_04.ipynb | mit | # Define T and g
T = 40
y0 =50
g = 0
# Compute yT using the direct approach and print
# Initialize a 1-dimensional array called y that has T+1 zeros
# Set the initial value of y to equal y0
# Use a for loop to update the values of y one at a time
# Print the final value in the array y
"""
Explanation: Cl... |
cgpotts/cs224u | vsm_03_retrofitting.ipynb | apache-2.0 | __author__ = "Christopher Potts"
__version__ = "CS224u, Stanford, Spring 2022"
"""
Explanation: Vector-space models: retrofitting
End of explanation
"""
from collections import defaultdict
from nltk.corpus import wordnet as wn
import numpy as np
import os
import pandas as pd
import retrofitting
from retrofitting imp... |
tpin3694/tpin3694.github.io | python/pandas_long_to_wide.ipynb | mit | import pandas as pd
"""
Explanation: Title: Pandas: Long To Wide Format
Slug: pandas_long_to_wide
Summary: Pandas: Long To Wide Format
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules
End of explanation
"""
raw_data = {'patient': [1, 1, 1, 2, 2],
'obs': [1, ... |
sot/aca_stats | mult_stars_flag_impact.ipynb | bsd-3-clause | from __future__ import division
import os
import matplotlib.pyplot as plt
from astropy.table import Table
import numpy as np
from Ska.DBI import DBI
%matplotlib inline
# Use development version of chandra_aca which has the new acq stats fit parameters
import sys
import os
sys.path.insert(0, os.path.join(os.environ['... |
HarshaDevulapalli/foundations-homework | 05/05-Homework-Devulapalli-NYT_graded.ipynb | mit | import requests
date='2009-05-08' #Replace with 2010-05-09,2009-06-21,2010-06-20
url="https://api.nytimes.com/svc/books/v2/lists/"+date+"/hardcover-fiction.json?&num_results=1&api-key=4182fa9aca904ae18f4a1f6bef2fc7e9"
response=requests.get(url)
data=response.json()
print("The Best Sellers on",date,"are the following:")... |
ghvn7777/ghvn7777.github.io | content/fluent_python/14_iter.ipynb | apache-2.0 | import re
import reprlib
RE_WORD = re.compile('\w+')
class Sentence:
def __init__(self, text):
self.text = text
# 返回一个字符串列表,里面的元素是正则表达式的全部非重叠匹配
self.words = RE_WORD.findall(text)
def __getitem__(self, index):
return self.words[index]
# 为了完善序列协议,我们实现了 __le... |
QuantStack/quantstack-talks | 2019-06-04-deRSE19-widgets/notebooks/5 - Custom.ipynb | bsd-3-clause | import ipywidgets as widgets
from traitlets import Unicode
class HelloWidget(widgets.DOMWidget):
_view_name = Unicode('HelloView').tag(sync=True)
_view_module = Unicode('hello').tag(sync=True)
"""
Explanation: Custom Jupyter Widgets
The Hello World Example of the Cookie Cutter
The widget framework is built ... |
ptpro3/ptpro3.github.io | Projects/Project2/Project2_Prashant.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import Image
import requests
from bs4 import BeautifulSoup
import dateutil.parser
import statsmodels.api as sm
import patsy
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing impor... |
dstrockis/outlook-autocategories | notebooks/1-Exploring ensemble classifier.ipynb | apache-2.0 | # Load data
import pandas as pd
with open('./data_files/8lWZYw-u-yNbGBkC4B--ip77K1oVwwyZTHKLeD7rm7k.csv') as data_file:
df = pd.read_csv(data_file)
df.head()
"""
Explanation: Hypothesis
Training per-folder logistic regression models will be more effective than a single model
End of explanation
"""
# Remove messa... |
jegibbs/phys202-2015-work | assignments/assignment05/InteractEx02.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
from IPython.html import widgets
"""
Explanation: Interact Exercise 2
Imports
End of explanation
"""
def plot_sine1(a,b):
x = np.arange(0.0... |
jokedurnez/neuropower_new_ideas | peakdistribution/FDRcontrol_with_RFT.ipynb | mit | % matplotlib inline
import os
import numpy as np
import nibabel as nib
from nipy.labs.utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset
import nipy.algorithms.statistics.rft as rft
from __future__ import print_function, division
import math
import matplotlib.pyplot as plt
import palettable.colorbrewer a... |
ML4DS/ML4all | TM3.Topic_Models_with_MLlib/ExB3_TopicModels/TM_Exam_Solution.ipynb | mit | %matplotlib inline
import nltk
import time
import matplotlib.pyplot as plt
import pylab
# import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
#from test_helper import Test
import collections
from pyspark.mllib.clustering import LDA, LDAMode... |
rvperry/phys202-2015-work | assignments/assignment04/TheoryAndPracticeEx01.ipynb | mit | from IPython.display import Image
"""
Explanation: Theory and Practice of Visualization Exercise 1
Imports
End of explanation
"""
# Add your filename and uncomment the following line:
Image(filename='TaP1.png')
"""
Explanation: Graphical excellence and integrity
Find a data-focused visualization on one of the follo... |
kaslusimoes/MurphyProbabilisticML | chapters/Chapter 1.ipynb | mit | %run ../src/LinearRegression.py
%run ../src/PolynomialFeatures.py
# LINEAR REGRESSION
# Generate random data
X = np.linspace(0,20,10)[:,np.newaxis]
y = 0.1*(X**2) + np.random.normal(0,2,10)[:,np.newaxis] + 20
# Fit model to data
lr = LinearRegression()
lr.fit(X,y)
# Predict new data
x_test = np.array([0,20])[:,np.n... |
phuongxuanpham/SelfDrivingCar | CarND-Term1-Starter-Kit-Test/test.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
%matplotlib inline
img = mpimg.imread('test.jpg')
plt.imshow(img)
"""
Explanation: My note:
1. Install Anaconda
2. Setup the carnd-term1 environment as instructions in Starter Kit.
3. Run the test.ipynb in the carnd-term1 kernel
4. ... |
tylere/docker-tmpnb-ee | notebooks/1 - IPython Notebook Examples/IPython Project Examples/IPython Kernel/Plotting in the Notebook.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Plotting with Matplotlib
IPython works with the Matplotlib plotting library, which integrates Matplotlib with IPython's display system and event loop handling.
matplotlib mode
To make plots using Matplotlib, you must first enable IPython's matplotlib mode.
To do this, run the %matpl... |
georgetown-analytics/machine-learning | examples/bbengfort/home sales/home_sales.ipynb | mit | %matplotlib inline
import os
import numpy as np
import pandas as pd
import seaborn as sns
"""
Explanation: Home Sales
This data set is from the Kaggle Advanced Home Sales Regression challenge. Unfortunately the data is not available unless you sign up for Kaggle and agree to the restrictions from the data set. Howe... |
tensorflow/docs-l10n | site/ja/probability/examples/JointDistributionAutoBatched_A_Gentle_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... |
mjabri/holoviews | doc/Tutorials/Options.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
%reload_ext holoviews.ipython
x,y = np.mgrid[-50:51, -50:51] * 0.1
image = hv.Image(np.sin(x**2+y**2), group="Function", label="Sine")
coords = [(0.1*i, np.sin(0.1*i)) for i in range(100)]
curve = hv.Curve(coords)
curves = {phase: hv.Curve([(0.1*i, np.sin(phase+0.1*i)) for ... |
d-k-b/udacity-deep-learning | transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
samirma/deep-learning | tensorboard/Anna_KaRNNa_Name_Scoped.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... |
matthewljones/computingincontext | CiC_lecture_03_text_mining_redux.ipynb | gpl-2.0 | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import textmining_blackboxes as tm
"""
Explanation: Computing In Context
Social Sciences Track
Lecture 3--text mining for real
Matthew L. Jones
like, with code and stuff
End of explanation
"""
#see if package imported correctly
tm.icantbelieve(... |
osemer01/us-domestic-flight-performance | flights.ipynb | cc0-1.0 | from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
import csv
import xlrd
%matplotlib inline
"""
Explanation: On Time Flight Performance of Domestic Flights in December 2014
Author Information:
Oguz Semerci<br>
oguz.semerci@gmail.com<br>
Introduction
In this report we analyze o... |
wtbarnes/aia_response | notebooks/import_genx_files.ipynb | mit | import sys
import os
import numpy as np
import scipy.io
from astropy.table import Table
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
%matplotlib inline
"""
Explanation: Parse .genx Files
Parse .genx files from SSW into Python in order to calculate AIA wavelength response function... |
google/iree | samples/colab/edge_detection.ipynb | apache-2.0 | #@title Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
Explanation: Copyright 2020 The IREE Authors
End of explanation
"""
!python -m pip install iree-compiler iree-runtime iree-too... |
PyLCARS/PythonUberHDL | myHDL_ComputerFundamentals/Memorys/.ipynb_checkpoints/Memory-checkpoint.ipynb | bsd-3-clause | from myhdl import *
from myhdlpeek import Peeker
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from sympy import *
init_printing()
import random
#https://github.com/jrjohansson/version_information
%load_ext version_information
%version_information myhdl, myhdlpeek, numpy, ... |
aldian/tensorflow | tensorflow/python/ops/numpy_ops/g3doc/TensorFlow_Numpy_Distributed_Image_Classification.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-hr/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-hr', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-HR
Sub-Topics: Radi... |
yassineAlouini/ml-experiments | deep-learning/activation_layers.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
sns.set(font_scale=1.5)
"""
Explanation: A notebook showing how some very common activation functions (used for deep-learning for example) look like. Enjoy!
End of explanation
"""
def sigmoid(x):
return 1 / (1 + np.exp(-x... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
Pro... |
maxalbert/tohu | notebooks/High_level_tests_for_tohu_generators.ipynb | mit | g = Integer(low=100, high=200)
g.reset(seed=12345); print_generated_sequence(g, num=15)
g.reset(seed=9999); print_generated_sequence(g, num=15)
some_integers = g.generate(5, seed=99999)
for x in some_integers:
print(x)
"""
Explanation: This notebook contains high-level tests for tohu's "standard" generators.
Cl... |
mathemage/h2o-3 | examples/deeplearning/notebooks/deeplearning_tensorflow_cat_dog_mouse_lenet.ipynb | apache-2.0 | import sys, os
import h2o
from h2o.estimators.deepwater import H2ODeepWaterEstimator
import os.path
from IPython.display import Image, display, HTML
import pandas as pd
import numpy as np
import random
PATH=os.path.expanduser("~/h2o-3")
h2o.init(port=54321, nthreads=-1)
if not H2ODeepWaterEstimator.available(): exit
... |
chrishah/genomisc | popogeno/QTlight/QTLight_demo.ipynb | mit | import QTLight_functions as QTL
"""
Explanation: Import the functions (assumes that QTLight_functions.py is in your current working directory or in your python path)
End of explanation
"""
%%bash
ln -s test-data/batch_1.vcf.gz .
ln -s test-data/populationmap .
mkdir matrix
"""
Explanation: Fetch relevant files fro... |
EBIvariation/eva-cttv-pipeline | data-exploration/complex-events/notebooks/complex-events-explore.ipynb | apache-2.0 | complex_xml = os.path.join(PROJECT_ROOT, 'complex-events.xml.gz')
# get just "complex events"
# Q: what's complex? -- complex == no full coordinates
def complex_measures(x):
if x.measure:
return (
# smattering of all non SNV variants
(x.measure.variant_type.lower() not in {'single n... |
pfschus/fission_bicorrelation | methods/calculate_Asym_energy_space.ipynb | mit | import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='ticks')
import sys
import os
import os.path
import scipy.io as sio
import time
import numpy as np
np.set_printoptions(threshold=np.nan) # print entire matrices
import pandas as pd
from tqdm import *
sys.path.append('../scripts/')
... |
antoniomezzacapo/qiskit-tutorial | community/teach_me_qiskit_2018/state_distribution_in_qubit_chains/qubit_chain_mod.ipynb | apache-2.0 | from pprint import pprint
import math
import numpy as np
# importing the Qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import Aer, execute
# import state tomography functions
from qiskit.tools.visualization import plot_histogram, plot_state
# Definition of matchgate
def gat... |
drcgw/bass | Kitchen Sink-Bass.ipynb | gpl-3.0 | from bass import *
"""
Explanation: Welcome to BASS
Development Version
This notebook is inteded for very advanced users, as there is almost no interactivity features. However, this notebook is all about speed. If you know exactly what you are doing, then this is the notebook for you.
BASS: Biomedical Analysis Softwar... |
ddtm/dl-course | Seminar5/Seminar5.ipynb | mit | import numpy as np
import theano
import theano.tensor as T
import lasagne
import cPickle as pickle
import os
import matplotlib.pyplot as plt
%matplotlib inline
import scipy
from scipy.misc import imread, imsave, imresize
from lasagne.utils import floatX
from lasagne.layers import InputLayer
from lasagne.layers import ... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/giss-e2-1g/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'giss-e2-1g', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: GISS-E2-1G
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, ... |
turbomanage/training-data-analyst | CPB100/lab4a/demandforecast.ipynb | apache-2.0 | import google.datalab.bigquery as bq
import pandas as pd
import numpy as np
import shutil
%bq tables describe --name bigquery-public-data.new_york.tlc_yellow_trips_2015
"""
Explanation: <h1>Demand forecasting with BigQuery and TensorFlow</h1>
In this notebook, we will develop a machine learning model to predict the ... |
oseledets/nla2016 | lectures/lecture-1.ipynb | mit | import numpy as np
import random
#c = random.random()
#print(c)
c = np.float32(0.925924589693)
a = np.float32(8.9)
b = np.float32(c / a)
print('{0:10.16f}'.format(b))
print a * b - c
#a = np.array(1.585858585887575775757575e-5, dtype=np.float)
a = np.array(5.0, dtype=np.float32)
b = np.sqrt(a)
print('{0:10.16f}'.form... |
bspalding/research_public | lectures/drafts/Fundamental factor models.ipynb | apache-2.0 | import numpy as np
import statsmodels.api as sm
from statsmodels import regression
import matplotlib.pyplot as plt
import pandas as pd
# Get market cap and book-to-price for all assets in universe
fundamentals = init_fundamentals()
data = get_fundamentals(query(fundamentals.valuation.market_cap,
... |
jrg365/gpytorch | examples/06_PyTorch_NN_Integration_DKL/Deep_Kernel_Learning_DenseNet_CIFAR_Tutorial.ipynb | mit | from torch.optim import SGD, Adam
from torch.optim.lr_scheduler import MultiStepLR
import torch.nn.functional as F
from torch import nn
import torch
import os
import torchvision.datasets as dset
import torchvision.transforms as transforms
import gpytorch
import math
import tqdm
"""
Explanation: SVDKL (Stochastic Varia... |
zerothi/ts-tbt-sisl-tutorial | A_06/run.ipynb | gpl-3.0 | graphene = sisl.geom.graphene(1.44)
elec = graphene.tile(2, axis=0)
elec.write('ELEC_GRAPHENE.fdf')
elec.write('ELEC_GRAPHENE.xyz')
C1d = sisl.Geometry([[0,0,0]], graphene.atom[0], [10, 10, 1.4])
elec_chain = C1d.tile(4, axis=2)
elec_chain.write('ELEC_CHAIN.fdf')
elec_chain.write('ELEC_CHAIN.xyz')
chain = elec_chain.t... |
Riptawr/deep-learning | image-classification/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'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
alvaroing12/CADL | session-5/session-5-part-1.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n',
'You should consider updating to Python 3.4.0 or',
'higher as the libraries built for this course',
'have only been tested in Python 3.4 and higher.\n')
... |
jcmgray/quijy | docs/basics.ipynb | mit | qu(data, qtype='ket')
"""
Explanation: Kets are column vectors, i.e. with shape (d, 1):
End of explanation
"""
qu(data, qtype='bra') # also conjugates the data
"""
Explanation: The normalized=True option can be used to ensure a normalized output.
Bras are row vectors, i.e. with shape (1, d):
End of explanation
"""... |
benozol/codemapper | evaluation/lib/CoMap evaluation.ipynb | agpl-3.0 | ev = pd.read_csv('../{}.evaluations.csv'.format(PROJECT))
for key in ['generated', 'reference', 'tp', 'fp', 'fn']:
ev[key] = ev[key].map(lambda x: x if x != x else json.loads(x))
ev['variation event database recall precision'.split()].head()
"""
Explanation: Load evaluations ev
End of explanation
"""
df_m = mapp... |
MingChen0919/learning-apache-spark | notebooks/02-data-manipulation/.ipynb_checkpoints/2.7.1-column-expression-checkpoint.ipynb | mit | mtcars = spark.read.csv('../../../data/mtcars.csv', inferSchema=True, header=True)
mtcars = mtcars.withColumnRenamed('_c0', 'model')
mtcars.show(5)
"""
Explanation: Column expression
A Spark column instance is NOT a column of values from the DataFrame: when you crate a column instance, it does not give you the actual ... |
deculler/TableDemos | HealthDemo.ipynb | bsd-2-clause | # Lets draw two samples of equal size
n_sample = 200
smoker_sample = smokers.sample(n_sample)
nosmoker_sample = nosmokers.sample(n_sample)
weight = Table([nosmoker_sample['weight'],smoker_sample['weight']],['NoSmoke','Smoke'])
weight.hist(overlay=True,bins=30,normed=True)
bins=np.arange(39,139,5)
weight_dist = weight... |
chungjjang80/FRETBursts | notebooks/Example - Working with timestamps and bursts.ipynb | gpl-2.0 | from fretbursts import *
sns = init_notebook()
filename = "./data/0023uLRpitc_NTP_20dT_0.5GndCl.hdf5"
d = loader.photon_hdf5(filename)
loader.alex_apply_period(d)
d.calc_bg(bg.exp_fit, time_s=30, tail_min_us='auto', F_bg=1.7)
d.burst_search()
"""
Explanation: Working with timestamps and bursts
This notebook is part o... |
sraejones/phys202-2015-work | assignments/midterm/InteractEx06.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import math as m
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 ce... |
bburan/psiexperiment | examples/notebooks/Calibration tutorial.ipynb | mit | %matplotlib inline
from scipy import signal
from scipy import integrate
import pylab as pl
import numpy as np
"""
Explanation: Acoustic system calibration
Since the calibration measurements may be dealing with very small values, there's potential for running into the limitations of <a href="https://docs.oracle.com/cd/... |
tensorflow/docs-l10n | site/zh-cn/guide/basic_training_loops.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... |
syednasar/datascience | deeplearning/sentiment-analysis/sentiment_network/Sentiment Classification - Project 3 Solution.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()... |
pysg/pyther | Modelo de impregnacion/modelo1/Activité 4 (1).ipynb | mit | import numpy as np
import pandas as pd
import math
import cmath
from scipy.optimize import root
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Introduction
Ce programme nous permet de modéliser la concentration (c2) pour différents food simulant. Cela nous permet également de tracer différents gra... |
GoogleCloudPlatform/healthcare | datathon/nusdatathon18/tutorials/ddsm_ml_tutorial.ipynb | apache-2.0 | import numpy as np
import os
import pandas as pd
import random
import tensorflow as tf
from google.colab import auth
from google.cloud import storage
from io import BytesIO
# The next import is used to print out pretty pandas dataframes
from IPython.display import display, HTML
from PIL import Image
"""
Explanation: ... |
cranmer/look-elsewhere-2d | create_gaussian_process_examples.ipynb | mit | %pylab inline --no-import-all
"""
Explanation: Testing look-elsewhere effect by creating 2d chi-square random fields with a Gaussian Process
by Kyle Cranmer, Dec 7, 2015
The correction for 2d look-elsewhere effect presented in
Estimating the significance of a signal in a multi-dimensional search by Ofer Vitells and ... |
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE | notebooks/13_01_Big_Data.ipynb | mit | import pyspark
sc = pyspark.SparkContext('local[*]')
# We define our input
l = range(10)
l
# We "upload" it as an RDD
rdd = sc.parallelize(l)
rdd
"""
Explanation: Contents
Introduction
Big Data & Hadoop
HDFS
MapReduce
Apache Spark
Map & Reduce
RDD
Key-Value RDD
DataFrame
Pandas-like interface
SQL interface
Introdu... |
ijstokes/bokeh-blaze-tutorial | solutions/.ipynb_checkpoints/1.1 Charts - Timeseries (solution)-checkpoint.ipynb | mit | import pandas as pd
from bokeh.charts import TimeSeries, output_notebook, show
# Get data
df = pd.read_csv('data/Land_Ocean_Monthly_Anomaly_Average.csv')
# Process data
df['datetime'] = pd.to_datetime(df['datetime'])
df = df[['anomaly','datetime']]
# Output option
output_notebook()
# Create timeseries chart
t = Tim... |
bekbote/project_repository | 0207_Vectors-1549598493596.ipynb | apache-2.0 | plt.quiver(0,0,3,4)
plt.show()
plt.quiver(0,0,3,4, scale_units='xy', angles='xy', scale=1)
plt.show()
plt.quiver(0,0,3,4, scale_units='xy', angles='xy', scale=1)
plt.xlim(-10,10)
plt.ylim(-10,10)
plt.show()
plt.quiver(0,0,3,4, scale_units='xy', angles='xy', scale=1, color='r')
plt.quiver(0,0,-3,4, scale_units='xy', ... |
ljchang/psyc63 | Notebooks/2_Introduction_to_Dataframes_&_Plotting.ipynb | mit | # matplotlib inline is an example of 'cell magic' and
# enables plotting IN the notebook and not opening another window.
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Dataframes ( Pandas ) and Plotting ( Matplotlib/Seaborn )
Written ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.