repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Lolcroc/AI | ML1/lab1.ipynb | gpl-3.0 | NAME = "Michelle Appel"
NAME2 = "Verna Dankers"
NAME3 = "Yves van Montfort"
EMAIL = "michelle.appel@student.uva.nl"
EMAIL2 = "verna.dankers@student.uva.nl"
EMAIL3 = "yves.vanmontfort@student.uva.nl"
"""
Explanation: Save this file as studentid1_studentid2_lab#.ipynb
(Your student-id is the number shown on your student... |
unpingco/python_for_prob_stats_ml | chapters/statistics/notebooks/Nonparametric.ipynb | mit | from __future__ import division
%pylab inline
from pprint import pprint
import textwrap
import sys, re
old_displayhook = sys.displayhook
def displ(x):
if x is None: return
print "\n".join(textwrap.wrap(repr(x).replace(' ',''),width=80))
sys.displayhook=displ
"""
Explanation: Python for Probability, Statistics,... |
tensorflow/docs-l10n | site/ja/tensorboard/tensorboard_in_notebooks.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... |
raman-sharma/stanford-mir | mfcc.ipynb | mit | url = 'http://audio.musicinformationretrieval.com/simple_loop.wav'
urllib.urlretrieve(url, filename='simple_loop.wav')
"""
Explanation: ← Back to Index
Mel Frequency Cepstral Coefficients (MFCCs)
The mel frequency cepstral coefficients (MFCCs) of a signal are a small set of features (usually about 10-20) which co... |
martinggww/lucasenlights | MachineLearning/DataScience-Python3/TopPages.ipynb | cc0-1.0 | import re
format_pat= re.compile(
r"(?P<host>[\d\.]+)\s"
r"(?P<identity>\S*)\s"
r"(?P<user>\S*)\s"
r"\[(?P<time>.*?)\]\s"
r'"(?P<request>.*?)"\s'
r"(?P<status>\d+)\s"
r"(?P<bytes>\S*)\s"
r'"(?P<referer>.*?)"\s'
r'"(?P<user_agent>.*?)"\s*'
)
"""
Explanation: Cleaning Your Data
Let'... |
GeoNet/fits | examples/Notebook_5.ipynb | apache-2.0 | # Import packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Define functions
def build_query(typeID, typeIDtype, typeinfo = False):
'''
Take data / method type and generate a FITS API query for an JSON file.
Valid typeIDtypes are 'methodID' and 'typeID'
typeinfo is... |
malcolmrh/solar-terrain | .ipynb_checkpoints/scratchbook-checkpoint.ipynb | mit | with open ('inputs/site.geojson') as f:
js = json.load(f)
s = shape(js['features'][0]['geometry'])
s
"""
Explanation: DEM analysis
Load site using shapely
End of explanation
"""
dem = gdal.Open('inputs/dem/filled.tif')
"""
Explanation: Load digital elevation model
End of explanation
"""
site = ogr.Geometry(o... |
arcyfelix/Courses | 17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/07-Stock-Market-Analysis-Capstone-Project/Stock Market Analysis Project.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
<center>Copyright Pierian Data 2017</center>
<center>For more information, visit us at www.pieriandata.com</center>
Stock Market A... |
rrbb014/data_science | fastcampus_dss/2016_05_18/0518_04__웹 플롯을 위한 bokeh 패키지 소개.ipynb | mit | import urllib
url = 'http://ichart.yahoo.com/table.csv?s=MSFT&a=0&b=1&c=2009'
data = pd.read_csv(url, parse_dates=['Date'])
"""
Explanation: 웹 플롯을 위한 bokeh 패키지 소개
bokeh 의 기법: 메인을 blur, 배경을 포커스잡는..
Bokeh ( http://bokeh.pydata.org )는 웹사이트에서 현대적인 웹 기반 인터랙티브 플롯을 제공하는 것을 목표로 만든 파이썬 라이브러리이다.
여기에서는 "파이썬을 활용한 금융분석(Python f... |
mbatchkarov/ExpLosion | notebooks/verb_phrases.ipynb | bsd-3-clause | s = {'document_features_ev': 'SVO',
'document_features_tr': 'J+N+V+SVO',
'expansions__allow_overlap': 0,
'expansions__decode_handler': 'SignifiedOnlyFeatureHandler',
'expansions__entries_of_id': None,
'expansions__k': 3,
'expansions__neighbour_strategy': 'linear',
'expansions__noise': 0.0,
... |
LimeeZ/phys292-2015-work | assignments/assignment04/MatplotlibEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo... |
jg1141/deep-learning-nanodegree | 20170226 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'
class DLProgress(tqdm):
last_block = 0
def hoo... |
david4096/bioapi-examples | python_notebooks/pileup.ipynb | apache-2.0 | Widget()
"""
Explanation: Query for pile-up allignments at region "X"
We can query the API services to obtain reads from a given readgroupset such that we are able to make a pileup for any specified region
NOTE: Under the "Kernel" tab above, do "Restart & Run All" then uncomment the first cell and run it individually
... |
smorton2/think-stats | code/chap13ex.ipynb | gpl-3.0 | from __future__ import print_function, division
%matplotlib inline
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
import numpy as np
import pandas as pd
import random
import thinkstats2
import thinkplot
"""
Explanation: Examples and Exercises from Think Stats, 2nd Edition
http://thinkst... |
miqlar/PyFME | examples/examples-notebook/example_003.ipynb | mit | # -*- coding: utf-8 -*-
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pyfme.aircrafts import Cessna310
from pyfme.environment.environment import Environment
from pyfme.environment.atmosphere import ISA1976
from pyfme.environment.gravity import Verti... |
liulixiang1988/data-science-learning | examples/Ex-Titanic/sample-1-titanic.ipynb | mit | import pandas
titanic = pandas.read_csv("titanic_train.csv")
titanic.head()
print(titanic.describe())
"""
Explanation: 泰坦尼克获救情况分析
https://www.kaggle.com/c/titanic
数据描述
PassengerId:乘客ID
Survived:是否获救了
Pclass:几等仓
Name:姓名
Sex:性别
Age:年龄
SibSp:兄弟姐妹数量
Parch:带了几个老人孩子
Ticket:船的编号
Fare:买船票花费
Cabin:有大量缺失值
Embarked:
数据预处理
End... |
maxalbert/tohu | notebooks/v7/Primitive_generators.ipynb | mit | import tohu
from tohu.v7.primitive_generators import *
from tohu.v7.utils import print_generated_sequence
print(f'Tohu version: {tohu.__version__}')
"""
Explanation: Primitive generators
This notebook contains tests for tohu's primitive generators.
End of explanation
"""
g = Constant('quux')
print_generated_sequen... |
janesjanes/sketchy | code/Compute_Sketchy_score.ipynb | mit | import numpy as np
from pylab import *
%matplotlib inline
import os
import sys
"""
Explanation: This script is for computing the performance of the network on our sketchy benchmark.
End of explanation
"""
#TODO: specify your caffe root folder here
caffe_root = "X:\caffe_siggraph/caffe-windows-master"
sys.path.insert... |
simonward86/MySJcLqwwx | Strategy_Analysis.ipynb | apache-2.0 | %pylab inline
pylab.rcParams['figure.figsize'] = (10, 6)
# Import packages
from datetime import datetime
import Methods as models
import Predictors as predictors
import stock_tools as st
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib import gridspec
import ML_predict as strat
"""
Explanation: Tes... |
scikit-optimize/scikit-optimize.github.io | 0.7/notebooks/auto_examples/parallel-optimization.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
"""
Explanation: Parallel optimization
Iaroslav Shcherbatyi, May 2017.
Reviewed by Manoj Kumar and Tim Head.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Introduction
For many practical black box optimization problems expensive objective can be
evaluated in parallel ... |
fantasycheng/udacity-deep-learning-project | tutorials/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)
"... |
mlund/faunus-notebooks | tabulated-potential/nb.ipynb | mit | from __future__ import division, unicode_literals, print_function
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np, pandas as pd
import os.path, os, sys, json, filecmp, copy
plt.rcParams.update({'font.size': 16, 'figure.figsize': [8.0, 6.0]})
try:
workdir
except NameErr... |
kaiping/incubator-singa | doc/en/docs/notebook/core.ipynb | apache-2.0 | from singa import device
default_dev = device.get_default_device()
gpu = device.create_cuda_gpu() # the first gpu device
gpu
"""
Explanation: SINGA Core Classes
<img src="http://singa.apache.org/en/_static/images/singav1-sw.png" width="500px"/>
Device
A device instance represents a hardware device with multiple execu... |
phoebe-project/phoebe2-docs | 2.0/examples/legacy_contact_binary.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2.0. In order to run this backend, you'll need to have PHOEBE 1.0 installed.
Setup
Let's first make sure we have the latest vers... |
qgoisnard/Exercice-update | Exercice 2.ipynb | mit | %matplotlib inline
from sympy.interactive import printing
printing.init_printing()
from frame import *
import sympy as sp
import numpy as np
"""
Explanation: Exercice 2
End of explanation
"""
E=1.3 #en MPa
h=7.5 #en mm
b=20. #en mm
Lx=55. #en mm
Lyh=60. #en mm
Lyb=45 #en mm
I=b*(h**3)/12 #en mm^4
S=b*h #en mm^2
e... |
fastai/course-v3 | nbs/dl2/09b_learner.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#export
from exp.nb_09 import *
AvgStats
"""
Explanation: Let's kill off Runner
End of explanation
"""
path = datasets.untar_data(datasets.URLs.IMAGENETTE_160)
tfms = [make_rgb, ResizeFixed(128), to_byte_tensor, to_float_tensor]
bs=64
il = ImageList.from_fil... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/feature_engineering/labs/4_keras_adv_feat_eng-lab.ipynb | apache-2.0 | import datetime
import logging
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow import feature_column as fc
from tensorflow.keras import layers
from tensorflow.keras import models
# set TF error log verbosity
logging.getLogger("tensorflow").setLevel(logging.ERROR)
... |
jmlon/PythonTutorials | scipy/scipyIntegration.ipynb | gpl-3.0 | import scipy.integrate as integrate
import numpy as np
"""
Explanation: scipy : Integración numérica
Se importa el módulo de integración de scipy
End of explanation
"""
def functionA(x,a):
return 1.0/(x**2+a**2)
"""
Explanation: Integración de una función
Tomemos por ejemplo la función
$$f(x) = \frac{1}{x^2+a^2... |
james-prior/cohpy | 20160708-dojo-easier-to-ask-for-forgiveness-than-permission-type-conversion.ipynb | mit | import csv
import io
"""
Explanation: In many other languages, once you have an error,
the program crashes and is over.
So before doing something that could crash the program,
one checks the input before doing that something.
This is called
"look before you leap"
or LBYL.
In Python, one often has another option,
which... |
mikecharles/palettable | demo/Palettable Demo.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Palettable
Find Palettable online:
Docs: https://jiffyclub.github.io/palettable/
GitHub: https://github.com/jiffyclub/palettable
PyPI: https://pypi.python.org/pypi/palettable/
End of explanation
"""
from palettable.colorbrewer.q... |
survey-methods/samplics | docs/source/tutorial/eblup_unit_model.ipynb | mit | import numpy as np
import pandas as pd
import samplics
from samplics.datasets import CountyCrop, CountyCropMeans
from samplics.sae import EblupUnitModel
# Load County Crop sample data
countycrop_cls = CountyCrop()
countycrop_cls.load_data()
countycrop = countycrop_cls.data
nb_obs = 15
print(f"\nFirst {nb_obs} observ... |
greulist137/deep-learning-master | first-neural-network/Your_first_neural_network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
AlexandruValeanu/365-days-of-algorithms | Day 11 - Closest pair of points.ipynb | gpl-3.0 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from operator import itemgetter
%matplotlib inline
def euclid_distance(p, q):
return np.sqrt((p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2)
def search(points, st, dr):
if st >= dr:
return np.inf, None, None
elif st + 1 == dr:
... |
azubiolo/itstep | it_step/intro_ml/lab_4/kmeans_implementation.ipynb | mit | %matplotlib inline
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
# Initial data
n_samples = 1500
random_state = 8
X, y = make_blobs(n_samples=n_samples, centers=3, random_state=random_state)
pl... |
johntanz/ROP | Old Code/ROPFinal160302.ipynb | gpl-2.0 | from ROP import *
#Takes a little bit, wait a while.
#ROP Number syntax: ###
#Eye Drop syntax: HH MM HH MM HH MM
#Exam Syntax: HH MM HH MM
"""
Explanation: ROP Exam Analysis for NIRS and Pulse Ox
Finalized notebook to combine Masimo and NIRS Data into one iPython Notebook.
Select ROP Subject Number and Input Times
End... |
kazuhirokomoda/deep_learning | fast.ai/lesson1/dogscats_run.ipynb | mit | # make some Python3 functions available on Python2
from __future__ import division, print_function
import sys
print(sys.version_info)
import theano
print(theano.__version__)
import keras
print(keras.__version__)
# FloydHub: check data
%ls /input/dogscats/
# check current directory
%pwd
%ls
# see some files are lo... |
phoebe-project/phoebe2-docs | 2.2/tutorials/requiv_crit_contact.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Critical Radii: Contact Systems
Setup
Let's first make sure we have the latest version of PHOEBE 2.2 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
"""
%matplot... |
Thomas-Schatz/vowel-discri | tests/MFCC.ipynb | mit | %matplotlib inline
"""
Explanation: Testing MFCC feature extraction
This requires vowel_discri to be on the python path.
End of explanation
"""
import soundfile
import vowel_discri.mfcc as mfcc
import matplotlib.pyplot as plt
import seaborn as sns
data, fs = soundfile.read('./bras.wav')
assert fs == 16000
coefs = ... |
nerdcommander/scientific_computing_2017 | lesson2/Lesson2_preactivity.ipynb | mit | ## your code here
## or
## type what you put in calculator (safer to convert cell to markdown)
"""
Explanation: Unit 1: Programming Basics
Lesson 2: Writing Useful Functions - Pre-activity
Scientific Context: Coordinate Systems
The coordinate system is a method of specifying points of interest by defining distances f... |
yassineAlouini/ml-experiments | deep-learning/keras-tutorials/keras_simple_image_classification.ipynb | mit | ## Keras related imports
from keras.datasets import mnist
from keras.models import Sequential, model_from_json
from keras.layers import Activation, Dropout, Flatten, Dense, Convolution2D, MaxPooling2D
from keras.utils import np_utils, data_utils, visualize_util
from keras.preprocessing.image import load_img, img_to_ar... |
dduong1/DIMSUM-Algorithm | DIMSUM_FINAL_MACHRAOUI_DUONGPRUNIER.ipynb | gpl-3.0 | import pyensae
import os
blobstorage = "hdblobstorage" #blobhp["blob_storage"]
blobpassword = "jQIPVO/T54w8X49UPIbzAVvaNO3wmuUwI4/o9AJnCaPTHoCQnsaGBUkT4eIyi0BRQavgc/TAQMQwy8eu19CSBQ==" #blobhp["password1"]#
hadoop_server = "sparkclus2ensae"#blobhp["hadoop_server"]#
hadoop_password = "ENSAEspark1;"#blobhp["password2"]#
... |
tiagoft/inteligencia_computacional | bayesiano.ipynb | mit | # Inicializacao
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
# Abrindo conjunto de dados
import csv
with open("biometria.csv", 'rb') as f:
dados = list(csv.reader(f))
rotulos_volei = [d[0] for d in dados[1:-1] if d[0] is 'V']
rotulos_futebol = [d[0] for d in dados[1:-1] if d[0] ... |
zklgame/CatEyeNets | test/svm.ipynb | mit | import os
os.chdir(os.getcwd() + '/..')
# Run some setup code for this notebook
import random
import numpy as np
import matplotlib.pyplot as plt
from utils.data_utils import load_CIFAR10
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = ... |
teuben/astr288p | notebooks/n6503-case2.ipynb | mit | %matplotlib inline
# python 2-3 compatibility
from __future__ import print_function
"""
Explanation: Spectral Line Data Cubes in Astronomy - Part 2 (unfinished)
We are doing a complete re-analysis of the same NGC 6503 case, but now with more tools that the community has developed. For this you will need to modify you... |
mclaughlin6464/pearce | notebooks/Pearce Delta Sigma Comparison to Theory.ipynb | mit | from pearce.mocks import cat_dict
import numpy as np
from os import path
from astropy.io import fits
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
z_bins = np.array([0.15, 0.3, 0.45, 0.6, 0.75, 0.9])
zbin=1
a = 0.81120
z = 1.0/a - 1.0... |
marioberges/F16-12-752 | lectures/Lecture4.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import datetime as dt
import itertools
%matplotlib inline
"""
Explanation: Lecture #4: Implementing Tools from Paper #1
In this lecture we will learn about two things: Exploratory Data Analysis (EDA) and clustering. The first, is a set of techniqu... |
kubeflow/fairing | examples/prediction/xgboost-gkeop.ipynb | apache-2.0 | !pip install -r requirements.txt
import argparse
import logging
import joblib
import sys
import pandas as pd
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from xgboost import XGBRegressor
logging.basicConfig(format='%(mess... |
mdda/pycon.sg-2015_deep-learning | ipynb/_TODO_7-LSTM-as-Author.ipynb | mit | import numpy
import theano
from theano import tensor
from blocks.bricks import Tanh
from blocks.bricks.recurrent import GatedRecurrent
from blocks.bricks.sequence_generators import (SequenceGenerator, Readout, SoftmaxEmitter, LookupFeedback)
from blocks.graph import ComputationGraph
import blocks.algorithms
from bloc... |
maxhutch/thesis-notebooks | Bubble height and velocity.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline
from scipy.optimize import bisect
import json
from functools import partial
class Foo: pass
"""
Explanation: F... |
GoogleCloudPlatform/healthcare | ml_solutions/synthea_bqml_automl.ipynb | apache-2.0 | from google.colab import auth
auth.authenticate_user()
credentials = auth._check_adc()
print(credentials)
"""
Explanation: Introduction
This tutorial shows how to use Google Cloud Platform technologies to work with structured healthcare data to build a predictive model.
Synthea
Synthea is a data generator that simulat... |
Arn-O/kadenze-deep-creative-apps | session-5/lecture-5.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')
... |
etendue/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... |
leriomaggio/python-in-a-notebook | 11 Persistence.ipynb | mit | import sqlite3
conn = sqlite3.connect('data/dbase1')
"""
Explanation: Persistence
In this notebook, our focus is on persistent data — the kind that outlives a program that creates it.
That’s not true by default for objects a script constructs, of course; things like lists, dictionaries, and even class instance object... |
tensorflow/docs-l10n | site/zh-cn/tensorboard/tensorboard_in_notebooks.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... |
LocalGroupAstrostatistics2015/MCMC | MCMC tutorial (solutions).ipynb | mit | name = "YOUR NAME HERE"
print("Hello {0}!".format(name))
"""
Explanation: Practical MCMC in Python
by Dan Foreman-Mackey
A worksheet for the Local Group Astrostatistics workshop at the University of Michigan, June 2015.
Introduction
In this notebook, we'll implement a Markov Chain Monte Carlo (MCMC) algorithm and dem... |
grantjenks/pyannote-core | notebook/pyannote.core.annotation.ipynb | mit | from pyannote.core import Annotation
"""
Explanation: Annotation (pyannote.core.annotation.Annotation)
End of explanation
"""
annotation = Annotation(
uri='TheBigBangTheory.Season01.Episode01',
modality='speaker'
)
"""
Explanation: Annotation instances are used to describe sets of annotated temporal fragme... |
coolharsh55/advent-of-code | 2016/python3/Day08.ipynb | mit | DISPLAY_ROWS = 6 # screen is 6 pixels tall
DISPLAY_COLS = 50 # screen is 50 pixels wide
display = [ # set display pixels to False
[False for i in range(0, DISPLAY_COLS)]
for i in range(0, DISPLAY_ROWS)]
"""
Explanation: Day 8: Two-Factor Authentication
author: Harshvardhan Pandit
license: MIT
link to pro... |
AllenDowney/ThinkBayes2 | examples/dirichlet.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 numpy as np
import pandas as pd
# import classes from thinkbayes2
from thinkbayes2 import Pmf, Cd... |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/20 Feature Selection.ipynb | apache-2.0 | from sklearn.datasets import load_breast_cancer, load_digits
from sklearn.model_selection import train_test_split
cancer = load_breast_cancer()
# get deterministic random numbers
rng = np.random.RandomState(42)
noise = rng.normal(size=(len(cancer.data), 50))
# add noise features to the data
# the first 30 features ar... |
brettavedisian/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
"""
Image(filename='communitycollege.png')
# The pictures weren't put in the original submission for some reason. Here is the first one
"""
Explanation: Graphical excellence and integrity
Fi... |
Gezort/YSDA_deeplearning17 | Seminar10/Seminar10-RNN-homework-ru.ipynb | mit |
#тут будет текст
corpora = ""
for fname in os.listdir("codex"):
import sys
if sys.version_info >= (3,0):
with open("codex/"+fname, encoding='cp1251') as fin:
text = fin.read() #If you are using your own corpora, make sure it's read correctly
corpora += text
else:
... |
Yu-Group/scikit-learn-sandbox | jupyter/backup_deprecated_nbs/02_Feature_Importance.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.ensemble import ExtraTreesClassifier
# Set seed for reproducibility
np.random.seed(200)
# Build a classification task using 3 informative features
X, y = make_classification(n_samples=1000,
... |
jdsanch1/SimRC | 02. Parte 2/09. Clase 9/09Class NB (diego-pc's conflicted copy 2017-09-20).ipynb | mit | #importar los paquetes que se van a usar
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import datetime
from datetime import datetime
import scipy.stats as stats
import scipy as sp
import scipy.optimize as scopt
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn.covariance... |
SHDShim/pytheos | examples/6_p_scale_test_Dorogokupets2015_MgO.ipynb | apache-2.0 | %config InlineBackend.figure_format = 'retina'
"""
Explanation: For high dpi displays.
End of explanation
"""
import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy as unp
import pytheos as eos
"""
Explanation: 0. General note
This example compares pressure calculated from pytheos and o... |
simonsfoundation/CaImAn | demos/notebooks/demo_seeded_CNMF.ipynb | gpl-2.0 | import bokeh.plotting as bpl
import logging
import matplotlib.pyplot as plt
import numpy as np
import cv2
from glob import glob
try:
cv2.setNumThreads(0)
except():
pass
try:
if __IPYTHON__:
get_ipython().magic('load_ext autoreload')
get_ipython().magic('autoreload 2')
except NameError:
... |
theandygross/HIV_Methylation | Setup/clinical_figure.ipynb | mit | regimen = clinical['Regimen Type'].ix[pts].dropna()
print regimen.value_counts()
regimen = regimen[regimen.map(regimen.value_counts()) > 10]
regimen = regimen.ix[pts].fillna('Other')
regimen = regimen.str.replace(' Based','')
regimen = regimen.ix[ti(duration != 'Control')]
regimen.value_counts()
adherence = clinical[... |
ueapy/ueapy.github.io | content/notebooks/2020-08-06-pyproj.ipynb | mit | origin = (1.297, 52.630)
land_10m = cartopy.feature.NaturalEarthFeature('physical', 'coastline', '10m',
edgecolor='k', facecolor='palegreen')
ax = plt.axes(projection=ccrs.AlbersEqualArea()) # note the use of an equal-area projection
ax.add_feature(land_10m, zorder=-1)
ax.scatt... |
seblabbe/MATH2010-Logiciels-mathematiques | ipynb-cours/16-04-19.ipynb | gpl-3.0 | a = 6
b = 15
if a < b:
m = a
else:
m = b
m
m = a if a < b else b
m
"""
Explanation: 13 Boucle for
Syntaxe :
for ELEMENT in LISTE: # ligne d'en-tête se terminant par ":"
INSTRUCTION #1 # bloc d'instructions indenté de 4 espaces
INSTRUCTION #2
INSTRUCTION #3
14 Conditions if
Syn... |
Kaggle/learntools | notebooks/sql/raw/ex3.ipynb | apache-2.0 | # Set up feedback system
from learntools.core import binder
binder.bind(globals())
from learntools.sql.ex3 import *
print("Setup Complete")
"""
Explanation: Introduction
Queries with GROUP BY can be powerful. There are many small things that can trip you up (like the order of the clauses), but it will start to feel na... |
jgarciab/wwd2017 | class5/class5_stats2.ipynb | gpl-3.0 | ##Some code to run at the beginning of the file, to be able to show images in the notebook
##Don't worry about this cell
#Print the plots in this screen
%matplotlib inline
#Be able to plot images saved in the hard drive
from IPython.display import Image
#Make the notebook wider
from IPython.core.display import dis... |
Ex-Mente/auxi.0 | auxi/examples/tools/materialphysicalproperties/idealgas.ipynb | lgpl-3.0 | # import some tools to use in this example
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Working with auxi's Ideal Gas Models
Purpose
The purpose of this example is to introduce and demonstrate the idealgas model classes in auxi's material physical property tools package.
Back... |
mne-tools/mne-tools.github.io | 0.22/_downloads/ef89d1f7daeb4e357098461753c3af0f/plot_source_alignment.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import nibabel as nib
from scipy import linalg
import mne
from mne.io.constants import FIFF
data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
trans_fname = op.join(... |
chengsoonong/mclass-sky | projects/david/lab/experiment_active_diabetes.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import active
import experiment
import logistic_regression as logr
from sklearn import datasets # The Iris dataset is imported from here.
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 1
%aimport active
%aim... |
fpavogt/pyqz | docs/source/pyqz_demo_basic.ipynb | gpl-3.0 | %matplotlib inline
import pyqz
import numpy as np
"""
Explanation: Running pyqz I
A) Installing and importing pyqz
Installing pyqz is best done via pip. You should then be able to import the package and check its version from within any Python shell:
End of explanation
"""
import pyqz.pyqz_plots as pyqzp
"""
Expla... |
ledeprogram/algorithms | class6/donow/Kromrei_Georgia_donow_6.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt # package for doing plotting (necessary for adding the line)
import statsmodels.formula.api as smf # package we'll be using for linear regression
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regre... |
nikbearbrown/Deep_Learning | NEU/Sai_Raghuram_Kothapalli_DL/Hands_on_Keras_Tutorial.ipynb | mit | from keras.models import Sequential
from keras.layers import Dense, Activation
model = Sequential([
Dense(32, input_shape=(784,)),
Activation('relu'),
Dense(10),
Activation('softmax'),
])
"""
Explanation: The Sequential model is a linear stack of layers.
You can create a Sequential model by passing a ... |
anhquan0412/deeplearning_fastai | deeplearning1/nbs/lesson6.ipynb | apache-2.0 | path = get_file('nietzsche.txt', origin="https://s3.amazonaws.com/text-datasets/nietzsche.txt")
text = open(path).read()
print('corpus length:', len(text))
chars = sorted(list(set(text)))
vocab_size = len(chars)+1
print('total chars:', vocab_size)
"""
Explanation: Setup
We're going to download the collected works of ... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec4_1_Capillary_rise.ipynb | gpl-3.0 | import nbconvert
"""
Explanation: Section 4.1.
Suction and capillary fringe thickness (p 20)
How much capillary rise can we expect depending on pore radius?
(see exercise 14 on page 27 of the syllabus.
T.N. Olsthoorn (2018-12-30)
End of explanation
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotl... |
beangoben/HistoriaDatos_Higgs | Dia3/.ipynb_checkpoints/8_Arboles_y_Bosques_de_decisión-checkpoint.ipynb | gpl-2.0 | import numpy as np
import sklearn as sk
import matplotlib.pyplot as plt
import sklearn.datasets as datasets
import seaborn as sns
%matplotlib inline
"""
Explanation: <i class="fa fa-book"></i> Primero librerias
End of explanation
"""
centers = [[1, 1], [-1, -1], [1, -1]]
X,Y = datasets.make_blobs(n_samples=1000, cen... |
facemelters/data-science | Atlas/Atlas Tag Regression.ipynb | gpl-2.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: The project I am angling towards deals with my website's traffic and taxonomy data. I will be trying to build models that can accurately predict which tags are best for specific channels of traffic, and will also... |
tpin3694/tpin3694.github.io | python/pandas_map_values_to_values.ipynb | mit | import pandas as pd
"""
Explanation: Title: Map External Values To Dataframe Values in Pandas
Slug: pandas_map_values_to_values
Summary: Map External Values To Dataframe Values in Pandas
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules
End of explanation
"""
raw_data... |
yangw1234/BigDL | python/chronos/use-case/network_traffic/network_traffic_autots_customized_model.ipynb | apache-2.0 | import matplotlib.pyplot as plt
def plot_predict_actual_values(date, y_pred, y_test, ylabel):
"""
plot the predicted values and actual values (for the test data)
"""
fig, axs = plt.subplots(figsize=(16, 6))
axs.plot(date, y_pred, color='red', label='predicted values')
axs.plot(date, y_test, col... |
DJCordhose/ai | notebooks/workshops/deep-learning/nn.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import pandas as pd
print(pd.__version__)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
"""
Explanation: Neural Networks with TensorFlow and Keras
End of explanation
"""
!curl -O https://r... |
dwhswenson/openpathsampling | examples/misc/reactive_flux.ipynb | mit | depth = -0.7
width = 5.0
gaussian_A_depth = depth
gaussian_A_alpha = np.array([width, width])
gaussian_A_center = np.array([-0.5, -0.5])
gaussian_B_depth = depth
gaussian_B_alpha = np.array([width, width])
gaussian_B_center = np.array([0.5, 0.5])
pes = (
toys.OuterWalls([1.0, 1.0], [0.0, 0.0]) +
toys.Gau... |
Jackporter415/phys202-2015-work | assignments/midterm/AlgorithmsEx03.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact
"""
Explanation: Algorithms Exercise 3
Imports
End of explanation
"""
def char_probs(s):
"""Find the probabilities of the unique characters in the string s.
Parameters
----------
... |
sraejones/phys202-2015-work | assignments/assignment09/IntegrationEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import integrate
import math as m
"""
Explanation: Integration Exercise 2
Imports
End of explanation
"""
def integrand(x, a):
return 1.0/(x**2 + a**2)
def integral_approx(a):
# Use the args keyword argumen... |
jay-johnson/sci-pype | examples/ML-IRIS-Redis-Labs-Import-From-S3.ipynb | apache-2.0 | # Setup the Sci-pype environment
import sys, os
# Only Redis Labs is needed for this notebook:
os.environ["ENV_DEPLOYMENT_TYPE"] = "RedisLabs"
# Load the Sci-pype PyCore as a named-object called "core" and environment variables
from src.common.load_ipython_env import *
"""
Explanation: Importing the IRIS XGB Models ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/05_artandscience/a_handtuning.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
"""
Explanation: Hand tuning hyperparameters
Learning Objectives:
* Use the LinearRegressor class in TensorFlow to predict median housing price, at the granularity of city blocks, based on one input feature
* Evaluate the accuracy of a model's pred... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/supplemental_gradient_boosting/labs/b_boosted_trees_estimator.ipynb | apache-2.0 | # We will use some np and pandas for dealing with input data.
import numpy as np
import pandas as pd
# And of course, we need tensorflow.
import tensorflow as tf
from distutils.version import StrictVersion
tf.__version__
"""
Explanation: Introduction
In this notebook, we will
- Learn how to use BoostedTrees Classif... |
scotthuang1989/Python-3-Module-of-the-Week | concurrency/asyncio/Synchronization Primitives.ipynb | apache-2.0 | # %load asyncio_lock.py
import asyncio
import functools
def unlock(lock):
print('callback releasing lock')
lock.release()
async def coro1(lock):
print('coro1 waiting for the lock')
with await lock:
print('coro1 acquired lock')
print('coro1 released lock')
async def coro2(lock):
pri... |
erikdrysdale/erikdrysdale.github.io | _rmd/extra_ordinal/ordinal_regression.ipynb | mit | import numpy as np
import pandas as pd
from scipy.optimize import minimize
from sklearn.preprocessing import StandardScaler
def sig1(z): # sigma
return(1/(1+np.exp(-z)))
def sig2(z): # sigma'(z)
phat = sig1(z)
return(phat*(1-phat))
class y2ord(): # Convert ordinal to 1, 2, ... K
def __init__(self):
... |
palrogg/foundations-homework | Data_and_databases/Homework_5_Ronga.ipynb | mit | from bs4 import BeautifulSoup
from urllib.request import urlopen
html = urlopen("http://static.decontextualize.com/cats.html").read()
document = BeautifulSoup(html, "html.parser")
"""
Explanation: Homework #5
This homework presents a sophisticated scenario in which you must design a SQL schema, insert data into it, an... |
mikezawitkowski/fireRiskSF | notebooks/exploratory/0.5-mission-fire-exploration.ipynb | mit | query_url = 'https://data.sfgov.org/resource/wbb6-uh78.json?$order=close_dttm%20DESC&$offset={}&$limit={}'
offset = 0
limit = 1000000
df = pd.read_json(query_url.format(offset, limit))
cols_to_drop = ["automatic_extinguishing_sytem_failure_reason",
"automatic_extinguishing_sytem_type",
... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_artifacts_correction_filtering.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
proj_fname = data_path + '/MEG/sample/sample_audvis_eog_proj.fif'
tmin, tmax = 0, 20 # use the first 20s of data
# Setup for reading the raw data (save memory by c... |
lwahedi/CurrentPresentation | talks/MDI3/networkslides.ipynb | mit | import pandas as pd
import networkx as nx
import numpy as np
import scipy as sp
import itertools
import matplotlib.pyplot as plt
import statsmodels.api as sm
%matplotlib inline
"""
Explanation: Network Analysis in Python
Laila A. Wahedi
Massive Data Institute Postdoctoral Fellow <br>McCourt School of Public Policy<br>... |
MaximMalakhov/coursera | Learning on marked data/Week 2/OverfittingTask.ipynb | mit | import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Практическое задание к уроку 1 (2 неделя).
Линейная регрессия: переобучение и регуляризация
В этом задании мы на примерах увидим, как переобучаются линейные модели, разберем, почему так происходит, и выясним... |
amueller/nyu_ml_lectures | Using built-in and custom score functions.ipynb | bsd-2-clause | from sklearn.datasets import make_classification
from sklearn.cross_validation import train_test_split
X, y = make_classification(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
from sklearn.linear_model import LogisticRegression
lr = LogisticRegression()
lr.fit(X_train, y_... |
pichot/citibike-publicspace | models/3.2-kz-regression_ols_ridge_lasso.ipynb | mit | import numpy as np
import pandas as pd
from pandas.stats.api import ols
#import Quandl
import statsmodels.formula.api as smf
import statsmodels.api as sm
from scipy import stats
from sklearn import linear_model
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
%pylab inline
"""
Exp... |
andrewzwicky/puzzles | advent_of_code/2019/04/04.ipynb | mit | data_in = '272091-815432'
def criteria(word):
meets = True
if '11' in word or \
'22' in word or \
'33' in word or \
'44' in word or \
'55' in word or \
'66' in word or \
'77' in word or \
'88' in word or \
'99' in word:
last_num = None
for x in word:
... |
ivannz/study_notes | year_14_15/course_project/release/miscellanea/Final_analysis.ipynb | mit | import os, re
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings("ignore")
import self_similarity as ss
from main import sim_load, list_files
"""
Explanation: Load the required modules
End of explanation
"""
def xing_hurst( file_name, p = 5, q = 7 ) :
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.