repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties:... |
naveensr89/Scipy-explore | linear_reg.ipynb | gpl-2.0 | %matplotlib inline
%pylab inline
from __future__ import print_function
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import theano
import numpy as np
from theano import tensor as T
from numpy.linalg import inv
"""
Explanation: Sample code to test features of 'NumPy', 'Matplotlib' and 'Scipy... |
PyDataBH/data-scraping-letrasmus | Raspando dados na Web com Requests e BeautifulSoup.ipynb | mit | # Importando a biblioteca Requests
import requests
url = "https://www.letras.mus.br/john-mayer/420168/"
r = requests.get(url)
type(r)
"""
Explanation: John Mayer - Gravity
John Clayton Mayer é um cantor, compositor e produtor musical norte-americano. Nascido em Bridgeport, no estado de Connecticut, ele estudou na B... |
ewanbarr/anansi | docs/Molonglo_coords.ipynb | apache-2.0 | import numpy as np
import ephem as e
from scipy.optimize import minimize
import matplotlib.pyplot as plt
np.set_printoptions(precision=5,suppress =True)
"""
Explanation: Molonglo coordinate transforms
Useful coordinate transforms for the molonglo radio telescope
End of explanation
"""
def rotation_matrix(angle, d):
... |
blua/deep-learning | embeddings/Skip-Grams-Solution.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
weikang9009/pysal | notebooks/explore/spaghetti/Spaghetti_Pointpatterns_Empirical.ipynb | bsd-3-clause | import os
last_modified = None
if os.name == "posix":
last_modified = !stat -f\
"# This notebook was last updated: %Sm"\
Spaghetti_Pointpatterns_Empirical.ipynb
elif os.name == "nt":
last_modified = !for %a in (Spaghetti_Pointpatterns_Empirical.ipynb)\
... |
Sinar/sinar.myreps | docs/Malaysian MP Statistics.ipynb | agpl-3.0 | import requests
import json
#Dewan Rakyat MP Posts in Sinar Malaysia Popit Database
posts = []
for page in range(1,10):
dewan_rakyat_request = requests.get('http://sinar-malaysia.popit.mysociety.org/api/v0.1/search/posts?q=organization_id:53633b5a19ee29270d8a9ecf'+'&page='+str(page))
for post in (json.loads(de... |
mikheyev/phage-lab | src/Raw data.ipynb | mit | !ls -lh ../data/reads
"""
Explanation: What do the data look like?
Jupyter IPython notebooks, such as this one, allow you to run both Python code and, using 'magics' also shell commands. In this tutorial we'll use both, since we will be interfacing with a variety of software, as well as processing data.
First, let's l... |
uwoseis/zephyr | notebooks/Compare Solutions Homogeneous - 3D.ipynb | mit | import sys
sys.path.append('../')
import numpy as np
from zephyr.backend import MiniZephyr25D, SparseKaiserSource, AnalyticalHelmholtz
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png')
matp... |
SJSlavin/phys202-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
print(a + b)
"""
Explanation: Interact basics
Wri... |
scientific-visualization-2016/ClassMaterials | Week-03/04-plotting-seal-data.ipynb | cc0-1.0 | import os
import pandas as pd
import numpy as np
df = pd.read_csv("seal-behav.csv", parse_dates=[1])
df.set_index("timestamp",inplace=True)
df.head(5)
"""
Explanation: <img src='https://www.rc.colorado.edu/sites/all/themes/research/logo.png' style="height:75px">
Plotting the Seal Data on a map
Dependend on the prev... |
ImAlexisSaez/deep-learning-specialization-coursera | course_1/week_4/assignment_1/building_your_deep_neural_network_step_by_step_v2.ipynb | mit | import numpy as np
import h5py
import matplotlib.pyplot as plt
from testCases_v2 import *
from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward
%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['imag... |
mne-tools/mne-tools.github.io | 0.20/_downloads/1af5a35cbb809b9480120842884536c5/plot_brainstorm_auditory.ipynb | bsd-3-clause | # Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
import os.path as op
import pandas as pd
import numpy as np
import mne
from mne import combine_evoked
from mne.minimum_norm impor... |
shakhova/BananaML | 1st_1.10.17/introduction_to_ipython.ipynb | gpl-3.0 | ! echo 'hello, world!'
!echo $t
%%bash
mkdir test_directory
cd test_directory/
ls -a
#удаление директории, если она не нужна
! rm -r test_directory
"""
Explanation: text
Header
для редактирования формулы ниже использует синтаксис tex
$$ c = \sqrt{a^2 + b^2}$$
End of explanation
"""
%%cmd
mkdir test_directory
cd ... |
hasecbinusr/pysal | pysal/contrib/clusterpy/clusterpy.ipynb | bsd-3-clause | mexico = cp.importCsvData(ps.examples.get_path('mexico.csv'))
mexico.fieldNames
w = ps.open(ps.examples.get_path('mexico.gal')).read()
w.n
cp.addRook2Layer(ps.examples.get_path('mexico.gal'), mexico)
mexico.Wrook
mexico.cluster('arisel', ['pcgdp1940'], 5, wType='rook', inits=10, dissolve=0)
mexico.fieldNames
m... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
tensorflow/docs-l10n | site/ja/addons/tutorials/networks_seq2seq_nmt.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... |
parrt/msan692 | notes/datastructures.ipynb | mit | s = {1,3,2,9}
"""
Explanation: Data structures
For a refresher on object-oriented programming, see Object-oriented programming.
A simple set implementation
Sets in Python can be specified with set notation:
End of explanation
"""
s = set()
s.add(1)
s.add(3)
"""
Explanation: Or with by creating a set object and assi... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.shuffle.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.shuffle(a1, ...)
The (accessible part of the) shuffle product of automata.
Preconditions:
- all the labelsets are letterized
See also:
- automaton.conjunction
- automaton.infiltration
- expression.shuffle
Examples
End of explanation
"""
std = lambda exp: vcsn.B.expression(exp).... |
blockstack/packaging | imported/future/docs/notebooks/.ipynb_checkpoints/Writing Python 2-3 compatible code-checkpoint.ipynb | gpl-3.0 | # Python 2 only:
print 'Hello'
# Python 2 and 3:
print('Hello')
"""
Explanation: Cheat Sheet: Writing Python 2-3 compatible code
Copyright (c): 2013-2015 Python Charmers Pty Ltd, Australia.
Author: Ed Schofield.
Licence: Creative Commons Attribution.
A PDF version is here: http://python-future.org/compatible_idioms... |
njtwomey/ADS | 01_data_ingress/02_dicts.ipynb | mit | from __future__ import print_function
import json
def print_dict(dd):
print(json.dumps(dd, indent=2))
"""
Explanation: Define simple printing functions
End of explanation
"""
d1 = dict()
d2 = {}
print_dict(d1)
print_dict(d2)
"""
Explanation: Constructing and allocating dictionaries
The syntax for dictiona... |
tensorflow/docs | site/en/r1/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... |
quantopian/research_public | notebooks/data/quandl.cboe_vxfxi/notebook.ipynb | apache-2.0 | # For use in Quantopian Research, exploring interactively
from quantopian.interactive.data.quandl import cboe_vxfxi as dataset
# import data operations
from odo import odo
# import other libraries we will use
import pandas as pd
# Let's use blaze to understand the data a bit using Blaze dshape()
dataset.dshape
# And... |
metpy/MetPy | v0.4/_downloads/Advanced_Sounding.ipynb | bsd-3-clause | from datetime import datetime
import matplotlib.pyplot as plt
import metpy.calc as mpcalc
from metpy.io import get_upper_air_data
from metpy.io.upperair import UseSampleData
from metpy.plots import SkewT
from metpy.units import concatenate
with UseSampleData(): # Only needed to use our local sample data
# Downl... |
AllenDowney/ThinkBayes2 | examples/pair_dice.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 thinkplot
from thinkbayes2 import Pmf, Suite
from fractio... |
diegocavalca/Studies | deep-learnining-specialization/2. improving deep neural networks/resources/Gradient Checking.ipynb | cc0-1.0 | # Packages
import numpy as np
from testCases import *
from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector
"""
Explanation: Gradient Checking
Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking.
You are ... |
ewulczyn/talk_page_abuse | src/data_generation/crowdflower_analysis/src/Crowdflower Analysis (Experiment v. 1).ipynb | apache-2.0 | %matplotlib inline
from __future__ import division
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.set_option('display.width', 1000)
pd.set_option('display.max_colwidth', 1000)
# Download data from google drive (Respect Eng / Wiki Collab): wikipdia data/v2_annotated
blocked_dat = pd.read_csv... |
vikasgorur/cs229 | Linear Regression.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from sklearn.preprocessing import scale
"""
Explanation: CS229: Lecture 2
Linear Regression, Gradient Descent
In this notebook we implement some of the concepts discussed in Lecture 2 of CS229 - Machine Le... |
greenelab/GCB535 | 26_Prelab_Python-IV/Lesson4.ipynb | bsd-3-clause | print range(5)
"""
Explanation: Lesson 4: Data Structures and File Parsing
Table of Contents
Data structures I: Lists
Data structures II: Dictionaries
String parsing with .split()
Test your understanding: practice set 4
1. Data Structures I: Lists
What is a data structure?
A data structure is basically a way of st... |
atulsingh0/MachineLearning | python_DC/LP_Summary_MissingData_#3.ipynb | gpl-3.0 | # idxmin and idxmax, return indirect statistics like the index value where the minimum or maximum values are attained
df.idxmin()
# for cumulative sum
df.cumsum()
# describing
df.describe()
"""
Explanation: Options for reduction method
axis Axis to reduce over. 0 for DataFrame’s rows and 1 for columns.
skipna... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.sta... |
darkomen/TFG | ipython_notebooks/06_regulador_experto/.ipynb_checkpoints/ensayo2-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_compute_raw_data_spectrum.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io, read_proj, read_selection
from mne... |
miguelfrde/stanford-cs231n | assignment2/Dropout.ipynb | mit | # As usual, a bit of setup
from __future__ import print_function
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solv... |
ageron/ml-notebooks | tools_numpy.ipynb | apache-2.0 | from __future__ import division, print_function, unicode_literals
"""
Explanation: Tools - NumPy
NumPy is the fundamental library for scientific computing with Python. NumPy is centered around a powerful N-dimensional array object, and it also contains useful linear algebra, Fourier transform, and random number functi... |
gilmana/Cu_transition_time_course- | data_explore_failed_clstr_mthds/HDBSCAN_clustering.ipynb | mit | # Clustering the pearsons_R with N/A vlaues removed
hdb_t1 = time.time()
hdb_pearson_r = hdbscan.HDBSCAN(metric = "precomputed", min_cluster_size=10).fit(df3_pearson_r)
hdb_pearson_r_labels = hdb_pearson_r.labels_
hdb_elapsed_time = time.time() - hdb_t1
print("time to cluster", hdb_elapsed_time)
print(np.unique(hdb_... |
david-hoffman/scripts | notebooks/montecarlo_numbapro.ipynb | apache-2.0 | import numpy as np # numpy namespace
from timeit import default_timer as timer # for timing
from matplotlib import pyplot # for plotting
import math
def step_numpy(dt, prices, c0, c1, noises):
return prices * np.exp(c0 * dt + c1 * noises)
def mc_numpy(paths, dt, interest, vol... |
scikit-optimize/scikit-optimize.github.io | dev/notebooks/auto_examples/sklearn-gridsearchcv-replacement.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
"""
Explanation: Scikit-learn hyperparameter search wrapper
Iaroslav Shcherbatyi, Tim Head and Gilles Louppe. June 2017.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Introduction
This example assumes basic familiari... |
imamol555/Machine-Learning | DecisionTree_Math_Fruits.ipynb | mit | training_data = [
['Green', 3, 'Apple'],
['Yellow', 3, 'Apple'],
['Red', 1, 'Grape'],
['Red', 1, 'Grape'],
['Yellow', 3, 'Lemon'],
]
"""
Explanation: Decision Tree
Training Data : Toy Dataset for fruit classifier
End of explanation
"""
#Column names for our data
header = ["color","diameter","labe... |
fcollonval/coursera_data_visualization | PotentialModerator.ipynb | mit | # Magic command to insert the graph directly in the notebook
%matplotlib inline
# Load a useful Python libraries for handling data
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import scipy.stats as stats
import seaborn as sns
import matplotlib.pyplot as plt
from IPython.display import Ma... |
georgetown-analytics/machine-learning | examples/kbelita/Clustering-RealEstateData-City.ipynb | mit | import pandas as pd
import csv
import os
import numpy as np
import matplotlib
import seaborn as sns
import matplotlib.pyplot as plt
#from pandas.tools.plotting import scatter_matrix
from __future__ import print_function
import urllib.request
from sklearn.feature_selection import SelectFromModel
from sklearn.decomposit... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Milestone Project 1- Walkthrough Steps Workbook.ipynb | apache-2.0 | # For using the same code in either Python 2 or 3
from __future__ import print_function
## Note: Python 2 users, use raw_input() to get player input. Python 3 users, use input()
"""
Explanation: Milestone Project 1: Walk-through Steps Workbook
Below is a set of steps for you to follow to try to create the Tic Tac To... |
rvperry/phys202-2015-work | assignments/assignment09/IntegrationEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy import integrate
"""
Explanation: Integration Exercise 1
Imports
End of explanation
"""
def trapz(f, a, b, N):
"""Integrate the function f(x) over the range [a,b] with N points."""
h=(b-a)/N
A=0
for i in range(N):
... |
OSGeo-live/CesiumWidget | Examples/CesiumWidget Example with CZML library.ipynb | apache-2.0 | from CesiumWidget import CesiumWidget
import czml
"""
Explanation: CesiumWidget together with CZML library
This notebook shows how to use the CesiumWidget together with the CZML library from https://github.com/cleder/czml
If the CesiumWidget is installed correctly, Cesium should be accessable at:
http://localhost:8888... |
VandyAstroML/Vanderbilt_Computational_Bootcamp | notebooks/Week_12/12_Pandas_II_Advanced_Data_Handling.ipynb | mit | # Importing modules
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
sns.set_context("notebook")
"""
Explanation: <span style="color:blue">Week 12 - Pandas II</span>
<span style="color:red">Today's Agenda</span>
Useful functions when using Pandas
Review... |
GoogleCloudPlatform/ml-design-patterns | 03_problem_representation/ensemble_methods.ipynb | apache-2.0 | import os
import pandas as pd
import tensorflow as tf
from tensorflow import keras
from tensorflow import feature_column as fc
from tensorflow.keras import layers, models, Model
df = pd.read_csv("./data/babyweight_train.csv")
df.head()
"""
Explanation: Ensemble Design Pattern
Stacking is an Ensemble method which co... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/adv_logistic_reg_TF2.0.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow import keras
import os
import tempfile
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import sklearn
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sk... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/bcc-esm1/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'bcc-esm1', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: BCC
Source ID: BCC-ESM1
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance, ... |
mne-tools/mne-tools.github.io | 0.21/_downloads/a09c964ce37825f750704113fa863276/plot_mne_inverse_envelope_correlation_volume.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# Sheraz Khan <sheraz@khansheraz.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import mne
from mne.beamformer import make_lcmv, apply_lcmv_epochs
from mne.connectivity import envelope_correlation
fro... |
atcemgil/notes | DynamicalSystems.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pylab as plt
N = 100
T = 100
a = 0.9
xm = 0.9
sP = np.sqrt(0.001)
sR = np.sqrt(0.01)
x1 = np.zeros(N)
x2 = np.zeros(N)
y = np.zeros(N)
for i in range(N):
if i==0:
x1[0] = xm
x2[0] = 0
else:
x1[i] = xm + a*x1[i-1] + np.random.norm... |
qkitgroup/qkit | qkit/doc/notebooks/resonator_class_basics.ipynb | gpl-2.0 | ## start qkit and import the necessary classes; here we assume a already configured qkit environment
import qkit
qkit.start()
from qkit.analysis.resonator import Resonator
"""
Explanation: Resonator class basics
The resonator class can be used to fit resonator measurements (or fit live during the measurement, see th... |
jonathf/chaospy | docs/user_guide/fundamentals/quasi_random_samples.ipynb | mit | import chaospy
uniform_cube = chaospy.J(chaospy.Uniform(0, 1), chaospy.Uniform(0, 1))
count = 300
random_samples = uniform_cube.sample(count, rule="random", seed=1234)
additive_samples = uniform_cube.sample(count, rule="additive_recursion")
halton_samples = uniform_cube.sample(count, rule="halton")
hammersley_sample... |
fifabsas/talleresfifabsas | python/Extras/Incertezas/introduccion.ipynb | mit | x = 5
y = 'Hola mundo!'
z = [1,2,3]
"""
Explanation: Taller de Python - Estadística en Física Experimental - 1er día
Esta presentación/notebook está disponible:
Repositorio Github FIFA BsAs (para descargarlo, usen el botón raw o hagan un fork del repositorio)
Página web de talleres FIFA BsAs
Programar ¿con qué se com... |
xpharry/Udacity-DLFoudation | tutorials/batch-norm/.ipynb_checkpoints/Batch_Normalization_Lesson-checkpoint.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)
"... |
ingmarschuster/rkhs_demo | RKHS_in_Machine_learning.ipynb | gpl-3.0 | from __future__ import division, print_function, absolute_import
from IPython.display import SVG, display, Image
import numpy as np, scipy as sp, pylab as pl, matplotlib.pyplot as plt, scipy.stats as stats, sklearn, sklearn.datasets
from scipy.spatial.distance import squareform, pdist, cdist
import distributions as d... |
mne-tools/mne-tools.github.io | 0.24/_downloads/a179627fc73cce931ace004638e9685c/read_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator
from mne.viz import set_3d_view
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
fname_trans = data_p... |
weikang9009/pysal | notebooks/explore/pointpats/marks.ipynb | bsd-3-clause | from pysal.explore.pointpats import PoissonPointProcess, PoissonClusterPointProcess, Window, poly_from_bbox, PointPattern
import pysal.lib as ps
from pysal.lib.cg import shapely_ext
%matplotlib inline
import matplotlib.pyplot as plt
# open the virginia polygon shapefile
va = ps.io.open(ps.examples.get_path("virginia.s... |
tobsecret/Golub_dataset_Class_Prediction_Python | Golub_dataset_Class_Prediction.ipynb | mit | test = pd.read_csv('data_set_ALL_AML_independent.tsv', sep='\t', header=0, index_col=0)
train = pd.read_csv('data_set_ALL_AML_train.tsv', sep='\t', header=0, index_col=0)
train.drop(train.columns[len(train.columns)-1], axis=1, inplace=True)
#The sample_table contains the labels AML/ ALL
sample_table = pd.read_csv('t... |
sorig/shogun | doc/ipython-notebooks/clustering/GMM.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
# import all Shogun classes
from shogun import *
from matplotlib.patches import Ellipse
# a tool for visualisation
def get_gaussian_ellipse_artist(mean, cov, nstd=1.96, color="red", linewidth=3):
"""
Retur... |
jseabold/statsmodels | examples/notebooks/metaanalysis1.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy import stats, optimize
from statsmodels.regression.linear_model import WLS
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.stats.meta_analysis import (
effectsize_smd, effectsize_2proportions, combine_effects,
_... |
gkc1000/pyscf | pyscf/nao/notebook/AWS/example-ase-siesta-pyscf-ch4-eels.ipynb | apache-2.0 | # import libraries and set up the molecule geometry
from ase.units import Ry, eV, Ha
from ase.calculators.siesta import Siesta
from ase import Atoms
import numpy as np
import matplotlib.pyplot as plt
from ase.build import molecule
CH4 = molecule("CH4")
# visualization of the particle
from ase.visualize import view
... |
landlab/landlab | notebooks/teaching/geomorphology_exercises/channels_streampower_notebooks/stream_power_channels_class_notebook.ipynb | mit | # Code block 1
import copy
import numpy as np
from matplotlib import pyplot as plt
from landlab import RasterModelGrid, imshow_grid
from landlab.components import (
ChannelProfiler,
ChiFinder,
FlowAccumulator,
SteepnessFinder,
StreamPowerEroder,
)
from landlab.io import write_esri_ascii
"""
Expl... |
matthias-k/pysaliency | notebooks/Demo_Saliency_Maps.ipynb | mit | import pysaliency
import pysaliency.external_datasets
data_location = 'test_datasets'
mit_stimuli, mit_fixations = pysaliency.external_datasets.get_mit1003(location=data_location)
index = 0
plt.imshow(mit_stimuli.stimuli[index])
f = mit_fixations[mit_fixations.n == index]
plt.scatter(f.x, f.y, color='r')
_ = plt.axi... |
thalesians/tsa | src/jupyter/python/foundations/statistical-inference-and-estimation-theory.ipynb | apache-2.0 | # Copyright (c) Thalesians Ltd, 2018-2019. All rights reserved
# Copyright (c) Paul Alexander Bilokon, 2018-2019. All rights reserved
# Author: Paul Alexander Bilokon <paul@thalesians.com>
# Version: 1.1 (2019.01.24)
# Previous versions: 1.0 (2018.08.31)
# Email: paul@thalesians.com
# Platform: Tested on Windows 10 wit... |
lknelson/DH-Institute-2017 | 01-Intro to NLP/Intro to NLP.ipynb | bsd-2-clause | print("For me it has to do with the work that gets done at the crossroads of digital media and traditional humanistic study. And that happens in two different ways. On the one hand, it's bringing the tools and techniques of digital media to bear on traditional humanistic questions; on the other, it's also bringing huma... |
Trevortds/Etymachine | Prototyping semi-supervised.ipynb | gpl-2.0 | import tsvopener
import pandas as pd
import numpy as np
from nltk import word_tokenize
from sklearn.feature_extraction.text import CountVectorizer
from scipy.sparse import csr_matrix, vstack
from sklearn.semi_supervised import LabelPropagation, LabelSpreading
regex_categorized = tsvopener.open_tsv("categorized.tsv"... |
DAInamite/programming-humanoid-robot-in-python | joint_control/scikit-learn-intro.ipynb | gpl-2.0 | from sklearn import datasets
digits = datasets.load_digits()
%pylab inline
digits.data
digits.data.shape # n_samples, n_features
"""
Explanation: Introduction to scikit-learn
Classification of Handwritten Digits the task is to predict, given an image, which digit it represents. We are given samples of each of the ... |
GoogleCloudPlatform/healthcare | imaging/ml/ml_codelab/breast_density_auto_ml.ipynb | apache-2.0 | %%bash
pip3 install git+https://github.com/GoogleCloudPlatform/healthcare.git#subdirectory=imaging/ml/toolkit
pip3 install dicomweb-client
pip3 install pydicom
"""
Explanation: Copyright 2018 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi... |
GoogleCloudPlatform/data-science-on-gcp | 07_sparkml/logistic_regression.ipynb | apache-2.0 | BUCKET='ai-analytics-solutions-dsongcp' # CHANGE ME
import os
os.environ['BUCKET'] = BUCKET
# Create spark session
from pyspark.sql import SparkSession
from pyspark import SparkContext
sc = SparkContext('local', 'logistic')
spark = SparkSession \
.builder \
.appName("Logistic regression w/ Spark ML") \
... |
kristianfoerster/melodist | examples/precip5min_example.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import melodist
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: MELODIST 5min precipitation example
In this notebook the usage of MELODIST for working with highly resolved precipitation utilizing the cascade model is demonstrated.
For this purpose, we use a ... |
usantamaria/iwi131 | ipynb/21-EjerciciosDeCertamen/Certamen2_2014_1S_CC.ipynb | cc0-1.0 | r,s = (2014,3,12),(2014,1,1)
t = (2014,2,1)
print r > s and s < t
# DIGRESION: COMPARACION DE TUPLAS DEL MISMO LARGO
# Se verifican elementos en orden.
# El primer elemento que sea mayor, gana.
t1 = (0,1,2,3,4)
t2 = (10,0,0,0)
print t1<t2
# DIGRESION: COMPARACION DE TUPLAS DE DISTINTO LARGO
# Se verifican elementos e... |
sf-wind/caffe2 | caffe2/python/tutorials/Toy_Regression.ipynb | apache-2.0 | from caffe2.python import core, cnn, net_drawer, workspace, visualize
import numpy as np
from IPython import display
from matplotlib import pyplot
"""
Explanation: Tutorial 2. A Simple Toy Regression
This is a quick example showing how one can use the concepts introduced in Tutorial 1 (Basics) to do a quick toy regres... |
MStefko/STEADIER-SAILOR | src/test/resources/GibsonLanniAlgorithm.ipynb | gpl-3.0 | import sys
%pylab inline
import scipy.special
from scipy.interpolate import interp1d
from scipy.interpolate import RectBivariateSpline
print('Python {}\n'.format(sys.version))
print('NumPy\t\t{}'.format(np.__version__))
print('matplotlib\t{}'.format(matplotlib.__version__))
print('SciPy\t\t{}'.format(scipy.__version__... |
jamesfolberth/NGC_STEM_camp_AWS | notebooks/data8_notebooks/lab06/lab06.ipynb | bsd-3-clause | # Run this cell to set up the notebook, but please don't change it.
# These lines import the Numpy and Datascience modules.
import numpy as np
from datascience import *
# These lines do some fancy plotting magic.
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
imp... |
o108minmin/blogcodes | 2016-01-31/fracintervaledit.ipynb | mit | import pint as pn
from pint import roundfloat as rf
from pint import roundmode as rdm
import fractions
def frac_interval_proto(a):
aH, aL = rf.split(a)
if aL ==0:
answer = pn.interval(a)
else:
aS = rf.succ(a)
aP = rf.pred(a)
aS_c, aS_p = aS.as_integer_ratio()
aP_c, a... |
BioNinja/gseapy | docs/gseapy_example.ipynb | mit | # %matplotlib inline
# %config InlineBackend.figure_format='retina' # mac
# %load_ext autoreload
# %autoreload 2
import pandas as pd
import gseapy as gp
import matplotlib.pyplot as plt
"""
Explanation: GSEAPY Example
Examples to use GSEApy inside python console
End of explanation
"""
gp.__version__
"""
Explanation:... |
FRBs/FRB | docs/nb/FRB_Host_Associations.ipynb | bsd-3-clause | # imports
import numpy as np
from astropy.coordinates import SkyCoord
from astropy import units
from frb.frb import FRB
from frb.galaxies import hosts as frb_hosts
"""
Explanation: FRB Host Associations
- v1 (fussing around)
- v2 Bayesan ala Budavari
End of explanation
"""
frb190611 = FRB.by_name('FRB190611')
frb1... |
jinntrance/MOOC | coursera/ml-regression/assignments/week-1-simple-regression-assignment-blank.ipynb | cc0-1.0 | import graphlab
"""
Explanation: Regression Week 1: Simple Linear Regression
In this notebook we will use data on house sales in King County to predict house prices using simple (one input) linear regression. You will:
* Use graphlab SArray and SFrame functions to compute important summary statistics
* Write a functio... |
junhwanjang/DataSchool | Lecture/15. 과최적화와 정규화/3) 정규화 선형 회귀.ipynb | mit | np.random.seed(0)
n_samples = 30
X = np.sort(np.random.rand(n_samples))
y = np.cos(1.5 * np.pi * X) + np.random.randn(n_samples) * 0.1
dfX = pd.DataFrame(X, columns=["x"])
dfX = sm.add_constant(dfX)
dfy = pd.DataFrame(y, columns=["y"])
df = pd.concat([dfX, dfy], axis=1)
model = sm.OLS.from_formula("y ~ x + I(x**2) + ... |
BuzzFeedNews/2015-07-h2-visas-and-enforcement | notebooks/h2-employers-investigated.ipynb | mit | import pandas as pd
import sys
import re
sys.path.append("../utils")
import loaders
"""
Explanation: H-2 Employers Investigated Per Fiscal Year
The Python code below calculates the number of WHD cases concluded each fiscal year that examined some aspect of H-2 regulations, and the number of distinct employer IDs assoc... |
pegasus-isi/pegasus | tutorial/docker/notebooks/02-Debugging/02-Debugging.ipynb | apache-2.0 | !rm -f f.a
"""
Explanation: Workflow Debugging
When running complex computations (such as workflows) on complex computing infrastructure (for example HPC clusters), things will go wrong. It is therefore important to understand how to detect and debug issues as they appear. The good news is that Pegasus is doing a good... |
rashikaranpuria/Machine-Learning-Specialization | Regression/Assignment_four/.ipynb_checkpoints/week-4-ridge-regression-assignment-1-blank-checkpoint.ipynb | mit | import graphlab
graphlab.product_key.set_product_key("C0C2-04B4-D94B-70F6-8771-86F9-C6E1-E122")
"""
Explanation: Regression Week 4: Ridge Regression (interpretation)
In this notebook, we will run ridge regression multiple times with different L2 penalties to see which one produces the best fit. We will revisit the exa... |
Chipe1/aima-python | knowledge_current_best.ipynb | mit | from knowledge import *
from notebook import pseudocode, 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
"""
pseudocode(... |
CSchoel/learn-wavelets | wavelet-denoising.ipynb | mit | %matplotlib inline
# we will use numpy and matplotlib for all the following examples
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pywt
def doppler(freqs, dt, amp_inc=10, t0=0, f0=np.pi*2):
t = np.arange(len(freqs)) * dt + t0
amp = np.linspace(1, np.sqrt(amp_inc), len(freqs))**2
... |
judithyueli/pyFKF | .ipynb_checkpoints/FristExample-checkpoint.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
from CO2simulation import CO2simulation
import matplotlib.pyplot as plt
import numpy as np
import visualizeCO2 as vco2
"""
Explanation: Fast Kalman Filter for Temporal-spatial Data Analysis
End of explanation
"""
CO2 = CO2simulation('low')
data = []
x = []
for i ... |
rahulbakshee/TensorFlow-Basics | 01_tf_basics.ipynb | mit | # import
import tensorflow as tf
"""
Explanation: 01 TensorFlow Basics
End of explanation
"""
#add a constant to the graph
hello = tf.constant("TensorFlow Playground")
#create tf session
sess = tf.Session()
#run the session
print(sess.run(hello))
#tf.constant
a = tf.constant(3.0, tf.float32) #to specify a constan... |
tensorflow/docs-l10n | site/zh-cn/hub/tutorials/bigbigan_with_tf_hub.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
kiote/review-spam-prediction | prediction-model-builder.ipynb | mit | from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(analyzer = "word", \
tokenizer = None, \
preprocessor = None, \
stop_words = None, \
max_features = 5000)
... |
CitrineInformatics/lolo | python/examples/profile/scaling-test.ipynb | apache-2.0 | %matplotlib inline
from matplotlib import pyplot as plt
from tqdm import tqdm_notebook as tqdm
from matminer.datasets.dataset_retrieval import load_dataset
from matminer.featurizers.composition import ElementProperty
from lolopy.learners import RandomForestRegressor
from lolopy.loloserver import find_lolo_jar
from skle... |
boya-zhou/kaggle_bimbo_reformat | notebooks/1_predata_whole.ipynb | mit | agencia_for_cliente_producto = train_dataset[['Cliente_ID','Producto_ID'
,'Agencia_ID']].groupby(['Cliente_ID',
'Producto_ID']).agg(lambda x:x.value_counts().index[0]).reset_index()
canal_for_cliente_pr... |
martibayoalemany/Algorithms | stats/Java sorting.ipynb | mit | # Using strip to filter the values in the txt
import pandas as pd
import numpy as np
def read_stats(data_file):
data = pd.read_csv(data_file, sep="|")
data.columns = [ x.strip() for x in data.columns]
# Filter integer indexes
str_idxs = [idx for idx,dtype in zip(range(0,len(data.dtypes)), data.dtypes) ... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-cc/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-cc', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-CC
Topic: Land
Sub-Topics: ... |
metpy/MetPy | v0.11/_downloads/8c91fa5ab51e12860cfa1e679eaa746d/xarray_tutorial.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import xarray as xr
# Any import of metpy will activate the accessors
import metpy.calc as mpcalc
from metpy.testing import get_test_data
from metpy.units import units
"""
Explanation: xarray with MetPy Tutorial
xarray <h... |
conversationai/conversationai-models | attention-tutorial/Attention_Model_Tutorial.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
import tensorflow as tf
import numpy as np
import time
import os
from sklearn import metrics
from visualize_attention import attentionDisplay
from proces... |
GoogleCloudPlatform/mlops-on-gcp | skew_detection/02_covertype_logs_parsing.ipynb | apache-2.0 | !pip install -U -q google-api-python-client
!pip install -U -q pandas
"""
Explanation: Parsing and querying AI Platform Prediction request-response logs in BigQuery
This tutorial shows you how to create a view to parse raw request instances and response predictions logged from AI Platform Prediction to BigQuery.
The ... |
google/telluride_decoding | Telluride_Decoding_Toolbox_TF2_Demo.ipynb | apache-2.0 | #@title Default title text
# 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, softwar... |
probml/pyprobml | notebooks/book2/04/gibbs_demo_potts_jax.ipynb | mit | import jax
import jax.numpy as jnp
from jax import lax
from jax import vmap
from jax import random
from jax import jit
import numpy as np
import matplotlib.pyplot as plt
try:
from tqdm import trange
except ModuleNotFoundError:
%pip install -qq tqdm
from tqdm import trange
"""
Explanation: Gibbs sampling f... |
mnschmit/LMU-Syntax-nat-rlicher-Sprachen | 07-notebook-solution.ipynb | apache-2.0 | grammar = """
S -> NP VP
NP -> DET[GEN=?x] NOM[GEN=?x]
NOM[GEN=?x] -> ADJ NOM[GEN=?x] | N[GEN=?x]
ADJ -> "schöne" | "kluge" | "dicke"
DET[GEN=mask,KAS=nom] -> "der"
DET[GEN=fem,KAS=dat] -> "der"
DET[GEN=fem,KAS=nom] -> "die"
DET[GEN=fem,KAS=akk] -> "die"
DET[GEN=neut,KAS=nom] -> "das"
DET[GEN=neut,KAS=akk] -> "das... |
brainiak/brainiak | examples/reconstruct/iem_example_synthetic_RF_data.ipynb | apache-2.0 | # Set up parameters
n_channels = 6
cos_exponent = 5
range_start = 0
range_stop = 360
feature_resolution = 360
iem_obj = IEM.InvertedEncoding1D(n_channels, cos_exponent, stimulus_mode='circular', range_start=range_start,
range_stop=range_stop, channel_density=feature_resolution)
# You c... |
flowersteam/naminggamesal | notebooks/1_Intro_Vocabulary.ipynb | agpl-3.0 | from naminggamesal import ngvoc
"""
Explanation: Introducing the objects
Here we will introduce the different objects involved in the Naming Games models we are using. You can go directly to subsections and execute the code from there, they are independant.
Vocabulary
First object is the vocabulary. It represents a l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.