repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
karlstroetmann/Artificial-Intelligence | Python/3 Games/Tic-Tac-Toe.ipynb | gpl-2.0 | gPlayers = [ 'X', 'O' ]
"""
Explanation: Tic-Tac-Toe
This notebook defines the game tic-tac-toe.
It is played on a $3 \times 3$ board. There are two players, which are called X and O. Player X starts. Player X always puts an 'X' into an empty field on the board, while player O always puts an 'O' in an empty field o... |
acs/python-red | Classes-en.ipynb | mit | class Atom():
pass
"""
Explanation: Object Oriented Programming Introducion (OOP)
This notebook includes a general introduction to object oriented programming. Python3 is used but
most of the code is compatible also with Python2.
The OOP main advantages are the encapsulation, making the code more modular, and the ... |
tensorflow/docs-l10n | site/en-snapshot/probability/examples/A_Tour_of_TensorFlow_Probability.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... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/feature_engineering/solutions/1_bqml_basic_feat_eng.ipynb | apache-2.0 | # Installing the latest version of the package
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: Basic Feature Engineering in BQML
Learning Objectives
Create SQL statements to evaluate the model
Extract temporal features
Perform a feature cross on temporal features
Introduction
In this lab, we utili... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/notebooks/lectures/Introduction_to_Volume_Slippage_and_Liquidity/notebook.ipynb | unlicense | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
num_shares = np.asarray([30000, 60000, 10000])
prices = np.asarray([30, 31, 33])
np.dot(num_shares, prices)
"""
Explanation: Introduction to Volume, Slippage, and Liquidity
by Delaney Mackenzie and Maxwell Margenot
Part of the Quantopian Lecture... |
jdhp-docs/python_notebooks | nb_sci_maths/maths_mandelbrot_set_en.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
EPSILON_MAX = 2.
NUM_IT_MAX = 32
Z_INIT = complex(0, 0)
def mandelbrot_version1(x, y):
it = 0
z = Z_INIT
c = complex(x, y)
# Rem: abs(z) = |z| = math.sqrt(pow(z.imag... |
liganega/Gongsu-DataSci | ref_materials/excs/Lab-04.ipynb | gpl-3.0 | def n_divide(n):
L = []
for i in range(n+1):
L.append(i * 1.0/n)
return L
n_divide(10)
"""
Explanation: 연습문제
아래 문제들을 해결하는 코드를 lab4.py 파일에 작성하여 제출하라.
연습 1
양의 정수 n을 입력 받아 0과 n 사이의 값을 균등하게 n분의 1로 쪼개는 숫자들의 리스트를 리턴하는 함수 n_divide(n)을 작성하라. (힌트: range 함수 활용)
예제:
In [1]: n_divide(10)
out[1]: [0, 0.1, 0... |
borja876/Thinkful-DataScience-Borja | Challenge+Make+Your+Network.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import scipy
import sklearn
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.model_selection import train_test_split,cross_val_score, KFold, cross_val_predict
from sklearn.dec... |
CopernicusMarineInsitu/INSTACTraining | PythonNotebooks/PlatformPlots/Read_drifter_data_1.ipynb | mit | %matplotlib inline
import netCDF4
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
"""
Explanation: In this application we will read a netCDF file containing a surface drifter trajectory.
1. Reading the data
We use the netCDF4 module.
End of explanation
"""
drifterfile = "/data_loca... |
abhay1/tf_rundown | notebooks/Linear Regression.ipynb | mit | import time
from IPython import display
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
num_points = 100
X = np.arange(num_points)
Y = (X * 0.8 + 10) + np.random.normal(0, 5, num_points)
# Plot the points
plt.plot(X, Y, 'rx')
plt.show()
"""
Explanation: Linear Regression - Lets fit a line!... |
hdesmond/StatisticalMethods | examples/XrayImage/Summarizing.ipynb | gpl-2.0 | import astropy.io.fits as pyfits
import numpy as np
import astropy.visualization as viz
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 10.0)
targdir = 'a1835_xmm/'
imagefile = targdir+'P0098010101M2U009IMAGE_3000.FTZ'
expmapfile = targdir+'P0098010101M2U009EXPMAP3000.FTZ'
b... |
wmfschneider/CHE30324 | Exams/Exam3-Sp20-soln.ipynb | gpl-3.0 | print('I<Br<Cl<F')
"""
Explanation: Chem 30324, Spring 2020, Exam 3
April 14, 2020, 9 am EDT to 9 pm EDT
You have 12 hours to complete this exam. You may refer to the extended outline available on the course website, to the HW 7, HW 8, and HW 9 solutions, and your two pages of written notes, which you must turn in wi... |
kscottz/PyBay2017 | OpenStreetMapsExample.ipynb | apache-2.0 | # See requirements.txt to set up your dev environment.
import os
import sys
import utm
import json
import scipy
import overpy
import urllib
import datetime
import urllib3
import rasterio
import subprocess
import numpy as np
import pandas as pd
import seaborn as sns
from osgeo import gdal
from planet import api
from pl... |
harpolea/pyro2 | mesh/mesh-examples.ipynb | bsd-3-clause | from __future__ import print_function
import numpy as np
import mesh.boundary as bnd
import mesh.patch as patch
import matplotlib.pyplot as plt
%matplotlib inline
# for unit testing, we want to ensure the same random numbers
np.random.seed(100)
"""
Explanation: Mesh examples
this notebook illustrates the basic ways o... |
timothyb0912/pylogit | examples/notebooks/.ipynb_checkpoints/mlogit_Benchmark--Heating-checkpoint.ipynb | bsd-3-clause | from collections import OrderedDict # For recording the model specification
import pandas as pd # For file input/output
import numpy as np # For vectorized math operations
import pylogit as pl # For MNL model estimation and
... |
mediagit2016/workcamp-maschinelles-lernen-grundlagen | 18-05-14-ml-workcamp/sonar-daten/Projekt-Sonardaten-Workcamp-ML.ipynb | gpl-3.0 | # Laden der entsprechenden Module
# Wie laden die Module offen, damit man einmal sieht, was da alles benötigt wird
# Allerdings aufpassen, dann werden die Module anderst angesprochen wie beim Standard
# zum Beispiel pyplot und nicht plt
from matplotlib import pyplot
from pandas import read_csv
from pandas import set_op... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lme/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lme', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LME
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Bal... |
Lolcroc/AI | ML1/10170359_11919698_10761225_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... |
zhaojijet/UdacityDeepLearningProject | examples/sequence_to_sequence_implementation.ipynb | apache-2.0 | import helper
source_path = 'data/letters_source.txt'
target_path = 'data/letters_target.txt'
source_sentences = helper.load_data(source_path)
target_sentences = helper.load_data(target_path)
"""
Explanation: Character Sequence to Sequence
In this notebook, we'll build a model that takes in a sequence of letters, an... |
ramhiser/Keras-Tutorials | notebooks/04_deep_multilayer_perceptron.ipynb | mit | # Loads the training and test data sets
(X_train, y_train), (X_test, y_test) = mnist.load_data()
first_image = X_train[0, :, :]
# To interpret the values as a 28x28 image, we need to reshape
# the numpy array, which is one dimensional.
plt.imshow(first_image, cmap=plt.cm.Greys);
num_classes = len(np.unique(y_train))... |
LDSSA/learning-units | units/10-classification/Logistic regression.ipynb | mit | %matplotlib inline
import pandas as pd #used for reading/writing data
import numpy as np #numeric library library
from matplotlib import pyplot as plt #used for plotting
import sklearn #machine learning library
occupancyData = pd.read_csv('data/occupancy_data/datatraining.txt')
"""
Explanation: Classification examp... |
jlawman/jlawman.github.io | content/sklearn/Metrics - Regression.ipynb | mit | from sklearn.linear_model import LinearRegression
from sklearn.datasets import make_regression
import matplotlib.pyplot as plt
%matplotlib inline
#Generate data
regression_data, regression_values = make_regression(n_samples=100,n_features=1,n_informative=1,noise=10)
#Set X, y_true (and shift to quadrant 1)
X = regres... |
NifTK/NiftyNet | demos/module_examples/ImageReader.ipynb | apache-2.0 | import sys
niftynet_path = '/Users/bar/Documents/Niftynet/'
sys.path.insert(0, niftynet_path)
from niftynet.io.image_reader import ImageReader
"""
Explanation: This demo provides examples of ImageReader class from niftynet.io.image_reader module.
What is ImageReader?
The main functionality of ImageReader is to search... |
giacomov/3ML | docs/examples/gof_lrt.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
from jupyterthemes import jtplot
jtplot.style(context='talk', fscale=1, ticks=True, grid=False)
plt.style.use('mike')
import scipy.stats as stats
import numpy as np
from threeML import *
import warnings
warnings.simplefilter('ignore')
"""
Explanation: Goodness of ... |
26fe/jsonstat.py | examples-notebooks/oecd-canada-jsonstat_v1.ipynb | lgpl-3.0 | # all import here
from __future__ import print_function
import os
import pandas as ps # using panda to convert jsonstat dataset to pandas dataframe
import jsonstat # import jsonstat.py package
import matplotlib as plt # for plotting
%matplotlib inline
"""
Explanation: Notebook: using jsonstat.py python library... |
deepmind/active_ops | Active_ops_experiment.ipynb | apache-2.0 | import bandit
import multiarm_model
import arm_model
import agents as agent_classes
import kernel as kernel_classes
import random
from typing import List, Dict
import pickle as pkl
from scipy import spatial
import numpy as np
import copy
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Copyright 20... |
hanleilei/note | training/week2nd.ipynb | cc0-1.0 | # 打开文件
fh = open('file.txt','w')
# 其中,w表示写入,r表示读取,a表示追加写入
# t是windows平台特有的所谓text mode(文本模式),区别在于会自动识别windows平台的换行符。
# 类Unix平台的换行符是\n,而windows平台用的是\r\n两个ASCII字符来表示换行,python内部采用的是\n来表示换行符。
# rt模式下,python在读取文本时会自动把\r\n转换成\n.
# wt模式下,Python写文件时会用\r\n来表示换行。
dir(fh)
fh.name
fh.mode
fh.encoding
fh.writable()
fh.write("... |
srcole/qwm | sfn/Poster viewer distribution by state.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
import pandas as pd
# Load data
df = pd.DataFrame.from_csv('./posterviewers_by_state.csv')
key_N = 'Number of people'
"""
Explanation:... |
harmsm/pythonic-science | labs/01_simulation/01_simulations-key.ipynb | unlicense | %matplotlib inline
import numpy as np
import scipy.stats
from matplotlib import pyplot as plt
"""
Explanation: Simulations Lab
End of explanation
"""
my_dict = {"X. laevis":"frog","M. musculus":"mouse","H. sapiens":"human"}
"""
Explanation: Practice
Optional exercises to review basic python
If you want to build a ... |
sysid/kg | titanic/titanic.ipynb | mit | import pandas as pd
import numpy as np
from matplotlib import pyplot
%matplotlib inline
titanic = pd.read_csv("train.csv")
titanic_test = pd.read_csv("test.csv")
titanic.shape
titanic.describe()
titanic.info()
titanic.head(3)
"""
Explanation: Titanic
a Kaggle competition
End of explanation
"""
titanic["Age"] = tit... |
saangulo/DataClass | notebooks/02_starter_code.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import os
path = ""
data = pd.read_csv("https://github.com/JamesByers/GA-SEA-DAT2/raw/master/data/ozone.csv")
print data.head()
"""
Explanation: Lesson 2 Lab: Practical Pandas
_This is a quiz given in Roger Peng's Coursera class Computing for Data Analysis. _
Sourced from Rese... |
tommyogden/maxwellbloch | docs/examples/mbs-lambda-weak-pulse-more-atoms-no-coupling.ipynb | mit | mb_solve_json = """
{
"atom": {
"fields": [
{
"coupled_levels": [[0, 1]],
"detuning": 0.0,
"detuning_positive": true,
"label": "probe",
"rabi_freq": 1.0e-3,
"rabi_freq_t_args":
{
"ampl": 1.0,
"centre": 0.0,
"fw... |
arsenovic/clifford | docs/tutorials/InterfacingOtherMathSystems.ipynb | bsd-3-clause | import clifford as cf
layout, blades = cf.Cl(2) # instantiate a 2D- GA
locals().update(blades) # put all blades into local namespace
def c2s(z):
'''convert a complex number to a spinor'''
return z.real + z.imag*e12
def s2c(S):
'''convert a spinor to a complex number'''
S0 = float(S(0))
S2 = flo... |
kunaltyagi/SDES | notes/python/p_norvig/algo/Economics.ipynb | gpl-3.0 | import random
N = 5000 # Default size of the population
MU = 100. # Default mean of the population
population = [random.gauss(mu=MU, sigma=MU/5) for actor in range(N)]
"""
Explanation: Economics Simulation
This is a simulation of an economic marketplace in which there is a population of actors, each of which has a ... |
CalPolyPat/Python-Workshop | Python Workshop/Functions.ipynb | mit | def add1(x):
return x+1
print(add1(1))
def xsq(x):
return x**2
print(xsq(5))
for i in range(0,10):
print(xsq(i))
"""
Explanation: Functions
Let's say that we have some code that does some task, but the code is 25 lines long, we need to run it over 1000 items and it doesn't work in a loop. How in the wo... |
james-prior/cohpy | 20170130-cohpy-fstrings.ipynb | mit | stuff = {
'apple': 1.97,
'banana': 2.99,
'cherry': 3.99,
}
# Common pattern of .format use:
for name, price in stuff.items():
print(
'The price of {name} is {price}'.
format(name=name, price=price))
"""
Explanation: f-strings
f-strings
are
new in Python 3.6.
f-strings look like an ord... |
Hugovdberg/timml | notebooks/timml_xsection.ipynb | mit | from pylab import *
%matplotlib inline
from timml import *
"""
Explanation: TimML Notebook
Cross-sectional model
End of explanation
"""
ml = ModelMaq(kaq=[1, 2], z=[4, 3, 2, 1, 0], c=[1000, 1000], \
topboundary='semi', hstar=5)
ls = HeadLineSink1D(ml, xls=0, hls=2, layers=0)
ml.solve()
x = linspace(-2... |
mne-tools/mne-tools.github.io | dev/_downloads/f5853db1ea98f82173310d147f23289c/compute_mne_inverse_epochs_in_label.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
from mne.minimum_norm import apply_inverse
print(__doc__)
data_p... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/sandbox-3/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'sandbox-3', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: THU
Source ID: SANDBOX-3
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
mdiaz236/DeepLearningFoundations | weight-initialization/weight_initialization.ipynb | mit | %matplotlib inline
import tensorflow as tf
import helper
from tensorflow.examples.tutorials.mnist import input_data
print('Getting MNIST Dataset...')
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print('Data Extracted.')
"""
Explanation: Weight Initialization
In this lesson, you'll learn how to fin... |
googledatalab/notebooks | samples/ML Toolbox/Image Classification/Flower/Service End to End.ipynb | apache-2.0 | import mltoolbox.image.classification as model
from google.datalab.ml import *
bucket = 'gs://' + datalab_project_id() + '-lab'
preprocess_dir = bucket + '/flowerpreprocessedcloud'
model_dir = bucket + '/flowermodelcloud'
staging_dir = bucket + '/staging'
!gsutil mb $bucket
"""
Explanation: Order of magnitude faster... |
yeatmanlab/AFQ-Browser | afqbrowser/site/client/example-analysis.ipynb | bsd-3-clause | %matplotlib inline
import pandas as pd
subjects = pd.read_csv('./data/subjects.csv')
nodes = pd.read_csv('./data/nodes.csv')
"""
Explanation: Example analysis
This notebook provides a generic example for some analysis that you might want to conduct with the data provided through this AFQ-Browser instance. Note that... |
georgetown-analytics/nba | NBA Player Statistics Workshop.ipynb | mit | # Imports - you'll need some of these later, but it's traditional to put them all at the beginning.
import os
import csv
import json
import urllib2
from collections import Counter
from operator import itemgetter
"""
Explanation: NBA Player Statistics Workshop
Given a dataset of NBA players performance and salary in ... |
nehal96/Deep-Learning-ND-Exercises | Sequence-to-Sequence/sequence_to_sequence_implementation.ipynb | mit | import helper
source_path = 'data/letters_source.txt'
target_path = 'data/letters_target.txt'
source_sentences = helper.load_data(source_path)
target_sentences = helper.load_data(target_path)
"""
Explanation: Character Sequence to Sequence
In this notebook, we'll build a model that takes in a sequence of letters, an... |
thomasmeagher/DS-501 | lectures/06 Machine Learning Part 1 and Midterm Review/1_PythonExamples.ipynb | mit | import numpy as np
import matplotlib.pylab as py
import pandas as pa
import scipy.stats as st
np.set_printoptions(precision=2)
%matplotlib inline
"""
Explanation: Loading packages
End of explanation
"""
X=st.bernoulli(p=0.3)
X.rvs(100)
# Note that "high" is not included.
X=st.randint(low=1,high=5)
X.rvs(100)
"""
E... |
ajs3g11/training-public | FEEG6016 Simulation and Modelling/01-Monte-Carlo-Lab-1.ipynb | mit | from IPython.core.display import HTML
css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css'
HTML(url=css_file)
"""
Explanation: Monte Carlo Methods: Lab 1
Take a look at Chapter 10 of Newman's Computational Physics with Python where much of this material is dr... |
MingChen0919/learning-apache-spark | notebooks/04-miscellaneous/TF-IDF.ipynb | mit | from pyspark import SparkContext
sc = SparkContext(master = 'local')
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName("Python Spark SQL basic example") \
.config("spark.some.config.option", "some-value") \
.getOrCreate()
"""
Explanation: Create SparkContext & ... |
drericstrong/Blog | 20161216_Predicting Abalone Rings Part 3.ipynb | agpl-3.0 | import pandas as pd
import numpy as np
import seaborn as sns
from scipy import stats
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_absolute_... |
chapman-cs510-2016f/cw-12-redyellow | Stack.ipynb | mit | //***Do like your comments in stack.h so copied here for future review and study:***
// In C++ a class is just a fancy struct
// Both struct and class have two internal namespaces:
// private: only accessible by the struct/class itself
// public: accessible by other code that is using the struct/class
//
// When... |
staeiou/cscw-pages | page-lengths-cscw.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
sns.set(font_scale=2)
"""
Explanation: What is the distribution of paper lengths in CSCW?
by R. Stuart Geiger (@staeiou), ethnographer/postdoc, Berkeley Institute for Data Science
Freely licensed under both CC-BY 4.0 and The M... |
olgabot/cshl-singlecell-2017 | notebooks/2.2_apply_clustering_on_knn_graph.ipynb | mit | # Interactive jupyter widgets - use IntSlider directly for more control
from ipywidgets import IntSlider, interact
# Convert RGB colors to hex cor portability
from matplotlib.colors import rgb2hex
# Visualize networks
import networkx
# Numerical python
import numpy as np
# Pandas for dataframes
import pandas as pd
... |
lilleswing/deepchem | examples/tutorials/14_Conditional_Generative_Adversarial_Networks.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 14: Conditional Generativ... |
DS-100/sp17-materials | sp17/hw/hw6/hw6_solution.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import linear_model as lm
from IPython.display import display, Latex, Markdown
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('hw6.ok')
"""
Explanation: Homework ... |
John-Keating/ThinkStats2 | code/chap04soln.ipynb | gpl-3.0 | %matplotlib inline
import nsfg
preg = nsfg.ReadFemPreg()
"""
Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br>
Allen Downey
Read the pregnancy file.
End of explanation
"""
import thinkstats2
live = preg[preg.outcome == 1]
firsts = live[live.birthord == 1]
others = live[live.birthord != 1]
cd... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/migration/UJ14 legacy AutoML Vision Video Classification.ipynb | apache-2.0 | ! pip3 install -U google-cloud-automl --user
"""
Explanation: AutoML SDK: AutoML image classification model
Installation
Install the latest (preview) version of AutoML SDK.
End of explanation
"""
! pip3 install google-cloud-storage
"""
Explanation: Install the Google cloud-storage library as well.
End of explanat... |
szitenberg/ReproPhyloVagrant | notebooks/Tutorials/Basic/3.2 Starting a Project.ipynb | mit | from reprophylo import *
"""
Explanation: See quick reference at the bottom
See full module reference section for full details
In the begining of each analysis, the first step is to load ReproPhylo and its dependencies with the command
End of explanation
"""
coi = Locus(char_type='dna',
feature_type='CD... |
cjohnson318/geostatsmodels | notebooks/VariogramAnalysis.ipynb | mit | import numpy as np
import pandas as pd
from geostatsmodels import utilities, kriging, variograms, model, geoplot
import matplotlib.pyplot as plt
from scipy.stats import norm
"""
Explanation: This notebook is an effort to replicate the lessons found here:
http://people.ku.edu/~gbohling/cpe940/Variograms.pdf
We'll do al... |
facaiy/book_notes | deep_learning/Convolutional_Networks/note.ipynb | cc0-1.0 | show_image("fig9_1.png", figsize=(8, 8))
"""
Explanation: Chapter 9 Convolutional Networks
Convolution is a specialized kind of linear operation.
9.1 The Convolution Operation
\begin{align}
s(t) &= \int x(a) w(t-a) \mathrm{d}a \
&= (x \ast w)(t)
\end{align}
where $x$ is the input, $w$ is the kernel, and $... |
carltoews/tennis | notebooks/.ipynb_checkpoints/merge_datasets-checkpoint.ipynb | gpl-3.0 | import IPython as IP
IP.display.Image("example_of_name_matching_problems_mod.png",width=400,height=200,embed=True)
"""
Explanation: <p style="text-align: center"> Merging "odds" and "player" data</p>
Author: Carl Toews
File: merge_datasets.ipynb
Description:
An obvious metric for assessing the quality of learn... |
hunterherrin/phys202-2015-work | assignments/assignment07/AlgorithmsEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np
"""
Explanation: Algorithms Exercise 2
Imports
End of explanation
"""
np.array(range(5)).max()
list(range(1,5))
find_peaks([2,0,1,0,2,0,1])
def find_peaks(a):
"""Find the indices of the local maxima in a sequence."... |
dato-code/tutorials | strata-sj-2016/ml-in-production/deploy-scikit-learn.ipynb | apache-2.0 | from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris
iris = load_iris()
model = RandomForestClassifier(n_estimators=10)
model = model.fit(iris['data'], iris['target'])
model
"""
Explanation: Introduction to ML Deployment
Deploying models created using python in a Turi Predictive ... |
reverieinc/RevCode | Revcode_experiment/Sentiment Analysis Revcode Experiment-IITP Product reviews.ipynb | gpl-3.0 | #!pip3 install hurry.filesize
import os
import pandas as pd
from tqdm import tqdm
import os
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics import plot_con... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_object_epochs.ipynb | bsd-3-clause | from __future__ import print_function
import mne
import os.path as op
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: The :class:Epochs <mne.Epochs> data structure: epoched data
End of explanation
"""
data_path = mne.datasets.sample.data_path()
# Load a dataset that contains events
ra... |
ccwang002/2015Talk-DeepLearn-CNN | code/02_two_layer_net.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading external modules
# see http://stackoverflow.com/quest... |
metpy/MetPy | v0.7/_downloads/Natural_Neighbor_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import ConvexHull, Delaunay, delaunay_plot_2d, Voronoi, voronoi_plot_2d
from scipy.spatial.distance import euclidean
from metpy.gridding import polygons, triangles
from metpy.gridding.interpolation import nn_point
plt.rcParams['figure.figsize'] = (... |
mommermi/Introduction-to-Python-for-Scientists | notebooks/MachineLearning_20161202.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from sklearn import neighbors, datasets
### import iris dataset
iris = datasets.load_iris()
print iris.keys()
"""
Explanation: Machine Learning with Python
What is Machine Learning?
Machine Learning (ML) is a branch of computer science and data science that uses st... |
feststelltaste/software-analytics | demos/20190319_JavaLand_Bruehl/jdeps Demo.ipynb | gpl-3.0 | from ozapfdis import jdeps
deps = jdeps.read_jdeps_file(
"../../../dropover/backend/target/jdeps.txt",
filter_regex="at.dropover")
deps.head()
"""
Explanation: Idea
Using JDK's jdeps command line utility, we can gather dependencies between Java types:
bash
jdeps -v dropover-classes.jar > jdeps.txt
We want ... |
diegocavalca/Studies | deep-learnining-specialization/4. Convolutional Neural Networks/resources/Face Recognition for the Happy House - v3.ipynb | cc0-1.0 | from keras.models import Sequential
from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate
from keras.models import Model
from keras.layers.normalization import BatchNormalization
from keras.layers.pooling import MaxPooling2D, AveragePooling2D
from keras.layers.merge import Concatenate
from kera... |
ProfessorKazarinoff/staticsite | content/code/python_classes/create_a_new_class.ipynb | gpl-3.0 | class Grandma:
def __init__(self):
self.address = ' '
self.children = []
self.grandchildren = []
"""
Explanation: Classes in Python:
Object oriented programming languages like Python are powerfull because they allow you create new object types, modifiy object properites and manipulate ... |
chusine/dlnd | dcgan-svhn/DCGAN_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
rahulbakshee/TensorFlow-Basics | 02_tf_basics.ipynb | mit | #import
import tensorflow as tf
sess = tf.Session()
"""
Explanation: 02 TensorFlow Basics
This is the part of basics of Tensorflow playground. These ilustrations are inspired from lecture notes of CS 20SI: Tensorflow for Deep Learning Research.I do not own this code.
For more info visit
http://web.stanford.edu/class... |
bhermanmit/openmc | docs/source/examples/mg-mode-part-iii.ipynb | mit | import os
import matplotlib.pyplot as plt
import numpy as np
import openmc
%matplotlib inline
"""
Explanation: This Notebook illustrates the use of the the more advanced features of OpenMC's multi-group mode and the openmc.mgxs.Library class. During this process, this notebook will illustrate the following features... |
ozorich/phys202-2015-work | assignments/assignment03/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
GeosoftInc/gxpy | examples/jupyter_notebooks/Tutorials/Grids and Images.ipynb | bsd-2-clause | import geosoft.gxpy.gx as gx
import geosoft.gxpy.grid as gxgrid
import geosoft.gxpy.utility as gxu
from IPython.display import Image
gxc = gx.GXpy()
url = 'https://github.com/GeosoftInc/gxpy/raw/9.3/examples/tutorial/Grids%20and%20Images/'
gxu.url_retrieve(url + 'elevation_surfer.GRD')
"""
Explanation: Copyright (c)... |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v3.8/resnet-tpuv3-8/code/resnet/model/models/samples/core/tutorials/keras/save_and_restore_models.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/emac-2-53-aerchem/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-aerchem', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: EMAC-2-53-AERCHEM
Topic: Atm... |
longyangking/ML | Deep Learning/Naive Version of Neural Network.ipynb | lgpl-3.0 | import numpy as np
np.linspace(0,1,10)
"""
Explanation: Naive Version of Neural Network
Required Libraries for linear algeras
End of explanation
"""
def tanh(x):
return np.tanh(x)
def tanh_deriv(x):
return 1.0 - np.tanh(x)*np.tanh(x)
def logistic(x):
return 1.0/(1.0 + np.exp(-x))
def logistic_deriv(x... |
AustenLamacraft/austenlamacraft.github.io | notebooks/.ipynb_checkpoints/z2_sync-checkpoint.ipynb | mit | # import some dependencies
import torch
from torch.autograd import Variable
import numpy as np
import pyro
import pyro.distributions as dist
import pyro
from pyro.infer import SVI
"""
Explanation: Mean field inference for $\mathbb{Z}_2$ Syncronization
We illustrate the $\mathbb{Z}_2$ syncronization inference proble... |
AllenDowney/ModSimPy | examples/insulin.ipynb | mit | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretrieve
local, _ = urlretrieve... |
NII-cloud-operation/Jupyter-LC_docker | sample-notebooks/99_Test python3 env.ipynb | bsd-3-clause | import sys
assert sys.version_info[0] == 3
"""
Explanation: このNotebookは、このイメージにインストールされたライブラリ/ツールが予期した通りにインストールされていることをチェックするものです。Travis CI上でpapermillにより実行されます。
This notebooks tests whether the installed apps work expectedly, and can be executed by papermill on Travis CI.
End of explanation
"""
%matplotlib inline
i... |
srcole/qwm | burrito/.ipynb_checkpoints/Burrito_characterize-checkpoint.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Data characterization
Scott Cole
21 May 2016
This notebook characteriz... |
valentina-s/GLM_PythonModules | notebooks/Fitting_2D_parameters.ipynb | bsd-2-clause | theta = np.array([2,-1])
"""
Explanation: The intensity is $\theta * X$ where $X$ is a row vector.
End of explanation
"""
#X = 0.1*np.random.normal(size = (d,N))
#X = np.reshape(np.ones(N,),(1,N))
#X = np.reshape(np.sin(np.arange(N)),(1,N))
X = np.vstack((np.reshape(np.ones(N,),(1,N)),np.reshape(np.sin(np.arange(N))... |
subutai/nupic | src/nupic/frameworks/viz/examples/Demo.ipynb | agpl-3.0 | from nupic.engine import Network, Dimensions
# Create Network instance
network = Network()
# Add three TestNode regions to network
network.addRegion("region1", "TestNode", "")
network.addRegion("region2", "TestNode", "")
network.addRegion("region3", "TestNode", "")
# Set dimensions on first region
region1 = network.... |
judithfan/graphcomm | experiments/recog/preprocess_sketches.ipynb | mit | upload_dir = './sketch'
import boto
runThis = 0
if runThis:
conn = boto.connect_s3()
b = conn.create_bucket('sketchpad_basic_pilot2_sketches')
all_files = [i for i in os.listdir(upload_dir) if i != '.DS_Store']
for a in all_files:
print a
k = b.new_key(a)
k.set_contents_from_fil... |
markdewing/qmc_algorithms | LongRange/PolynomialFit.ipynb | mit | f = Symbol('f') # Function to approximate
f_approx = Symbol('fbar') # Approximating function
w = Symbol('w') # weighting function
chi2 = Symbol('chi^2')
f, f_approx, w, chi2
M = Symbol('M', integer=True)
k = Symbol('k', integer=True,positive=True)
a = IndexedBase('a',(M,)) # coefficient
h = IndexedBase('h',(M,)) ... |
monicathieu/cu-psych-r-tutorial | public/tutorials/python/1_r2python-translation/3_controlFlow.ipynb | mit | myVar = 25
if myVar > 10:
print('Above 10!')
"""
Explanation: Control Flow
Goals of this lesson
Students will learn:
How to use if/else and for loops in python
How to indent code correctly in python
Indenting in python
Python, unlike R, is strict about indentation!
Indentations in python often have bearing on ... |
harunyasar/machine_learning_playground | CSE681/lab3/bicycle_rent.ipynb | gpl-3.0 | plt.style.use('seaborn-talk')
plt.scatter(bisikletKiralama['windspeed'], bisikletKiralama['cnt'])
plt.xlabel('Rüzgar Hızı')
plt.ylabel('Kiralama Sayısı')
plt.show()
# Bisiklet kiralamayı etkileyen faktörler nelerdir ?
# cevap :
"""
Explanation: x ekseninde rüzgar hızı windspeed y ekseninde kiralama (cnt) sayısı olac... |
geratarra/Machine-Learning | Tareas/Softmax Regression/regresion_softmax.ipynb | gpl-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from IPython.display import Image # Esto es para desplegar imágenes en la libreta
"""
Explanation: Regresión softmax
End of explanation
"""
data = np.load("digitos.npz")
print data.keys()
"""
Explanation: 1. ... |
georgetown-analytics/yelp-classification | machine_learning/sample_user_recommendation.ipynb | mit | import json
import pandas as pd
import re
import random
import matplotlib.pyplot as plt
%matplotlib inline
from ast import literal_eval as make_tuple
from scipy import sparse
import numpy as np
from pymongo import MongoClient
from nltk.corpus import stopwords
from sklearn import svm
from sklearn.decomposition import ... |
mit-crpg/openmc | examples/jupyter/pandas-dataframes.ipynb | mit | import glob
from IPython.display import Image
import matplotlib.pyplot as plt
import scipy.stats
import numpy as np
import pandas as pd
import openmc
%matplotlib inline
"""
Explanation: Pandas Dataframes
This notebook demonstrates how systematic analysis of tally scores is possible using Pandas dataframes. A dataframe... |
IEEE-NITK/SummerProjects17 | ML-Python/Week3-4/submissions/A4/Shashank/A4_regular_logistic.ipynb | mit | import numpy as np
data = np.genfromtxt('ex2data2.txt', delimiter = ",")
m = len(data[:,0])
y = data[:, 2].reshape((m, 1))
X = np.ones((m,3))
X[:, 1:] = data[:, 0:2]
"""
Explanation: Assignment 4b
Regularised logistic regression
Predict whether microchips from a fabrication plant passes quality assurance
End of explan... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_soft/td1a_sql_correction.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: 1A.soft - Notions de SQL - correction
Correction des exercices du premier notebooks relié au SQL.
End of explanation
"""
import os
if not os.path.exists("td8_velib.db3"):
from pyensae.datasource import download_d... |
befelix/SafeOpt | examples/2d_example.ipynb | mit | # Measurement noise
noise_var = 0.05 ** 2
# Bounds on the inputs variable
bounds = [(-5., 5.), (-5., 5.)]
# Define Kernel
kernel = GPy.kern.RBF(input_dim=len(bounds), variance=2., lengthscale=1.0,
ARD=True)
# Initial safe point
x0 = np.zeros((1, len(bounds)))
# Generate function with safe init... |
rvernagus/data-science-notebooks | LinearRegression/Linear Models.ipynb | mit | import numpy as np
vector = np.array([1, 2, 3, 4, 5])
vector
"""
Explanation: Vectors
Create a vector:
End of explanation
"""
vector.reshape((5, 1))
"""
Explanation: Convert it into a row vector:
End of explanation
"""
vector.reshape((1, 5))
"""
Explanation: Convert it into a column vector:
End of explanation
"... |
ebot7/sentiment-client | Examples.ipynb | mit | from http.client import HTTPSConnection
import json
"""
Explanation: e-bot7 Sentiment Analysis
The e-bot7 Sentiment Analysis Service is provided as a simple RESTful interface.
The only dependencies needed to call it are an HTTP client and json for encoding/decoding the payload.
End of explanation
"""
conn = HTTPSCon... |
davicsilva/dsintensive | notebooks/eda-miniprojects/hospital_readmit/.ipynb_checkpoints/sliderule_dsi_inferential_statistics_exercise_3-checkpoint.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import bokeh.plotting as bkp
from mpl_toolkits.axes_grid1 import make_axes_locatable
# read in readmissions data provided
hospital_read_df = pd.read_csv('data/cms_hospital_readmissions.csv')
"""
Explanatio... |
4dsolutions/Python5 | About_Decorators.ipynb | mit | def UFO(f):
setattr(f, 'abducted', True) # f.abducted = True same thing
return f
@UFO
def addS(s):
return s + "S"
@UFO
def addX(s):
return s + "X"
hasattr(addX, 'abducted')
if hasattr(addS, 'abducted'):
print("The value of abducted for addS is:", addS.abducted)
"""
Explanation: Decorators
I us... |
honjy/foundations-homework | 5/.ipynb_checkpoints/spotify-homework-hon-june6-checkpoint.ipynb | mit | data = response.json()
data.keys()
artist_data = data['artists']
artist_data.keys()
lil_names = artist_data['items']
#lil_names = list of dictionaries = list of artist name, popularity, type, genres etc
"""
Explanation: & for multiple parameters
End of explanation
"""
for names in lil_names:
if not names['ge... |
vtsatskin/Hot-Car-Data-Collection | Analysis Scaffolding.ipynb | mit | conn = sqlite3.connect('sessions.db')
c = conn.cursor()
"""
Explanation: Create a connection to our recordings database to the images and metadata associated with each image
End of explanation
"""
class Participant(Enum):
none = 0
adult = 1
child = 2
pet = 3
"""
Explanation: Each recording has a... |
vlad17/vlad17.github.io | assets/2021-01-07-vectorizing-ragged-arrays.ipynb | apache-2.0 | import numpy as np
from scipy.spatial.distance import cdist
def centroids(X_nd, label_n):
"""
Given X_nd, a 2-dimensional array of n d-dimensional points,
and n cluster assignments label_n (a 1-d array of n labels,
ints in range [0, k)), return (c_kd, dist_n) the k centroids c_kd and the
squared Eu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.