repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
minh5/cpsc | reports/.ipynb_checkpoints/api data-checkpoint.ipynb | mit | import pickle
import operator
import numpy as np
import pandas as pd
import gensim.models
data = pickle.load(open('/home/datauser/cpsc/data/processed/cleaned_api_data', 'rb'))
data.head()
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Introduction" data-toc-modified-id="Introduction-1"><... |
xR86/ml-stuff | kaggle/machine-learning-with-a-heart/Lab5.ipynb | mit | from datetime import datetime as dt
import numpy as np
import pandas as pd
# viz libs
import matplotlib.pyplot as plt
%matplotlib inline
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
... |
the-deep-learners/TensorFlow-LiveLessons | notebooks/intro_to_tensorflow_times_a_million.ipynb | mit | import numpy as np
np.random.seed(42)
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import tensorflow as tf
tf.set_random_seed(42)
xs = np.linspace(0., 8., 8000000) # eight million points spaced evenly over the interval zero to eight
ys = 0.3*xs-0.8+np.random.normal(scale=0.25, size=len(xs)) #... |
erikdrysdale/erikdrysdale.github.io | _rmd/extra_auroc/.ipynb_checkpoints/auc_max-checkpoint.ipynb | mit | # Import the necessary modules
import numpy as np
from scipy.optimize import minimize
def sigmoid(x):
return( 1 / (1 + np.exp(-x)) )
def idx_I0I1(y):
return( (np.where(y == 0)[0], np.where(y == 1)[0] ) )
def AUROC(eta,idx0,idx1):
den = len(idx0) * len(idx1)
num = 0
for i in idx1:
num += sum( eta[i] > e... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_14.ipynb | mit | # Define parameters
s = 0.1
delta = 0.025
alpha = 0.35
# Compute the steady state values of the endogenous variables
Kss = (s/delta)**(1/(1-alpha))
Yss = Kss**alpha
Css = (1-s)*Yss
Iss = Yss - Css
print('Steady states:\n')
print('capital: ',round(Kss,5))
print('output: ',round(Yss,5))
print('consumption:',roun... |
ajtrask/ManyWaysToPerishInStarTrek | StarTrek.ipynb | unlicense | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Star Trek Causes of Death
Data and inspiration from www.thestartrekproject.net
Required Libraries
End of explanation
"""
allDeaths = pd.read_excel("data/all-deaths.xls")
print(allDeaths.shape)
allDeaths.head()
... |
calebmadrigal/radio-hacking-scripts | radio_signal_generation.ipynb | mit | # Imports and boilerplate to make graphs look better
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy
import wave
from IPython.display import Audio
def setup_graph(title='', x_label='', y_label='', fig_size=None):
fig = plt.figure()
if fig_size != None:
fig.set_size_in... |
kubeflow/kfp-tekton-backend | samples/tutorials/mnist/01_Lightweight_Python_Components.ipynb | apache-2.0 | import kfp
import kfp.gcp as gcp
import kfp.dsl as dsl
import kfp.compiler as compiler
import kfp.components as comp
import kubernetes as k8s
# Required Parameters
PROJECT_ID='<ADD GCP PROJECT HERE>'
GCS_BUCKET='gs://<ADD STORAGE LOCATION HERE>'
"""
Explanation: Lightweight Python Components
To build a component, de... |
SlipknotTN/udacity-deeplearning-nanodegree | tv-script-generation/dlnd_tv_script_generation_deep_orlando.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/orlando_furioso.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
#text = text[81:]
# Need to clean by all numbers and subtitute italian tokens not present in english
"""
Explanation: TV Scr... |
GoogleCloudPlatform/ai-notebooks-extended | dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Environment Checks/00 - Authentication.ipynb | apache-2.0 | !gcloud auth revoke --quiet
!gcloud auth application-default revoke --quiet
"""
Explanation: Runs this to start from scratch
Both should return an error if no credentials were previously set and your are using the service account of the instance.
End of explanation
"""
# General
import google.auth
credentials, proj... |
authman/DAT210x | Module5/Module5 - Lab3.ipynb | mit | import pandas as pd
from datetime import timedelta
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot') # Look Pretty
"""
Explanation: DAT210x - Programming with Python for DS
Module5- Lab3
End of explanation
"""
def clusterInfo(model):
print("Cluster Analysis Inertia: ", model.inert... |
chunweixu/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... |
jforbess/pvlib-python | docs/tutorials/pvsystem.ipynb | bsd-3-clause | # built-in python modules
import os
import inspect
# scientific python add-ons
import numpy as np
import pandas as pd
# plotting stuff
# first line makes the plots appear in the notebook
%matplotlib inline
import matplotlib.pyplot as plt
# seaborn makes your plots look better
try:
import seaborn as sns
sns.s... |
kingmolnar/DataScienceProgramming | 07-Data-Visualization/MoreAPD_orig.ipynb | cc0-1.0 | import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
ls -l /home/data/APD/COBRA-YTD*.csv.gz
df = pd.read_csv('/home/data/APD/COBRA-YTD-multiyear.csv.gz')
df.shape
df.dtypes
dataDict = pd.DataFrame({'DataType': df.dtypes.values, 'Description': '', }, index=df.columns.values)
"""... |
msadegh97/machine-learning-course | homeworks/logistic-regression.ipynb | gpl-3.0 | # import what we need
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Homework #3.1: Logistic Regression
In this homework you will learn the concepts of logistic regression by implementing it.
Implement the body of each function and test whether you have done right for each... |
mne-tools/mne-tools.github.io | 0.24/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_1samp_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Non-param... |
mas-dse-greina/neon | Basic Regression with neon.ipynb | apache-2.0 | import numpy as np
m = 123.45 # Slope of our line (weight)
b = -67.89 # Intercept of our line (bias)
numDataPoints = 100 # Let's just have 100 total data points
X = np.random.rand(numDataPoints, 1) # Let's generate a vector X with numDataPoints random numbers
noiseScale = 1.2 # The larger this value, the noi... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/scikit-learn/scikit-learn-validation.ipynb | mit | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# Use seaborn for plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: Validation and Model Selection
Credits: Forked from PyCon 2015 Scikit-learn Tutorial by Jake VanderPlas
In this s... |
chrisbarnettster/cfg-analysis-on-heroku-jupyter | notebooks/notebooks/zscore_highbinders_for_galectin.ipynb | mit | ## House keeping tasks
%reset -f
"""
Explanation: check z-score and features of galectin data
also see https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3097418/ for suggestions on analysis of glycan arrays
z-score as the statistical test for significance of a sample
In the paper by Cholleti and Cummings http://www.ncbi.n... |
jupyter/nbgrader | nbgrader/tests/apps/files/test-no-metadata.ipynb | bsd-3-clause | def squares(n):
"""Compute the squares of numbers from 1 to n, such that the
ith element of the returned list equals i^2.
"""
### BEGIN SOLUTION
if n < 1:
raise ValueError("n must be greater than or equal to 1")
return [i ** 2 for i in range(1, n + 1)]
### END SOLUTION
"""
Exp... |
gth158a/learning | Keras as simplified TensorFlow.ipynb | apache-2.0 | import tensorflow as tf
sess = tf.Session()
from keras import backend as K
K.set_session(sess)
"""
Explanation: Source: https://blog.keras.io/keras-as-a-simplified-interface-to-tensorflow-tutorial.html
Note the version of Python. I am currently using 3.6 but it seems the tutorial is using Python 2.
End of explanatio... |
jiumem/tuthpc | multiprocessing.ipynb | bsd-3-clause | %%file multihello.py
'''hello from another process
'''
from multiprocessing import Process
def f(name):
print 'hello', name
if __name__ == '__main__':
p = Process(target=f, args=('world',))
p.start()
p.join()
# EOF
!python2.7 multihello.py
"""
Explanation: Multiprocessing and multithreading
Pa... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session14/Day1/SeparatingStarsAndGalaxies.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: An Astronomical Application of Machine Learning:
Separating Stars and Galaxies from SDSS
Version 0.3
By AA Miller 2017 Jan 22
AA Miller 2022 Mar 06 (v0.03)
The problems in the following not... |
gojomo/gensim | docs/notebooks/FastText_Tutorial.ipynb | lgpl-2.1 | from gensim.models.fasttext import FastText as FT_gensim
from gensim.test.utils import datapath
# Set file names for train and test data
corpus_file = datapath('lee_background.cor')
model_gensim = FT_gensim(size=100)
# build the vocabulary
model_gensim.build_vocab(corpus_file=corpus_file)
# train the model
model_ge... |
mkcor/csv-cleanup | load_and_cleanup.ipynb | cc0-1.0 | import pandas as pd
"""
Explanation: Lecture des données
Quand j'explore/analyse des données, la première chose que je fais est toujours :
End of explanation
"""
pd.__version__
"""
Explanation: Pour information/rappel,
End of explanation
"""
pd.read_csv('data/enfants.csv')
"""
Explanation: Pour lire un fichier C... |
cstrelioff/ARM-ipynb | Chapter3/chptr3.2.ipynb | mit | from __future__ import print_function, division
%matplotlib inline
import matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# use matplotlib style sheet
plt.style.use('ggplot')
# import statsmodels for R-style regression
import statsmodels.formula.api as smf
"""
Explanation: 3.2: Mult... |
susantabiswas/Natural-Language-Processing | Notebooks/Word_Prediction_using_Quadgrams_Memory_Efficient.ipynb | mit | #import the modules necessary
from nltk.util import ngrams
from collections import defaultdict
import nltk
import string
import time
start_time = time.time()
"""
Explanation: Word prediction based on Quadgram
This program reads the corpus line by line so it is slower than the program which reads the corpus
in one go.... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/text_classification/labs/rnn.ipynb | apache-2.0 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Recurrent Neural Networks (RNN) with Keras
Learning Objectives
Add built-in RNN layers.
Build bidirectional RNNs.
Using CuDNN kernels when available.
Build a RNN model with nested input/output.... |
dostrebel/working_place_ds_17 | 06_Python_Rückblick/01+Rückblick+02+For-Loop-Übungen+.ipynb | mit | primzweibissieben = [2, 3, 5, 7]
for prime in primzweibissieben:
print(prime)
"""
Explanation: 10 For-Loop-Rückblick-Übungen
In den Teilen der folgenden Übungen habe ich den Code mit "XXX" ausgewechselt. Es gilt in allen Übungen, den korrekten Code auszuführen und die Zelle dann auszuführen.
1.Drucke alle diese P... |
NORCatUofC/rain | n-year/notebooks/Frequency of N-Year Storms.ipynb | mit | from __future__ import absolute_import, division, print_function, unicode_literals
import pandas as pd
from datetime import datetime, timedelta
import operator
import matplotlib.pyplot as plt
import numpy as np
from collections import namedtuple
%matplotlib inline
n_year_storms = pd.read_csv('data/n_year_storms_ohare... |
liufuyang/deep_learning_tutorial | jizhi-pytorch-2/03_text_generation/Homework_3/Homeword_LSTM_Name_Generator.ipynb | mit | # 第一步当然是引入PyTorch及相关包
import torch
import torch.nn as nn
import torch.optim
from torch.autograd import Variable
import numpy as np
"""
Explanation: 火炬上的深度学习(下)第三节:神经网络莫扎特
课后作业:使用 LSTM 编写一个国际姓氏生成模型
在火炬课程中,我们学习了使用 LSTM 来生成 MIDI 音乐。这节课我们使用类似的方法,再创建一个 LSTM 国际起名大师!
完成后的模型能够像下面这样使用,指定一个国家名,模型即生成几个属于这个国家的姓氏。
```
python gene... |
Z0m6ie/Zombie_Code | Data_Science_Course/Michigan Data Analysis Course/0 Introduction to Data Science in Python/Week1/Week+1.ipynb | mit | x = 1
y = 2
x + y
x
"""
Explanation: You are currently looking at version 1.1 of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the Jupyter Notebook FAQ course resource.
The Python Programming Language: Functions
End of explanation
"""
d... |
paulovn/ml-vm-notebook | vmfiles/IPNB/Examples/a Basic/03 Matplotlib essentials.ipynb | bsd-3-clause | %matplotlib inline
"""
Explanation: Matplotlib
This notebook is (will be) a small crash course on the functionality of the Matplotlib Python module for creating graphs (and embedding it in notebooks). It is of course no substitute for the proper Matplotlib thorough documentation.
Initialization
We need to add a bit of... |
aoool/traffic-sign-classifier | Traffic_Sign_Classifier.ipynb | mit | # Load pickled data
import pickle
import pandas as pd
# Data's location
training_file = "traffic-sign-data/train.p"
validation_file = "traffic-sign-data/valid.p"
testing_file = "traffic-sign-data/test.p"
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(validation_file, mode='rb') as f:
... |
UDST/activitysim | activitysim/examples/example_estimation/notebooks/11_joint_tour_composition.ipynb | bsd-3-clause | import os
import larch # !conda install larch -c conda-forge # for estimation
import pandas as pd
"""
Explanation: Estimating Joint Tour Composition
This notebook illustrates how to re-estimate a single model component for ActivitySim. This process
includes running ActivitySim in estimation mode to read household t... |
CSC-IT-Center-for-Science/kajaani-science-days-workshop | data-analytics.ipynb | mit | # Luetaan loitsut, jotka alustavat ympäristön
from pandas import DataFrame, Series, read_csv
from numpy import vstack, round, random
from bokeh.plotting import figure, show, output_notebook, hplot
from bokeh.charts import Bar, Scatter
from bokeh._legacy_charts import HeatMap
from bokeh.palettes import YlOrRd9
output_no... |
astroumd/GradMap | notebooks/Haiti2016/Math.ipynb | gpl-3.0 | # setting a variable
a = 1.23
# just writing the variable will show it's value, but this is not the recommended
# way, because per cell only the last one will be printed and stored in the out[]
# list that the notebook maintains
a
a+1
# the right way to print is using the official **print** function in python
# ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/142c866d928b3d3a3a76c80e0ef4ea81/plot_rereference_eeg.ipynb | bsd-3-clause | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
from matplotlib import pyplot as plt
print(__doc__)
# Setup for reading the raw data
data_path = sample.data_path()
raw_fname = data_... |
diging/methods | 1.2 Change and difference/1.2.4 Comparing word use between corpora.ipynb | gpl-3.0 | from tethne.readers import wos
pj_corpus = wos.read('../data/Baldwin/PlantJournal/')
pp_corpus = wos.read('../data/Baldwin/PlantPhysiology/')
"""
Explanation: 1.2.4. Comparing word use between corpora
In previous notebooks we examined changes in word use over time using several different statistical approaches. In th... |
whitead/numerical_stats | unit_8/hw_2018/Homework_8_Key.ipynb | gpl-3.0 | from scipy import stats as ss
import numpy as np
data1 = np.array([0.41,2.69,3.82,0.42,1.20])
CI = 0.80
sample_mean = np.mean(data1)
sample_var = np.var(data1, ddof=1)
T = ss.t.ppf((1 - CI) / 2, df=len(data1)-1)
y = -T * np.sqrt(sample_var / len(data1))
print('{} +/ {}'.format(sample_mean, y))
"""
Explanation: Home... |
rmanak/nlp_tutorials | popcorn.ipynb | mit | import pandas as pd
import numpy as np
import re
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import cross_val_score
from os.path import join
from bs4 import BeautifulSoup
"""
Explanation:... |
poldrack/fmri-analysis-vm | analysis/connectivity/GrangerCausality.ipynb | mit | import os,sys
import numpy
%matplotlib inline
import matplotlib.pyplot as plt
import statsmodels.tsa.stattools
from dcm_sim import sim_dcm_dataset
sys.path.insert(0,'../')
from utils.graph_utils import show_graph_from_adjmtx,show_graph_from_pattern
# first we simulate some data using our DCM model, with the same HRF... |
swirlingsand/deep-learning-foundations | transfer-learning/Transfer_Learning.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... |
karlstroetmann/Artificial-Intelligence | Python/1 Search/Breadth-First-Search.ipynb | gpl-2.0 | def search(start, goal, next_states):
Frontier = { start }
Visited = set()
Parent = { start: start }
while Frontier:
NewFrontier = set()
for s in Frontier:
for ns in next_states(s):
if ns not in Visited and ns not in Frontier:
NewFrontie... |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/notebooks/docs/WinpythonSlim_checker.ipynb | bsd-3-clause | %matplotlib inline
"""
Explanation: WinpythonSlim Default checker
WinPythonSlim is a subset of WinPython, aiming for quick installation on a classrooms.
Command Line installation:
WinPython-32bit-3.4.3.7Slim.exe /S /DIR=you_target_directory
End of explanation
"""
# Matplotlib
from mpl_toolkits.mplot3d import axes3d
... |
ml4a/ml4a-guides | examples/models/BASNet.ipynb | gpl-2.0 | %tensorflow_version 1.x
!pip3 install --quiet ml4a
"""
Explanation: BASNet: Salient Object Detection
Outputs a mask of an image's salient objects (foreground). See the original code and paper.
Set up ml4a and enable GPU
If you don't already have ml4a installed, or you are opening this in Colab, first enable GPU (Runt... |
marcinofulus/ProgramowanieRownolegle | MPI/PR_MPI_Diffusion2d.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import os
print os.getenv("HOME")
wd = os.path.join( os.getenv("HOME"),"mpi_tmpdir")
if not os.path.isdir(wd):
os.mkdir(wd)
os.chdir(wd)
print "WD is now:",os.getcwd()
%%writefile mpi002.py
from mpi4py import MPI
import numpy as np
comm = MP... |
TrinVeerasiri/presta_to_woo_migration | add_user_nicename.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Add users nicename
After the web opening, admin tells the user that they have to change the password because we don't migrate them from Prestashop. The problem is old users don't have a user nicename, so they can't change their password. We solve this problem by copy the informatio... |
billzhao1990/CS231n-Spring-2017 | assignment2/.ipynb_checkpoints/BatchNormalization-checkpoint.ipynb | mit | # As usual, a bit of setup
from __future__ import print_function
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solv... |
jeffzhengye/pylearn | tensorflow_learning/tf2/notebooks/.ipynb_checkpoints/tf_keras_介绍_工程师版-checkpoint.ipynb | unlicense | import numpy as np
import tensorflow as tf
from tensorflow import keras
"""
Explanation: TensorFlow Keras 介绍-工程师版
Author: fchollet<br>
Date created: 2020/04/01<br>
Last modified: 2020/04/28<br>
Description: 使用TensorFlow keras高级api构建真实世界机器学习解决方案你所需要知道的 (Everything you need to know to use Keras to build real-world machi... |
dusenberrymw/systemml | samples/jupyter-notebooks/Image_Classify_Using_VGG_19.ipynb | apache-2.0 | !pip show systemml
"""
Explanation: Image Classification using Caffe VGG-19 model
This notebook demonstrates importing VGG-19 model from Caffe to SystemML and use that model to do an image classification. VGG-19 model has been trained using ImageNet dataset (1000 classes with ~ 14M images). If an image to be predicted... |
oscar6echo/ezhc | demo_ezhc.ipynb | mit | df = hc.sample.df_timeseries(N=2, Nb_bd=15+0*3700) #<=473
df.info()
display(df.head())
display(df.tail())
g = hc.Highstock()
g.chart.width = 650
g.chart.height = 550
g.legend.enabled = True
g.legend.layout = 'horizontal'
g.legend.align = 'center'
g.legend.maxHeight = 100
g.tooltip.enabled = True
g.tooltip.valueDecima... |
tbarrongh/cosc-learning-labs | src/notebook/03_interface_shutdown.ipynb | apache-2.0 | help('learning_lab.03_interface_shutdown')
"""
Explanation: COSC Learning Lab
03_interface_shutdown.py
Related Scripts:
* 03_interface_startup.py
* 03_interface_configuration.py
Table of Contents
Table of Contents
Documentation
Implementation
Execution
HTTP
Documentation
End of explanation
"""
from importlib impor... |
MinnowBoard/fishbowl-notebooks | TFT_LCD.ipynb | mit | # Get the Python Imaging Libraries for drawing shapes and working with images
import Image
import ImageDraw
import ImageFont
# Get our driver and GPIO libraries
import pyDrivers.ILI9341 as TFT
import Adafruit_GPIO.GPIO as GPIO
import Adafruit_GPIO.SPI as SPI
# Minnowboard MAX configuration.
DC = 25
RST = 26
SPI_PORT... |
mikelseverson/Udacity-Deep_Learning-Nanodegree | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
slundberg/shap | notebooks/tabular_examples/tree_based_models/Understanding Tree SHAP for Simple Models.ipynb | mit | import sklearn
import shap
import numpy as np
import graphviz
"""
Explanation: Understanding Tree SHAP for Simple Models
The SHAP value for a feature is the average change in model output by conditioning on that feature when introducing features one at a time over all feature orderings. While this is easy to state, it... |
cshankm/rebound | ipython_examples/Horizons.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add("Sun")
## Other examples:
# sim.add("Venus")
# sim.add("399")
# sim.add("Europa")
# sim.add("NAME=Ida")
sim.status()
"""
Explanation: Horizons
REBOUND can add particles to simulations by obtaining ephemerides from NASA's powerful HORIZONS database. HORIZONS supports m... |
computational-class/cjc | code/03.python_intro.ipynb | mit | %matplotlib inline
import random, datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import statsmodels.api as sm
from scipy.stats import norm
from scipy.stats.stats import pearsonr
"""
Explanation: 数据科学的编程工具
Python使用简介
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.... |
brian-rose/ClimateModeling_courseware | Lectures/Lecture12 -- CESM climate sensitivity.ipynb | mit | startingamount = 1.
amount = startingamount
for n in range(70):
amount *= 1.01
amount
"""
Explanation: ATM 623: Climate Modeling
Brian E. J. Rose, University at Albany
Lecture 12: Examing the transient and equilibrium CO$_2$ response in the CESM
Warning: content out of date and not maintained
You really should be ... |
mastertrojan/Udacity | 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... |
konstantinstadler/pymrio | doc/source/notebooks/working_with_wiod.ipynb | gpl-3.0 | import pymrio
wiod_storage = '/tmp/mrios/WIOD2013'
wiod_meta = pymrio.download_wiod2013(storage_folder=wiod_storage)
"""
Explanation: Handling the WIOD EE MRIO database
Getting the database
The WIOD database is available at http://www.wiod.org. You can download these files with the pymrio automatic downloader as des... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/regression_plots.ipynb | bsd-3-clause | %matplotlib inline
from statsmodels.compat import lzip
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import ols
plt.rc("figure", figsize=(16, 8))
plt.rc("font", size=14)
"""
Explanation: Regression Plots
End of explanation
"""
prestige = sm.datasets.ge... |
iRipVanWinkle/ml | Data Science UA - September 2017/Lecture 05 - Modeling Techniques and Regression/Logistic_Regression-Titanic.ipynb | mit | # import useful modules
import pandas as pd
from pandas import DataFrame
import re
import numpy as np
import matplotlib.pyplot as plt
try:
import seaborn as sns
except:
!pip install seaborn
%matplotlib inline
sns.set_style('whitegrid')
"""
Explanation: Logistic Regression - Titanic Example
In this notebook e... |
jhjungCode/pytorch-tutorial | 09_Flowers_tranfer_learning.ipynb | mit | !if [ ! -d "/tmp/flower_photos" ]; then curl http://download.tensorflow.org/example_images/flower_photos.tgz | tar xz -C /tmp ;rm /tmp/flower_photos/LICENSE.txt; fi
%matplotlib inline
"""
Explanation: Flowers transfer learning example
앞장에서는 수행한 Retaining시에 Batch size가 8이상 크면 컴퓨터의 사양에 따라서 메모리가 부족한 경우도 생길 수도 있습니다. 혹은 이... |
molgor/spystats | notebooks/Sandboxes/TensorFlow/.ipynb_checkpoints/BiospytialGaussianModels-checkpoint.ipynb | bsd-2-clause | run ../../../../traversals/tests.py
"""
Explanation: In this notebook I´ll create functions for easing the development of geostatistical models using the GPFlow (James H, et.al )the library for modelling gaussian processes in Tensor Flow (Google) (Great Library, btw).
Requirements
Inputs
Design Matrix X composed of c... |
nreimers/deeplearning4nlp-tutorial | 2015-10_Lecture/Lecture4/code/MNIST/Autoencoder.ipynb | apache-2.0 | import gzip
import cPickle
import numpy as np
import theano
import theano.tensor as T
import random
examples_per_labels = 10
# Load the pickle file for the MNIST dataset.
dataset = 'mnist.pkl.gz'
f = gzip.open(dataset, 'rb')
train_set, dev_set, test_set = cPickle.load(f)
f.close()
#train_set contains 2 entries, fi... |
charmasaur/digbeta | tour/traj_simulation.ipynb | gpl-3.0 | %matplotlib inline
import os
import math
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
random.seed(123456789)
data_dir = 'data/data-ijcai15'
#fvisit = os.path.join(data_dir, 'userVisits-Osak.csv')
#fcoord = os.path.join(data_dir, 'photoCoords-Osak.... |
malogrisard/NTDScourse | toolkit/02_sol_exploitation.ipynb | mit | import pandas as pd
import numpy as np
from IPython.display import display
import os.path
folder = os.path.join('..', 'data', 'social_media')
fb = pd.read_sql('facebook', 'sqlite:///' + os.path.join(folder, 'facebook.sqlite'), index_col='index')
tw = pd.read_sql('twitter', 'sqlite:///' + os.path.join(folder, 'twitter... |
babraham123/script-runner | notebooks/bubble_sort.ipynb | mit | import time
print('Last updated: %s' %time.strftime('%d/%m/%Y'))
"""
Explanation: Sebastian Raschka
End of explanation
"""
import platform
import multiprocessing
def print_sysinfo():
print('\nPython version :', platform.python_version())
print('compiler :', platform.python_compiler())
prin... |
ThyrixYang/LearningNotes | MOOC/stanford_cnn_cs231n/assignment1/two_layer_net.ipynb | gpl-3.0 | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
from __future__ import print_function
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['im... |
esa-as/2016-ml-contest | ar4/ar4_submission2.ipynb | apache-2.0 | # Import
from __future__ import division
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['figure.figsize'] = (20.0, 10.0)
inline_rc = dict(mpl.rcParams)
from classification_utilities import make_facies_log_plot
import pandas as pd
import numpy as np
import seaborn as sns
from ... |
nbortolotti/tensorflow-code-experiences | translations/es-ES/jupyter/constant_types.ipynb | apache-2.0 | shape_tensor = tf.zeros([2,3],tf.int32)
with tf.Session() as ses:
print ses.run(shape_tensor)
"""
Explanation: offitial documentation link
create tensors whose elements are of a specific value
End of explanation
"""
input_tensor_model = [[1,2],[3,4],[5,6]]
zeroslike_tensor = tf.zeros_like(input_tensor_model)
... |
matousc89/python-web-tutorials | HTML_and_JSON_processing.ipynb | mit | sample_html = """
<html>
<head>
<title>Test</title>
</head>
<body>
<h1>Heading!</h1>
<p class="major_content">Some content.</p>
<p class="minor_content">Some other content.</p>
</body>
</html>
"""
"""
Explanation: Processing of HTTP response - JSON and HTML
In this tuto... |
SBRG/ssbio | docs/notebooks/GEM-PRO - Genes & Sequences.ipynb | mit | import sys
import logging
# Import the GEM-PRO class
from ssbio.pipeline.gempro import GEMPRO
# Printing multiple outputs per cell
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
"""
Explanation: GEM-PRO - Genes & Sequences
This notebook gives an example of ... |
google/iree | samples/colab/mnist_training.ipynb | apache-2.0 | %%capture
!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://github.com/google/iree/releases
# Import IREE's TensorFlow Compiler and Runtime.
import iree.compiler.tf
import iree.runtime
"""
Explanation: ```
Copyright 2020 The IREE Authors
Licensed under the Apache License v2.0 with LLVM Except... |
tleonhardt/LearningCython | Learning_Cython_video/Chapter05/memview/loops.ipynb | mit | def p(n, m):
output = 0
for i in range(n):
output += i % m
return output
%timeit p(1000000, 42)
"""
Explanation: Plain Python: modulo (%) in a loop
End of explanation
"""
%%cython
def f(n, m):
output = 0
for i in range(n):
output += i % m
return output
%timeit f(1000000, 42... |
tbrx/compiled-inference | notebooks/Multilevel-Poisson.ipynb | gpl-3.0 | theta_est, params_est = multilevel_poisson.get_estimators()
theta_est.load_state_dict(torch.load('../saved/trained_poisson_theta.rar'))
params_est.load_state_dict(torch.load('../saved/trained_poisson_params.rar'))
true_t = np.array([94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5])
true_x = np.array([5, 1, 5,... |
phoebe-project/phoebe2-docs | 2.1/examples/binary_misaligned_spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Binary with Spots
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplotlib inline
im... |
GSimas/EEL7045 | Adicionais/derivada.ipynb | mit | from __future__ import division
from sympy import *
init_printing()
x, y = symbols('x y') #define x e y como variáveis simbólicas.
"""
Explanation: Este trabalho está licenciado sob a Licença Atribuição 4.0 Internacional Creative Commons. Para visualizar uma cópia desta licença, visite http://creativecommons.org/licen... |
macks22/gensim | docs/notebooks/Tensorboard_visualizations.ipynb | lgpl-2.1 | import gensim
import pandas as pd
import smart_open
import random
# read data
dataframe = pd.read_csv('movie_plots.csv')
dataframe
"""
Explanation: TensorBoard Visualizations
In this tutorial, we will learn how to visualize different types of NLP based Embeddings via TensorBoard. TensorBoard is a data visualization f... |
lindsayad/jupyter_notebooks | moose-notes.ipynb | mit | import sympy as sp
sxx, sxy, syx, syy, nx, ny = sp.var('sxx sxy syx syy nx ny')
s = sp.Matrix([[sxx, sxy],[syx, syy]])
n = sp.Matrix([nx, ny])
s*n
prod = n.transpose()*s*n
prod2 = n.transpose()*(s*n)
print(prod)
print(prod2)
print(prod==prod2)
prod.shape
sp.expand(prod) == sp.expand(prod2)
lhs = n.transpose()*s... |
chris1610/pbpython | notebooks/pandas-styling.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
from sparklines import sparklines
df = pd.read_excel('https://github.com/chris1610/pbpython/blob/master/data/2018_Sales_Total.xlsx?raw=true')
df.head()
"""
Explanation: Introduction to Pandas Style API
Content to accompany blog post on Practical Business Python
End of explanati... |
chloeyangu/BigDataAnalytics | Terrorisks/Code/.ipynb_checkpoints/BT4221- Code 1-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
terror = pd.read_csv('file.csv', encoding='ISO-8859-1')
cleanedforuse = terror.filter(['imonth', 'iday', 'region','property','propextent','attacktype1','weaptype1','nperps','success','multiple','specificity'])
final = cleanedforuse[~np.isnan(cleanedforuse).any(axis=1)]
final.head... |
strawberryLoU/the_end_of_day_two | DefensiveProgramming_3.ipynb | mit | def test_range_overlap():
assert range_overlap([(-3.0, 5.0), (0.0, 4.5), (-1.5, 2.0)]) == (0.0, 2.0)
assert range_overlap([ (2.0, 3.0), (2.0, 4.0) ]) == (2.0, 3.0)
assert range_overlap([ (0.0, 1.0), (0.0, 2.0), (-1.0, 1.0) ]) == (0.0, 1.0)
"""
Explanation: # Defensive programming (2)
We have seen the ba... |
peastman/deepchem | examples/tutorials/Modeling_Protein_Ligand_Interactions.ipynb | mit | !curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import conda_installer
conda_installer.install()
!/root/miniconda/bin/conda info -e
!pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Tutorial Part 13: Modeling Protein-Liga... |
ypeleg/Deep-Learning-Keras-Tensorflow-PyCon-Israel-2017 | .ipynb_checkpoints/2.4 Transfer Learning & Fine-Tuning-checkpoint.ipynb | mit | import numpy as np
import datetime
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_utils
from keras import backe... |
hamnonlineng/hamnonlineng | examples/Example_5th_order_Hamiltonian-linear_programming.ipynb | bsd-3-clause | import hamnonlineng as hnle
"""
Explanation: Find frequencies that make only $(\hat{a}^2\hat{b}^2+\hat{a}\hat{b}\hat{d}^2+\hat{d}^4)\hat{c}^\dagger +h.c.$ resonant in the 5th order expansion of $\sin(\hat{a}+\hat{b}+\hat{c}+\hat{d}+h.c.)$
Here we use linear programming instead of constraint programming and search for ... |
ashkamath/VQA | VQA/gru/gru_small_bilinear.ipynb | mit | # don't re-inventing the wheel
import h5py, json, spacy
import numpy as np
import cPickle as pickle
%matplotlib inline
import matplotlib.pyplot as plt
from model import LSTMModel
from utils import prepare_ques_batch, prepare_im_batch, get_batches_idx
"""
Explanation: Visual Question Answering with LSTM and VGG feat... |
bradkav/CEvNS | COHERENT.ipynb | mit | from __future__ import print_function
%matplotlib inline
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as pl
from scipy.integrate import quad
from scipy.interpolate import interp1d, UnivariateSpline,InterpolatedUnivariateSpline
from scipy.optimize import minimize
from tqdm imp... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/migration/UJ11 HyperParameter Tuning Training Job with TensorFlow.ipynb | apache-2.0 | ! pip3 install -U google-cloud-aiplatform --user
"""
Explanation: Vertex SDK: Submit a HyperParameter tuning training job with TensorFlow
Installation
Install the latest (preview) version of Vertex SDK.
End of explanation
"""
! pip3 install google-cloud-storage
"""
Explanation: Install the Google cloud-storage libr... |
aldian/tensorflow | tensorflow/python/ops/numpy_ops/g3doc/TensorFlow_NumPy_Keras_and_Distribution_Strategy.ipynb | apache-2.0 | !pip install --quiet --upgrade tf-nightly
import tensorflow as tf
import tensorflow.experimental.numpy as tnp
# Creates 3 logical GPU devices for demonstrating distribution.
gpu_device = tf.config.list_physical_devices("GPU")[0]
tf.config.set_logical_device_configuration(
gpu_device, [tf.config.LogicalDeviceConfi... |
NII-cloud-operation/Jupyter-LC_wrapper | examples/Summarizing and Logging.ipynb | bsd-3-clause | !!from time import sleep
for i in range(0, 100):
print(i)
sleep(0.1)
"""
Explanation: Summarizing and Logging
An example of the Summarizing and Logging mode.
Enabling the Summarizing and Logging mode
To enable the Summarizing and Logging mode, you should add !! at the beginning of the code cell.
End of explan... |
QuantStack/quantstack-talks | 2019-01-10-ESRF/notebooks/01.0.ipywidgets.ipynb | bsd-3-clause | 10 * 10
def f(x):
print(x * x)
f(9)
from ipywidgets import *
from traitlets import dlink
interact(f, x=(0, 100));
"""
Explanation: Jupyter Interactive widgets
The notebook comes alive with the interactive widgets:
Part of the Jupyter project
BSD Licensed
Installation for the legacy notebook:
bash
conda insta... |
tbenthompson/tectosaur | examples/notebooks/fullspace_qd_plotter.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import tectosaur as tct
import tectosaur.qd
import tectosaur.qd.plotting
tct.qd.configure(
gpu_idx = 0, # Which GPU to use if there are multiple. Best to leave as 0.
fast_plot = True, # Let's make fast, inexpensive figures. Set to false for higher resolution ... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_artifacts_correction_ssp.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
from mne.preprocessing import compute_proj_ecg, compute_proj_eog
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
raw.pick_typ... |
DBWangGroupUNSW/COMP9318 | L4 - Optimal Histogram.ipynb | mit | LARGE_NUM = 1000000000.0
EMPTY = -1
DEBUG = 2
#DEBUG = 1
import numpy as np
def sse(arr):
if len(arr) == 0: # deal with arr == []
return 0.0
avg = np.average(arr)
val = sum( [(x-avg)*(x-avg) for x in arr] )
return val
def calc_depth(b):
return 5 - b
def v_opt_rec(xx, b):
mincost = ... |
BBN-Q/Auspex | doc/examples/Example-SingleShot-Fid.ipynb | apache-2.0 | from QGL import *
from auspex.qubit import *
"""
Explanation: Example Q7: Single Shot Fidelity
This example notebook shows how to run single shot fidelity experiments
© Raytheon BBN Technologies 2019
End of explanation
"""
cl = ChannelLibrary("my_config")
pl = PipelineManager()
"""
Explanation: We use a pre-existin... |
sangheestyle/ml2015project | howto/model11_GMM_fixed.ipynb | mit | import gzip
import pickle
from os import path
from collections import defaultdict
from numpy import sign
"""
Load buzz data as a dictionary.
You can give parameter for data so that you will get what you need only.
"""
def load_buzz(root='../data', data=['train', 'test', 'questions'], format='pklz'):
buzz_data = {... |
opencb/opencga | opencga-client/src/main/python/notebooks/general-notebooks/pyopencga_basic_notebook_002-coverage.ipynb | apache-2.0 | # Initialize PYTHONPATH for pyopencga
import sys
import os
from pprint import pprint
cwd = os.getcwd()
print("current_dir: ...."+cwd[-10:])
base_modules_dir = os.path.dirname(cwd)
print("base_modules_dir: ...."+base_modules_dir[-10:])
sys.path.append(base_modules_dir)
from pyopencga.opencga_config import ConfigClie... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/text_classification/labs/text_classification_with_TFHub.ipynb | apache-2.0 | !pip install tensorflow-hub
!pip install tensorflow-datasets
import os
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
print("Version: ", tf.__version__)
print("Eager mode: ", tf.executing_eagerly())
print("Hub version: ", hub.__version__)
print("GPU is", "a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.