repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tensorflow/docs-l10n | site/en-snapshot/probability/examples/Optimizers_in_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... |
Mashimo/datascience | 02-Classification/tweets.ipynb | apache-2.0 | import pandas as pd # Start by importing the tweets data
X = pd.read_csv('../datasets/tweets.csv')
X.shape
X.columns
X.info()
X.head(5)
"""
Explanation: Classification metrics and Naive Bayes
We build an analytics model using text as our data, specifically trying to understand the sentiment of tweets about the ... |
DTOcean/dtocean-core | notebooks/DTOcean Fixed Wave Scenario Analysis.ipynb | gpl-3.0 | %matplotlib inline
from IPython.display import display, HTML
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (14.0, 8.0)
import numpy as np
from datetime import datetime
from dtocean_core import start_logging
from dtocean_core.core import Core
from dtocean_core.menu import DataMenu, ModuleMenu, Pro... |
jacobzweig/RCNN_Toolbox | nolearn-master/docs/notebooks/CNN_tutorial.ipynb | gpl-3.0 | import os
import matplotlib.pyplot as plt
%pylab inline
import numpy as np
from lasagne.layers import DenseLayer
from lasagne.layers import InputLayer
from lasagne.layers import DropoutLayer
from lasagne.layers import Conv2DLayer
from lasagne.layers import MaxPool2DLayer
from lasagne.nonlinearities import softmax
fro... |
google-research/google-research | rcc_algorithms/hybrid_coding.ipynb | apache-2.0 | import numpy as np
import scipy as sp
import scipy.stats
import matplotlib.pyplot as plt
from tqdm import tqdm
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
"""
Explanation: Hybrid coding scheme for diagonal Gaussians
```
Copyright 2022 Google LLC.
Licensed under the Apache License, Version 2.0 (t... |
kevincovey/AATau | SampleNotebooks/Schrodinger/Linear Potential in QM.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import scipy.linalg as scl
hbar=1
m=1
N = 4096
a = 14
"""
Explanation: <a href="https://colab.research.google.com/github/kevincovey/AATau/blob/master/SampleNotebooks/Schrodinger/Linear%20Potential%20in%20QM.ipynb" target="_parent"><img src="https://colab.research.goog... |
phuongxuanpham/SelfDrivingCar | CarND-Behavioral-Cloning-Project3/writeup_report.ipynb | gpl-3.0 | import os
import csv
import cv2
import numpy as np
import sklearn
"""
Explanation: Behavioral Cloning
This is the Project 3 in Self Driving Car Nano degree from Udacity
The purpose of this project is using deep learning to train a deep neural network to drive a car automously in a simulator.
Behavioral Cloning Projec... |
Bihaqo/t3f | docs/quick_start.ipynb | mit | import numpy as np
# Import TF 2.
%tensorflow_version 2.x
import tensorflow as tf
# Fix seed so that the results are reproducable.
tf.random.set_seed(0)
np.random.seed(0)
try:
import t3f
except ImportError:
# Install T3F if it's not already installed.
!git clone https://github.com/Bihaqo/t3f.git
!cd t... |
leopardbruce/FileFun | Course_1_Part_6_Lesson_2_Notebook.ipynb | mit | import tensorflow as tf
mnist = tf.keras.datasets.fashion_mnist
(training_images, training_labels), (test_images, test_labels) = mnist.load_data()
training_images=training_images / 255.0
test_images=test_images / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activa... |
poldracklab/mriqc | docs/notebooks/MRIQC Web API.ipynb | bsd-3-clause | import pandas as pd
from json import load
import urllib.request, json
from pandas.io.json import json_normalize
import seaborn as sns
import pylab as plt
import multiprocessing as mp
import numpy as np
%matplotlib inline
"""
Explanation: Querying the MRIQC Web API
This notebook shows how the web-API can be leveraged ... |
AllenDowney/ThinkBayes2 | soln/chap17.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename... |
computational-class/cjc2016 | code/17.networkx.ipynb | mit | %matplotlib inline
import networkx as nx
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
G=nx.Graph() # G = nx.DiGraph() # 有向网络
# 添加(孤立)节点
G.add_node("spam")
# 添加节点和链接
G.add_edge(1,2)
print(G.nodes())
print(G.edges())
# 绘制网络
nx.draw(G, with_labels = True)
"""
Explanation: 网络科学理论
... |
jtwhite79/pyemu | verification/Freyberg/verify_influence.ipynb | bsd-3-clause | %matplotlib inline
import os
import shutil
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
"""
Explanation: verify pyEMU Influence class
End of explanation
"""
pst = pyemu.Pst("freyberg.pst")
pst.pestpp_options = {}
inf = pyemu.Influence(jco="freyberg.jcb",pst=pst,verbose=False)
i... |
mattssilva/UW-Machine-Learning-Specialization | Week 1/Getting Started with SFrames.ipynb | mit | import graphlab
# Set product key on this computer. After running this cell, you will not need to re-enter your product key.
graphlab.product_key.set_product_key('FF7F-C815-C847-5944-EC2B-83EB-1D2D-0689')
# Limit number of worker processes. This preserves system memory, which prevents hosted notebooks from crashing.
... |
satishkt/ML-Foundations-Coursera | Week2-Linear Regression/Assignment.ipynb | bsd-2-clause | import graphlab.aggregate as agg
homeData.groupby(key_columns='zipcode',operations={'avg_sales_price' : agg.MEAN('price')})
import numpy as np
np.average(homeData.filter_by(['98033'],'zipcode')['price'])
def is_valid_home(sqft):
return (sqft >2000) & (sqft <4000)
q2homes = homeData[homeData['sqft_living'].apply(... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/marketing_campaign.ipynb | apache-2.0 | from pandas import DataFrame, Series
names = {
139987 : "Guadalupe J. Martinez", 140030 : "Michelle M. Lopez", 140089 : "Terry L. Ridgley",
140097 : "Miranda B. Roush", 139068 : "Sandra J. Wynkoop", 139154 : "Roland Guérette", 139158 : "Fabien Mailhot",
139169 : "Christian Austerlitz", 139220 : "Steffen ... |
hglanz/phys202-2015-work | assignments/assignment04/TheoryAndPracticeEx01.ipynb | mit | from IPython.display import Image
"""
Explanation: Theory and Practice of Visualization Exercise 1
Imports
End of explanation
"""
# Add your filename and uncomment the following line:
# Image(filename='yourfile.png')
"""
Explanation: Graphical excellence and integrity
Find a data-focused visualization on one of the... |
tensorflow/docs-l10n | site/en-snapshot/probability/examples/Fitting_DPMM_Using_pSGLD.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... |
gon1213/SDC | behavioral_cloning/CarND-Keras-Lab/traffic-sign-classification-with-keras.ipynb | gpl-3.0 | from urllib.request import urlretrieve
from os.path import isfile
from tqdm import tqdm
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * block_size)
self.last_block = b... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/variance_components.ipynb | bsd-3-clause | import numpy as np
import statsmodels.api as sm
from statsmodels.regression.mixed_linear_model import VCSpec
import pandas as pd
"""
Explanation: Variance Component Analysis
This notebook illustrates variance components analysis for two-level
nested and crossed designs.
End of explanation
"""
np.random.seed(3123)
"... |
dempfi/ayu | test/Jupyter.ipynb | mit | import os
os.environ['THEANO_FLAGS']='mode=FAST_COMPILE,optimizer=None,device=cpu,floatX=float32'
import numpy as np
import sklearn.cross_validation as skcv
#x = np.linspace(0, 5*np.pi, num=10000, dtype=np.float32)
x = np.linspace(0, 4*np.pi, num=10000, dtype=np.float32)
y = np.cos(x)
train, test = skcv.train_test_sp... |
wikistat/Apprentissage | Pic-ozone/Apprent-Python-Ozone.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
# Lecture des données
## Charger les données ou les lire directement en précisant le chemin
path=""
ozone=pd.read_csv(path+"depSeuil.dat",sep=",",header=0)
# Vérification du contenu
ozone.head()
"""
Explanation: <center>
<a href="http://www.insa-toulouse.fr/" ><img src="http://ww... |
YoungKwonJo/mlxtend | docs/examples/pandas__scaling.ipynb | bsd-3-clause | s1 = pd.Series([1,2,3,4,5,6], index=(range(6)))
s2 = pd.Series([10,9,8,7,6,5], index=(range(6)))
df = pd.DataFrame(s1, columns=['s1'])
df['s2'] = s2
df
"""
Explanation: Feature Scaling
Feature scaling is a crucial step in our preprocessing pipeline that can easily be forgotten. Decision trees and random forests are on... |
seg/2016-ml-contest | Houston_J/Houston_J-sub1.ipynb | apache-2.0 | well_PE_Miss = train.loc[train["PE"].isnull(),"Well Name"].unique()
well_PE_Miss
train.loc[train["Well Name"] == well_PE_Miss[0]].count()
train.loc[train["Well Name"] == well_PE_Miss[1]].count()
"""
Explanation: #There are 4149 elements, and PE has a significant amount of missing values
End of explanation
"""
(trai... |
empet/Plotly-plots | Triangular-wireplot-sphere.ipynb | gpl-3.0 | import numpy as np
from __future__ import division
"""
Explanation: Triangular wireplot on sphere
End of explanation
"""
def sphere(theta, phi):
x=np.cos(phi)*np.cos(theta)
y=np.cos(phi)*np.sin(theta)
z=np.sin(phi)
return x,y,z
theta=np.linspace(0,2*np.pi,40)
phi=np.linspace(-np.pi/2, np.pi/2, 30... |
kgrodzicki/machine-learning-specialization | course-3-classification/module-5-decision-tree-assignment-1-blank.ipynb | mit | import graphlab
graphlab.canvas.set_target('ipynb')
"""
Explanation: Identifying safe loans with decision trees
The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr... |
maxentile/method-of-moments-tinker | HMM method of moments.ipynb | mit | import numpy as np
import numpy.random as npr
import scipy.linalg
def pairwise_probabilities(X):
return X.T.dot(X)
def triplewise_probabilities(X):
# inefficient, will revisit later
return sum([np.einsum('i,j,k->ijk',x,x,x) for x in X])
def uniformly_sample_unit_sphere(k):
'''
Param... |
nvenayak/impact | docs/source/quickstart.ipynb | gpl-3.0 | from impact.parsers import Parser
from pprint import pprint
expt = Parser.parse_raw_data('default_titers',
file_name = os.path.join('sample_data','Fermentation_1_impact.xlsx'),
id_type='traverse')
expt.calculate()
"""
Explanation: The impact framework is design... |
ragavvenkatesan/Convolutional-Neural-Networks | pantry/tutorials/notebooks/Logistic Regression.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo("0NFvfg8CItQ",theme="light", color="red")
"""
Explanation: Logistic Regression
Logistic Regression:
Logistic Regression is a linear classifier. Logistic regression is usually one of the first and easiest-to-learn machiens in deep learning studies. Despite its simpl... |
dineshpackt/Fast-Data-Processing-with-Spark-2 | extras/003-DataFrame-For-DS.ipynb | mit | import datetime
from pytz import timezone
print "Last run @%s" % (datetime.datetime.now(timezone('US/Pacific')))
from pyspark.context import SparkContext
print "Running Spark Version %s" % (sc.version)
from pyspark.conf import SparkConf
conf = SparkConf()
print conf.toDebugString()
sqlCxt = pyspark.sql.SQLContext(sc... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/nurses_scheduling.ipynb | apache-2.0 | import sys
try:
import docplex.mp
except:
raise Exception('Please install docplex. See https://pypi.org/project/docplex/')
"""
Explanation: The Nurses Model
This tutorial includes everything you need to set up IBM Decision Optimization CPLEX Modeling for Python (DOcplex), build a Mathematical Programming model... |
mne-tools/mne-tools.github.io | 0.12/_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: .. _tut_epochs_objects:
The :class:Epochs <mne.Epochs> data structure: epoched data
End of explanation
"""
data_path = mne.datasets.sample.data_path()
# Load a dataset... |
lilleswing/deepchem | examples/tutorials/03_An_Introduction_To_MoleculeNet.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
"""
Explanation: Tutorial 3: An Introduction To MoleculeNet
One of the most powerful features... |
mbakker7/ttim | notebooks/pathline_trace.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import ttim as tt
"""
Explanation: Pathline tracing
End of explanation
"""
# parameters
Q = 100 # discharge of well, m^3/d
k = 10 # hydraulic conductivity, m/d
H = 10 # thickness of aquifer, m
Ss = 1e-4 # specific storage, m^(-1)
npor = 0.3 # porosity, -
xw = 0 # x-... |
Shirling-VT/davitpy_sam | docs/notebook/SuperDARN Data Plotting.ipynb | gpl-3.0 | %pylab inline
import datetime
import os
import matplotlib.pyplot as plt
from davitpy import pydarn
sTime = datetime.datetime(2008,2,22)
eTime = datetime.datetime(2008,2,23)
radar = 'bks'
beam = 7
"""
Explanation: This notebook will demonstrate how to do basic SuperDARN data plotting.
End of explanation
"""
#The fo... |
abhisheknaik96/differential-value-iteration | experiments.ipynb | mit | alphas = [1.0, 0.999, 0.99, 0.9, 0.7, 0.5, 0.3, 0.1, 0.01, 0.001]
max_iters = 50000
epsilon = 0.001
init_v = np.zeros(env.num_states())
init_r_bar_scalar = 0
convergence_flags = np.zeros(alphas.__len__())
for i, alpha in enumerate(alphas):
alg = RVI_Evaluation(env, init_v, alpha, ref_idx=0)
print(f'RVI Evaluat... |
mbakker7/ttim | notebooks/ttim_pumptest_neuman.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.optimize import fmin
from ttim import *
# problem definition
H = 39.4 * 0.3048 # thickness [meters]
xw, yw = 0, 0 # location well
xp, yp = 63 * 0.3048, 0 # Location piezometer [meter]
Qw = 1170 * 5.45 # discharge w... |
alexvmarch/pandas_intro | 01_parsing.ipynb | mit | def skeleton_naive_xyz_parser(path):
'''
Simple xyz parser.
'''
# Read in file
lines = None
with open(path) as f:
lines = f.readlines()
# Process lines
# ...
# Return processed lines
# ...
return lines
lines = skeleton_naive_xyz_parser(xyz_path)
lines
"""
Explan... |
sebastiandres/mat281 | clases/Unidad3-ModelamientoyError/Clase03-CrossValidation/CrossValidationYNormas.ipynb | cc0-1.0 | import numpy as np
from mat281_code import model
# Parameters
M = 5 # particiones
# Load data
data = model.load_data("data/dataN5000.txt") # Change here
N = data.shape[0]
testing_size = int(1./M * N)
# Permute the data
np.random.seed(23) # Change here
data = np.random.permutation(data)
# Create vector to store th... |
esa-as/2016-ml-contest | LA_Team/Facies_classification_LA_TEAM_03.ipynb | apache-2.0 | %%sh
pip install pandas
pip install scikit-learn
pip install keras
from __future__ import print_function
import numpy as np
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activa... |
recepkabatas/Spark | 4_convolutions.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import cPickle as pickle
import numpy as np
import tensorflow as tf
pickle_file = 'notMNIST.pickle'
with open(pickle_file, 'rb') as f:
save = pickle.load(f)
train_dataset = save['train_dataset']
train_la... |
psychemedia/futurelearnStatsSketches | notebooks/FutureLearn Stats Recipes.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from matplotlib.patches import Rectangle
import random
from ipywidgets import widgets, interact
from datetime import date, timedelta
def offsetDays(date_str,offset):
''' Return a date a specified number... |
vishal3011/Machine-Learning-Nanodegree | Capstone/TrumpHillary.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas import Series
import seaborn as sns
import calendar
import datetime
import re
df1 = pd.read_csv('tweets.csv', encoding="utf-8")
print df1.info()
df1 = df1[['handle','text','is_retweet']]
df = df1.loc[df1['is_retweet'... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch2-Problem_2-13.ipynb | unlicense | %pylab notebook
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 2
Problem 2-13
End of explanation
"""
Sbase = 100e3 # [VA]
Vp_ll = 14400 # [V] primary line-to-line volage of transformer bank
Vs_ll = 480 # [V] secondary line-to-line volage of transformer bank
Vp_ph = 8314 # [V] p... |
python-visualization/folium | examples/plugin-DualMap.ipynb | mit | import folium
import folium.plugins
"""
Explanation: DualMap plugin
This plugin is using the Leaflet plugin Sync by Jieter:
https://github.com/jieter/Leaflet.Sync
The goal is to have two maps side by side. When you pan or zoom on one map, the other will move as well.
End of explanation
"""
m = folium.plugins.DualMap... |
radical-cybertools/supercomputing2015-tutorial | 02_pilot/Radical_Pilot_YARN_Stampede.ipynb | apache-2.0 | import os,sys
import radical.pilot as rp
import ast
os.environ["RADICAL_PILOT_DBURL"]="mongodb://ec2-54-221-194-147.compute-1.amazonaws.com:24242/sc15tut"
os.environ["RADICAL_PILOT_VERBOSE"]="DEBUG"
def print_details(detail_object):
if type(detail_object)==str:
detail_object = ast.literal_eval(detail_obje... |
ProfessorKazarinoff/staticsite | content/code/matplotlib_plots/plotting_histograms_with_matplotlib_and_python.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
# if using a Jupyter notebook, includue:
%matplotlib inline
"""
Explanation: Histograms are a useful type of statistics plot for engineers. A histogram is a type of bar plot that shows the frequency or number of values compared to a set of value ranges. Histogram plot... |
NathanYee/ThinkBayes2 | code/chap03soln.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import thinkplot
from thinkbayes2 import Hist, Pmf, Suite, Cdf
"""
Explanation: Think Bayes: Chapter 3
This notebook presents example code and exercise solutions for Think Bayes.
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/lic... |
Upward-Spiral-Science/uhhh | code/.ipynb_checkpoints/Graph Analyses - DW-checkpoint.ipynb | apache-2.0 | import csv
from scipy.stats import kurtosis
from scipy.stats import skew
from scipy.spatial import Delaunay
import numpy as np
import math
import skimage
import matplotlib.pyplot as plt
import seaborn as sns
from skimage import future
import networkx as nx
%matplotlib inline
# Read in the data
data = open('../data/dat... |
Ccaccia73/semimonocoque | 06_CorrectiveSolutions-7nodes.ipynb | mit | from pint import UnitRegistry
import sympy
import networkx as nx
#import numpy as np
import matplotlib.pyplot as plt
#import sys
%matplotlib inline
from IPython.display import display
"""
Explanation: Semi-Monocoque Theory: corrective solutions
End of explanation
"""
from Section import Section
"""
Explanation: Imp... |
davidthomas5412/PanglossNotebooks | MassLuminosityProject/SummerResearch/MassMapsFromMassLuminosity_20170626.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
from bigmali.grid import Grid
from bigmali.prior import TinkerPrior
from bigmali.hyperparameter import get
import numpy as np
from scipy.stats import lognorm
from numpy.random import normal
#globals that functions rel... |
setiQuest/ML4SETI | tutorials/General_move_data_to_from_Object_Storage.ipynb | apache-2.0 | #!pip install --user --upgrade python-keystoneclient
#!pip install --user --upgrade python-swiftclient
"""
Explanation: How to move data to/from Object Storage.
This tutorial shows you how to use the python-swiftclient to move data to/from your Object Storge account.
This will be useful in a variety of ways.
If you'... |
mne-tools/mne-tools.github.io | dev/_downloads/d5a59f5536154816047f788dc4573ab4/60_sleep.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets.sleep_physionet.age import fetch_data
from mne.time_fr... |
AllenDowney/ModSim | python/soln/chap03.ipynb | gpl-2.0 | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
Kaggle/learntools | notebooks/deep_learning/raw/ex7_from_scratch.ipynb | apache-2.0 | import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow import keras
img_rows, img_cols = 28, 28
num_classes = 10
def prep_data(raw):
y = raw[:, 0]
out_y = keras.utils.to_categorical(y, num_classes)
x = raw[:,1:]
num_images = raw.shape[0]
out_x = x.reshape(num_... |
GoogleCloudPlatform/training-data-analyst | quests/bq-teradata/01_teradata_bq_essentials/labs/bigquery_essentials_for_teradata_users.ipynb | apache-2.0 | %%bash
gcloud config list
"""
Explanation: BigQuery Essentials for Teradata Users
In this lab you will take an existing 2TB+ TPC-DS benchmark dataset and learn common day-to-day activities you'll perform in BigQuery.
What you'll do
In this lab, you will learn how to:
Use BigQuery to access and query the TPC-DS benc... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Grids.ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
iris = sns.load_dataset('iris')
iris.head()
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Grids
Grids are general types of plots that allow you to map plot types to rows and columns of a gri... |
poldrack/fmri-analysis-vm | analysis/machinelearning/Classification.ipynb | mit | import numpy
%matplotlib inline
import matplotlib.pyplot as plt
import scipy.stats
import matplotlib
from matplotlib.colors import ListedColormap
import sklearn.neighbors
import sklearn.cross_validation
import sklearn.metrics
import sklearn.lda
import sklearn.svm
import sklearn.linear_model
from sklearn.model_selection... |
xlhtc007/osqf2015 | notebooks/SparkVaR.ipynb | mit | Simulation = namedtuple('Simulation', ('date', 'neutral', 'scenarios'))
RFScenario = namedtuple('RFScenario', ('rf', 'date', 'neutral', 'scenarios'))
from pyspark.mllib.linalg import Vectors, DenseVector, SparseVector, _convert_to_vector
def parse(row):
DATE_FMT = "%Y-%m-%d"
row[0] = datetime.datetime.strptim... |
jvcarr/portfolio | projects/Soccer-Watchability/Football-Watchability-Clean.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import pairwise_distances
from sklearn import cluster
events_df = pd.read_csv('GA/Data/events.csv')
ginf = pd.read_csv('GA/Data/ginf.csv')
events_df.groupby('id_odsp').id_event.count().plot('hist')
plt.... |
dtamayo/rebound | ipython_examples/WHFast.ipynb | gpl-3.0 | import rebound
"""
Explanation: WHFast tutorial
This tutorial is an introduction to the python interface of WHFast, a fast and unbiased symplectic Wisdom-Holman integrator. This integrator is well suited for integrations of planetary systems in which the planets stay roughly on their orbits. If close encounters and co... |
Chipe1/aima-python | knowledge_FOIL.ipynb | mit | from knowledge import *
from notebook import psource
"""
Explanation: KNOWLEDGE
The knowledge module covers Chapter 19: Knowledge in Learning from Stuart Russel's and Peter Norvig's book Artificial Intelligence: A Modern Approach.
Execute the cell below to get started.
End of explanation
"""
psource(FOIL_container)
... |
JacksonTanBS/iPythonNotebooks | 150528 How Much of Earth is Raining at Any One Time.ipynb | gpl-2.0 | import numpy as np
import h5py
from glob import glob
imergpath = '/media/Sentinel/data/IMERG/'
year, month, day = 2014, 4, 1
"""
Explanation: This notebook investigates the simple question of how much of the Earth is raining using one day of IMERG data.
Assumption:
* rainfall is statistically constant over one day (t... |
jaidevd/inmantec_fdp | notebooks/day2/01_basic_data_structs.ipynb | mit | """
----------------------------------------------------------------------
Filename : 01_basic_data_structs.py
Date : 12th Dec, 2013
Author : Jaidev Deshpande
Purpose : To get started with basic data structures in Pandas
Libraries: Pandas 0.12 and its dependencies
------------------------------------------------... |
mikesj-public/dcgan-autoencoder | dcgan_autoencoder_notebook.ipynb | mit | import sys
sys.path.append('..')
import os
import json
from time import time
import numpy as np
from tqdm import tqdm
import theano
import theano.tensor as T
from theano.sandbox.cuda.dnn import dnn_conv
from PIL import Image
"""
Explanation: Imports
End of explanation
"""
from lib import activations
from lib impo... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Trans... |
igabr/Metis_Projects_Chicago_2017 | 05-project-kojack/Final_Notebook.ipynb | mit | df = unpickle_object("FINAL_DATAFRAME_PROJ_5.pkl")
df.head()
def linear_extrapolation(df, window):
pred_lst = []
true_lst = []
cnt = 0
all_rows = df.shape[0]
while cnt < window:
start = df.iloc[cnt:all_rows-window+cnt, :].index[0].date()
end = df.iloc[cnt:all_rows-window+cnt, :].... |
dmolina/scopus_analysis | Reading papers from user.ipynb | gpl-3.0 | import requests
import json
from my_scopus import MY_API_KEY, PROXY_URL, MY_AUTHOR_ID
"""
Explanation: Getting information from Scopus
Note: This work is obtained from http://kitchingroup.cheme.cmu.edu/blog/2015/04/03/Getting-data-from-the-Scopus-API/, its author is really the author of that information. I have mainly... |
mne-tools/mne-tools.github.io | 0.20/_downloads/804ea48504b27f5f04fd03d517675af5/plot_point_spread.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, apply_inverse
from mne.simulation import simulate_stc, simulate_evoked
"""
Explanation: Corrupt known signal with point spread
The aim of this tutorial is to demonstrate how to put ... |
vermouth1992/tf-playground | pytorch/ANIML.ipynb | apache-2.0 | class SineWaveTask:
def __init__(self):
self.a = np.random.uniform(0.1, 5.0)
self.b = np.random.uniform(0, 2*np.pi)
self.train_x = None
def f(self, x):
return self.a * np.sin(x + self.b)
def training_set(self, size=10, force_new=False):
if self.train... |
hbwzhsh/pyDataScienceToolkits_Base | Visualization/(2)interesting_plot.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
"""
Explanation: 内容索引
动画 --- 动画模块animation、FuncAnimation函数
dsafa
三维绘图 --- Axes3D对象、plot_surface函数
等高线图 --- contour函数、contourf函数
End of explanation
"""
fig = plt.figure()
ax = fig.add_subplot(111)
N = 10
x ... |
serpilliere/miasm | doc/expression/expression.ipynb | gpl-2.0 | from miasm.expression.expression import *
a = ExprId("a", 32)
print(a)
print(repr(a))
# Identifier
print(a.name)
print(a.size)
cst1 = ExprInt(16, 32)
print(cst1)
cst2 = ExprInt(-1, 32)
print(cst2)
# Show associated value
print(int(cst1))
"""
Explanation: Intermediate Representation
Miasm provides an intermediate r... |
mediagestalt/Counting-Word-Frequencies | Counting Word Frequencies.ipynb | mit | # 1. open the text file
infile = open('data/39.txt')
# 2. read the file and assign it to the variable 'text'
text = infile.read()
# 3. close the text file
infile.close()
# 4. split the variable 'text' into distinct word strings
words = text.split()
"""
Explanation: Counting Word Frequencies with Python
The debates tha... |
enakai00/jupyter_tfbook | Chapter04/MNIST dynamic filter result.ipynb | gpl-3.0 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
"""
Explanation: [MDR-01] 必要なモジュールをインポートします。
End of explanation
"""
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
"""
Explanation: [MDR-02] MNISTのデータセットを用意します。
End of... |
james-prior/cohpy | 20170130-cohpy-repr-versus-str.ipynb | mit | things = (
1/3,
.1,
1+2j,
[1, 'hello'],
('creosote', 3),
{2: 'world'},
{'swallow'},
[1., {"You're": (3, '''tr"'e'''), 1j: 'complexity'}, 17],
)
def show(function, things):
print(function)
for thing in things:
print(function(thing))
show(str, things)
show(repr, things)
... |
tensorflow/docs | site/en/tutorials/load_data/pandas_dataframe.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... |
raoyvn/deep-learning | intro-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
wmfschneider/CHE30324 | Resources/Jacobs+Python+Tutorial+Draft.ipynb | gpl-3.0 | #A variable stores a piece of data and gives it a name
answer = 42
#answer contained an integer because we gave it an integer!
is_it_tuesday = True
is_it_wednesday = False
#these both are 'booleans' or true/false values
pi_approx = 3.1415
#This will be a floating point number, or a number containing digits after t... |
Britefury/deep-learning-tutorial-pydata2016 | SUPPLEMENTARY - Standardisation.ipynb | mit | %matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
import seaborn
from mpl_toolkits.mplot3d import Axes3D
from sklearn.decomposition import PCA
seaborn.set_style('white')
# We are using the fuel library to acquire our data.
from fuel.datasets.cifar10 import CIFAR10
dataset = CIFAR10(which_se... |
wmaciel/crowd-sketch-filter | src/notebook/pybossa_setup.ipynb | mit | input_image_path = '../../img/lena.bmp'
n_x = 10
n_y = 10
input_splits_folder = '../../out_img/'
n_assigns = 5
output_stitched_folder = '../../stitched/'
output_blended_image_path = '../../blended.jpg'
output_blended_folder = '../../blended/'
ftp_pub_folder = 'pub_html'
ftp_divs_folder = 'img_divs'
# Project Attribute... |
mne-tools/mne-tools.github.io | stable/_downloads/82d9c13e00105df6fd0ebed67b862464/ssp_projs_sensitivity_map.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import matplotlib.pyplot as plt
from mne import read_forward_solution, read_proj, sensitivity_map
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path / 'subjects'
meg_path = data... |
ebonnassieux/fundamentals_of_interferometry | 2_Mathematical_Groundwork/fft_implementation_assignment.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
import cmath
"""
Explanation: Implementation of a Radix-2 Fast Fourier Transform
Import standard modules:
End of explanation
"""
def loop_DFT(x):
"""
Impleme... |
ameliecordier/iutdoua-info_algo2015 | 2015-11-26 - TD14 - Rappels de cours sur les entrées, les sorties, et les entrées-sorties.ipynb | cc0-1.0 | '''
:entrée n: int, SAISIE au clavier
:pré-cond: n ≥ 0
:sortie f: int, AFFICHÉE à l'écran
:post-cond: f = n! = 1×2×3×...×n
'''
n = int(input("Valeur de n (entier positif ou nul) ? "))
f = 1
i = 2
while i < n:
f = f*i
i = i+1
print(f)
'''
:entrée n: int, AFFECTÉE précédemment
:pré-cond: n ≥ 0
:sortie f: int, A... |
mzszym/oedes | examples/numeric/fprecision.ipynb | agpl-3.0 | import numpy as np
types = [np.double, np.float128]
try:
# oedesext are extensions to oedes not yet released as open-source
import oedesext.precision
types.append(oedesext.precision.qfloat)
except:
oedesext=None
%matplotlib inline
from oedes import *
import matplotlib.pylab as plt
import scipy.constan... |
EderSantana/blog | 2015-08-02 sparse coding with keras.ipynb | mit | class SparseCoding(Layer):
def __init__(self, input_dim, output_dim,
init='glorot_uniform',
activation='linear',
truncate_gradient=-1,
gamma=.1, #
n_steps=10,
batch_size=100,
return_reconstruction... |
graphistry/pygraphistry | demos/demos_databases_apis/tigergraph/social_raw_REST_calls.ipynb | bsd-3-clause | TIGER_CONFIG = {
'fqdn': 'http://MY_TIGER_SERVER:9000'
}
"""
Explanation: Graphistry Tutorial: Notebooks + TigerGraph via raw REST calls
Connect to Graphistry, TigerGraph
Load data from TigerGraph into a Pandas Dataframes
Plot in Graphistry as a Graph and Hypergraph
Explore in Graphistry
Advanced notebooks
Confi... |
fevangelista/pyWicked | tutorials/05-Expressions.ipynb | mit | import wicked as w
from IPython.display import display, Math, Latex
def latex(expr):
"""Function to render any object that has a member latex() function"""
display(Math(expr.latex()))
w.reset_space()
w.add_space("o", "fermion", "occupied", ['i','j','k','l','m'])
w.add_space("v", "fermion", "unoccupied", ['a',... |
turbomanage/training-data-analyst | quests/sparktobq/03_automate.ipynb | apache-2.0 | # Catch up cell. Run if you did not do previous notebooks of this sequence
!wget http://kdd.ics.uci.edu/databases/kddcup99/kddcup.data_10_percent.gz
BUCKET='cloud-training-demos-ml' # CHANGE
!pip install google-compute-engine
!gsutil cp kdd* gs://$BUCKET/
BUCKET='cloud-training-demos-ml' # CHANGE
!gsutil ls gs://$BU... |
amueller/scipy-2017-sklearn | notebooks/07.Unsupervised_Learning-Transformations_and_Dimensionality_Reduction.ipynb | cc0-1.0 | ary = np.array([1, 2, 3, 4, 5])
ary_standardized = (ary - ary.mean()) / ary.std()
ary_standardized
"""
Explanation: Unsupervised Learning Part 1 -- Transformation
Many instances of unsupervised learning, such as dimensionality reduction, manifold learning, and feature extraction, find a new representation of the input... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/CNN/cifar10_cnn.ipynb | apache-2.0 | import torch
import numpy as np
# check if CUDA is available
train_on_gpu = torch.cuda.is_available()
if not train_on_gpu:
print('CUDA is not available. Training on CPU ...')
else:
print('CUDA is available! Training on GPU ...')
"""
Explanation: Convolutional Neural Networks
In this notebook, we train a C... |
zhuanxuhit/deep-learning | weight-initialization/.ipynb_checkpoints/weight_initialization-checkpoint.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 fi... |
Caoimhinmg/PmagPy | data_files/Essentials_Examples/Notebooks/essentials_ch_3_template.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt # import the plotting module
%matplotlib inline
# This allows us to plot in the notebook environment
"""
Explanation: Jupyter Notebook for turning in solutions to the problems in the Essentials of Paleomagnetism Textbook by L. Tauxe
Problems in Chapter 3
Problem 1a
... |
batfish/pybatfish | jupyter_notebooks/Getting started with Batfish.ipynb | apache-2.0 | # Import packages
%run startup.py
bf = Session(host="localhost")
"""
Explanation: Getting Started with Batfish
This notebook uses pybatfish, a Python-based SDK for Batfish, to analyze a sample network. It shows how to submit your configurations and other network data for analysis and how to query its vendor-neutral ne... |
kmunve/APS | aps/notebooks/ml_varsom/preprocessing.ipynb | mit | import sys
import pandas as pd # check out Modin https://towardsdatascience.com/get-faster-pandas-with-modin-even-on-your-laptops-b527a2eeda74
import numpy as np
import json
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path
import datetime
# Add path to APS modules
aps_pth = Path('.').abs... |
usdivad/fibonaccistretch | nbs/calculate_step_stretch_ratios.ipynb | mit | # Imports
%matplotlib inline
import pardir; pardir.pardir() # Allow imports from parent directory
import fibonaccistretch as fib
import bjorklund
# Setting up basics
original_rhythm = [1,0,0,1,0,0,1,0]
target_rhythm = [1,0,0,0,0,1,0,0,0,0,1,0,0]
fib.calculate_pulse_ratios(original_rhythm, target_rhythm)
fib.calculat... |
JasonSanchez/w261 | week5/MIDS-W261-HW-05-Sanchez.ipynb | mit | !ls
"""
Explanation: MIDS - w261 Machine Learning At Scale
Course Lead: Dr James G. Shanahan (email Jimi via James.Shanahan AT gmail.com)
Assignment - HW5
Name: Jason Sanchez
Class: MIDS w261 (Section Fall 2016 Group 2)
Email: jason.sanchez@iSchool.Berkeley.edu
Week: 5
Due Time: 2 Phases.
HW5 Phase 1
... |
JoseGuzman/myIPythonNotebooks | Stochastic_systems/Generate random numbers .ipynb | gpl-2.0 | %pylab inline
from scipy.stats import norm
"""
Explanation: <H2>Generate random numbers with a given (numerical) distribution</H2>
End of explanation
"""
# Create a normal distribution
mu = 50
sigma = 10 # standard deviation
rv = norm(loc = mu, scale = sigma)
start = rv.ppf(0.00001)
stop = rv.ppf(0.99999)
x = n... |
ricklupton/sankeyview | docs/cookbook/scale.ipynb | mit | import pandas as pd
from io import StringIO
flows = pd.read_csv(StringIO("""
year,source,target,value
2020,A,B,10
2025,A,B,20
"""))
flows
from floweaver import *
# Set the default size to fit the documentation better.
size = dict(width=100, height=100,
margins=dict(left=20, right=20, top=10, bottom=10))... |
michigraber/neuralyzer | notebooks/dev/DataUsage.ipynb | mit | %matplotlib inline
import os
import numpy as np
from matplotlib import pyplot as plt
import mpld3
import neuralyzer
from neuralyzer.im import smff
plt.rcParams['image.cmap'] = 'gray'
plt.rcParams['image.interpolation'] = 'none'
plt.rcParams['figure.figsize'] = (8,8)
#datafile = '/Users/michael/coding/RIKEN/data/1403... |
daneschi/berkeleytutorial | tutorial/01_sparseRegression/sparseRegression.ipynb | mit | # Imports
import sys,math
sys.path.insert(0, '..') # path to ../common.py
import numpy as np
import matplotlib.pyplot as plt
from common import *
# READ PRESSURES AND FLOWS FROM FILE
qVals = np.loadtxt('Qgeneral')
pVals = np.loadtxt('Pgeneral')
print('Total Number of interfaces: %d' % (qVals.shape[1]))
print('Total N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.