repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
mne-tools/mne-tools.github.io | 0.24/_downloads/e23ed246a9a354f899dfb3ce3b06e194/10_overview.ipynb | bsd-3-clause | import os
import numpy as np
import mne
"""
Explanation: Overview of MEG/EEG analysis with MNE-Python
This tutorial covers the basic EEG/MEG pipeline for event-related analysis:
loading data, epoching, averaging, plotting, and estimating cortical activity
from sensor data. It introduces the core MNE-Python data struct... |
ddebrunner/streamsx.dsx.notebooks | HelloWorld.ipynb | apache-2.0 | from streamsx.topology.topology import Topology
from streamsx.topology.context import *
topo = Topology("hello_dsx")
hw = topo.source(["Hello", "DSX!!"])
hw.print()
"""
Explanation: Hello World with Streaming Analytics service
Create a Hello World streaming application that simply prints Hello and DSX! to the PE cons... |
SATHVIKRAJU/Inferential_Statistics | Racial_disc.ipynb | mit | import pandas as pd
import numpy as np
from scipy import stats
data = pd.io.stata.read_stata('data/us_job_market_discrimination.dta')
# number of callbacks for black-sounding names
df_race_b=(data[data.race=='b'])
no_calls_b=sum(df_race_b.call)
#data['race'].count()
#data['call'].count()
df_race_w=(data[data.race=='w... |
ceos-seo/data_cube_notebooks | notebooks/UN_SDG/UN_SDG_11_3_1.ipynb | apache-2.0 | def sdg_11_3_1(land_consumption, population_growth_rate):
return land_consumption/population_growth_rate
"""
Explanation: <a id="top"></a>
UN SDG Indicator 11.3.1:<br> Ratio of Land Consumption Rate to Population Growth Rate
<hr>
Notebook Summary
The United Nations have prescribed 17 "Sustainable Development Goa... |
bhargavvader/pycobra | docs/notebooks/regression.ipynb | mit | from pycobra.cobra import Cobra
from pycobra.diagnostics import Diagnostics
import numpy as np
%matplotlib inline
"""
Explanation: Playing with Regression
This notebook will help us with testing different regression techniques, and demonstrate the diagnostic class which can be used to find the optimal parameters for C... |
geoffbacon/semrep | semrep/evaluate/qvec/qvec.ipynb | mit | import os
import csv
import pandas as pd
import numpy as np
from scipy import stats
data_path = '../../data'
tmp_path = '../../tmp'
feature_path = os.path.join(data_path, 'evaluation/semcor/tsvetkov_semcor.csv')
subset = pd.read_csv(feature_path, index_col=0)
subset.columns = [c.replace('semcor.', '') for c in subset... |
nslatysheva/data_science_blogging | model_optimization/model_optimization.ipynb | gpl-3.0 | import wget
import pandas as pd
# Import the dataset
data_url = 'https://raw.githubusercontent.com/nslatysheva/data_science_blogging/master/datasets/spam/spam_dataset.csv'
dataset = wget.download(data_url)
dataset = pd.read_csv(dataset, sep=",")
# Take a peak at the data
dataset.head()
"""
Explanation: How to tune m... |
molpopgen/fwdpy | docs/examples/FixationTimes1.ipynb | gpl-3.0 | %load_ext rpy2.ipython
import fwdpy as fp
import numpy as np
import pandas as pd
"""
Explanation: Distribution of fixation times with background selection
This example mixes the simulation of positive selection with strongly-deleterious mutations (background selection, or "BGS" for short).
The setup of the BGS model ... |
bakanchevn/DBCourseMirea2017 | Неделя 1/Задание в классе/Лабораторная 2-1.ipynb | gpl-3.0 | %sql select * from product;
"""
Explanation: Лабораторная 2-1:
Простые табличные запросы
Задание #1
Попробуйте записать запрос, чтобы получить на выходе все продукты, с "Touch" в имени. Укажите их имя и цену и отсортируйте в алфавитном порядке по производителю
End of explanation
"""
%%sql
PRAGMA case_sensitive_like=... |
hktxt/MachineLearning | Kmeans.ipynb | gpl-3.0 | #produce data set near the center
import numpy as np
import matplotlib.pyplot as plt
real_center = [(1,1),(1,2),(2,2),(2,1)]
point_number = 50
points_x = []
points_y = []
for center in real_center:
offset_x, offset_y = np.random.randn(point_number) * 0.3, np.random.randn(point_number) * 0.25
x_val, y_val = c... |
DistrictDataLabs/yellowbrick | examples/gokriznastic/Iris - clustering example.ipynb | apache-2.0 | # Load iris flower dataset
iris = datasets.load_iris()
X = iris.data #clustering is unsupervised learning hence we load only X(i.e.iris.data) and not Y(i.e. iris.target)
"""
Explanation: Yellowbrick — Clustering Evaluation Examples
The Yellowbrick library is a diagnostic visualization platform for machine learn... |
NGSchool2016/ngschool2016-materials | jupyter/ndolgikh/.ipynb_checkpoints/NGSchool_python-checkpoint.ipynb | gpl-3.0 | %pylab inline
"""
Explanation: Set the matplotlib magic to notebook enable inline plots
End of explanation
"""
import subprocess
import matplotlib.pyplot as plt
import random
import numpy as np
"""
Explanation: Calculate the Nonredundant Read Fraction (NRF)
SAM format example:
SRR585264.8766235 0 1 ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/112f45fdd43e503d5a44dfeb8227317e/plot_read_proj.ipynb | bsd-3-clause | # Author: Joan Massich <mailsik@gmail.com>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne import read_proj
from mne.io import read_raw_fif
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
fname = data_path + '/MEG... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/ols.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
np.random.seed(9876789)
"""
Explanation: Ordinary Least Squares
End of explanation
"""
nsample = 100
x = np.linspace(0, 10, 100)
X = np.column_stack((x, x ** 2))
beta = np.array([1, 0.1, 10])
e = ... |
srippa/nn_deep | tf/tf_hellow.ipynb | mit | import tensorflow as tf
#----------------------------------------------------------
# Basic graph structure and operations
# tf.add , tf.sub, tf.mul , tf.div , tf.mod , tf.poe
# tf.less , tf.greater , tf.less_equal , tf.greater_equal
# tf.logical_and , tf.logical_or , logical.xor
#----------------------------------... |
adriantorrie/adriantorrie.github.io_src | content/downloads/notebooks/udacity/deep_learning_foundations_nanodegree/project_2_notes_convolutional_neural_networks.ipynb | mit | %run ../../../code/version_check.py
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Summary" data-toc-modified-id="Summary-1"><span class="toc-item-num">1 </span>Summary</a></div><div class="lev1 toc-item"><a href="#Version-Control" data-toc-modified-id="Version-Control-2"><span c... |
ecervera/mindstorms-nb | task/index.ipynb | mit | from functions import connect
connect() # Executeu, polsant Majúscules + Enter
"""
Explanation: Prova de connexió
Assegureu-vos de que el controlador del robot està en marxa, i proveu el següent codi, fent clic amb el ratolí, i polsant simultàniament les tecles Majúscules i Enter.
End of explanation
"""
from functi... |
christophebertrand/ada-epfl | HW01-Intro_to_Pandas/intro-to-pandas-last-exo.ipynb | mit | # load all data and parse the 'date' column
def load_data():
sl_files=glob.glob('Data/ebola/sl_data/*.csv')
guinea_files=glob.glob('Data/ebola/guinea_data/*.csv')
liberia_files=glob.glob('Data/ebola/liberia_data/*.csv')
sl = pd.concat((pd.read_csv(file, parse_dates=['date']) for file in sl_files), igno... |
planetlabs/notebooks | jupyter-notebooks/analytics-snippets/building_footprints_as_vector.ipynb | apache-2.0 | import os
from pprint import pprint
import fiona
import matplotlib.pyplot as plt
from planet import api
from planet.api.utils import write_to_file
import rasterio
from rasterio import features as rfeatures
from rasterio.enums import Resampling
from rasterio.plot import show
import shapely
from shapely.geometry import ... |
streety/biof509 | Wk10-Paradigms.ipynb | mit | primes = []
i = 2
while len(primes) < 25:
for p in primes:
if i % p == 0:
break
else:
primes.append(i)
i += 1
print(primes)
"""
Explanation: Week 10 - Programming Paradigms
Learning Objectives
List popular programming paradigms
Demonstrate object oriented programming
Compare p... |
mikekestemont/lot2016 | Chapter 3 - Conditions.ipynb | mit | print(2 < 5)
print(2 <= 5)
print(3 > 7)
print(3 >= 7)
print(3 == 3)
print("school" == "school")
print("Python" != "perl")
"""
Explanation: Chapter 3: Conditions
Simple conditions
A lot of programming has to do with executing code if a particular condition holds. Here we give a brief overview of how you can express ce... |
infilect/ml-course1 | keras-notebooks/ANN/4.4-overfitting-and-underfitting.ipynb | mit | from keras.datasets import imdb
import numpy as np
(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)
def vectorize_sequences(sequences, dimension=10000):
# Create an all-zero matrix of shape (len(sequences), dimension)
results = np.zeros((len(sequences), dimension))
fo... |
slundberg/shap | notebooks/api_examples/explainers/GPUTree.ipynb | mit | import shap
import xgboost
# get a dataset on income prediction
X,y = shap.datasets.adult()
# train an XGBoost model (but any other model type would also work)
model = xgboost.XGBClassifier()
model.fit(X, y)
"""
Explanation: GPUTree explainer
This notebooks demonstrates how to use the GPUTree explainer on some simpl... |
phoebe-project/phoebe2-docs | development/tutorials/multiprocessing.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
import phoebe
"""
Explanation: Advanced: Running PHOEBE with Multiprocessing
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
print(phoebe.multiproce... |
chagaz/SamSpecCoEN | Significant subnetworks.ipynb | mit | print aces_gene_names[:10]
alist = list(aces_gene_names[:10])
gn1 = 'Entrez_5982'
gn2 = 'Entrez_76'
print alist.index(gn1)
print alist.index(gn2)
aces_gene_names = list(aces_gene_names)
edges_set = set([]) # (gene_idx_1, gene_idx_2)
# gene_idx_1 < gene_idx_2
# idx in aces_gene_names, starting at 0
with open('ACES/exp... |
Kaggle/learntools | notebooks/geospatial/raw/tut4.ipynb | apache-2.0 | #$HIDE$
import pandas as pd
import geopandas as gpd
import numpy as np
import folium
from folium import Marker
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Introduction
In this tutorial, you'll learn about two common manipulations for geospatial data: geocoding and table joins.
End of explanatio... |
ES-DOC/esdoc-jupyterhub | notebooks/ncar/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncar', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NCAR
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties:... |
ppyht2/tf-exercise | 014. RNN for Sin2/main.ipynb | gpl-3.0 | # 0. Import all the libararies and packages we will need
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.contrib import rnn
% matplotlib inline
"""
Explanation: Understanding Recurrent Neural Network Through Sine Waves
End of explanation
"""
def generate_sin(batch_size=10... |
shear/rppy | notebooks/QSI Sample Workflow.ipynb | bsd-2-clause | %matplotlib inline
from rppy import las
import rppy
from matplotlib import pyplot as plt
import numpy as np
from matplotlib.ticker import AutoMinorLocator
well2 = las.LASReader("data/well_2.las", null_subs=np.nan)
"""
Explanation: Quantitative Seismic Interpretation
This notebook provides a step-by-step walkthrough o... |
skkandrach/foundations-homework | data-databases/Twitter_API.ipynb | mit | api_key = ""
api_secret = ""
access_token = ""
token_secret = ""
"""
Explanation: The Twitter API
This tutorial presents an overview of how to use the Python programming language to interact with the Twitter API, both for acquiring data and for posting it. We're using the Twitter API because it's useful in its own rig... |
brettavedisian/phys202-2015-work | assignments/assignment04/MatplotlibEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 1
Imports
End of explanation
"""
import os
assert os.path.isfile('yearssn.dat')
"""
Explanation: Line plot of sunspot data
Download the .txt data for the "Yearly mean total sunspot number [1700 - now]" from th... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/arduino_analog.ipynb | bsd-3-clause | # Make sure the base overlay is loaded
from pynq import Overlay
Overlay("base.bit").download()
"""
Explanation: Arduino Analog Example
This example shows how to read out analog values on Arduino analog pins. Users can either wire the test pins, or use the PYNQ shield.
For this notebook, a PYNQ Arduino shield is used.... |
CrowdTruth/CrowdTruth-core | tutorial/notebooks/.ipynb_checkpoints/Dimensionality Reduction - Stopword Removal from Media Unit & Annotation-checkpoint.ipynb | apache-2.0 | import pandas as pd
test_data = pd.read_csv("data/person-video-highlight.csv")
test_data["taggedinsubtitles"][0:30]
"""
Explanation: Stopword Removal from Media Unit & Annotation
In this tutorial, we will show how dimensionality reduction can be applied over both the media units and the annotations of a crowdsourcing... |
AllenDowney/DataScienceBestPractices | hypothesis.ipynb | mit | from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
from IPython.html.widgets import interact, fixed
from IPython.html import widgets
import first
# seed the random number generator so we all get the same results
numpy.random.seed(19)
# some nicer col... |
kubeflow/kfp-tekton-backend | samples/contrib/local_development_quickstart/Local Development Quickstart.ipynb | apache-2.0 | # PROJECT_ID is used to construct the docker image registry. We will use Google Container Registry,
# but any other accessible registry works as well.
PROJECT_ID='Your-Gcp-Project-Id'
# Install Pipeline SDK
!pip3 install kfp --upgrade
!mkdir -p tmp/pipelines
"""
Explanation: KubeFlow Pipeline local development quic... |
kit-cel/wt | nt2_ce2/vorlesung/ch_1_basics/pulse_shaping.ipynb | gpl-2.0 | # importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 20}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(18, 10) )
"""
Explanation: Content and Objectives
Show pulse s... |
mpurg/qtools | docs/examples/q2gmx/q2gmx.ipynb | mit | from __future__ import print_function, division, absolute_import
import time
from Qpyl.core.qparameter import QPrm
from Qpyl.core.qlibrary import QLib
from Qpyl.core.qstructure import QStruct
from Qpyl.core.qtopology import QTopology
from Qpyl.common import init_logger
# load the logger
logger = init_logger('Qpyl')
""... |
srnas/barnaba | examples/example_01_ermsd.ipynb | gpl-3.0 | # import barnaba
import barnaba as bb
# define trajectory and topology files
native="uucg2.pdb"
traj = "../test/data/UUCG.xtc"
top = "../test/data/UUCG.pdb"
# calculate eRMSD between native and all frames in trajectory
ermsd = bb.ermsd(native,traj,topology=top)
"""
Explanation: RMSD/eRMSD calculation
We here show h... |
tensorflow/docs-l10n | site/ja/tutorials/keras/regression.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... |
mediagit2016/workcamp-maschinelles-lernen-grundlagen | wc-arbeiten-tf-20-aufgabe.ipynb | gpl-3.0 | #importieren sie die Bibliothek pandas
#importieren sie matplotlib.pyplot as plt
#laden Sie die Datei "sensordaten.csv" auf Ihren Hub
#laden Sie die Datei "sensordaten.csv" in einen Datframe df
#Einlesen der Dateien mit header=None
#Betrachten Sie die ersten Daten des Dataframes df
#Erzeugen Sie eine statistisch... |
deepmind/deepmind-research | rl_unplugged/rwrl_d4pg.ipynb | apache-2.0 | !pip install dm-acme
!pip install dm-acme[reverb]
!pip install dm-acme[tf]
!pip install dm-sonnet
"""
Explanation: Copyright 2020 DeepMind Technologies Limited.
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
... |
willvousden/emcee | docs/_static/notebooks/parallel.ipynb | mit | import emcee
print(emcee.__version__)
"""
Explanation: Parallelization
With emcee, it's easy to make use of multiple CPUs to speed up slow sampling.
There will always be some computational overhead introduced by parallelization so it will only be beneficial in the case where the model is expensive, but this is often t... |
gabicfa/RedesSociais | encontro03/.ipynb_checkpoints/show-graph-checkpoint.ipynb | gpl-3.0 | import sys
sys.path.append('..')
import socnet as sn
"""
Explanation: Encontro 03: Grafos Reais
Importando a biblioteca:
End of explanation
"""
sn.node_size = 3
sn.node_color = (0, 0, 0)
sn.edge_width = 1
sn.edge_color = (192, 192, 192)
sn.node_label_position = 'top center'
g = sn.load_graph('tarefa1.gml')
sn.sho... |
GoogleCloudPlatform/tf-estimator-tutorials | 05_Autoencoding/03.0 - Dimensionality Reduction - Autoencoding + Normalizer + XEntropy Loss.ipynb | apache-2.0 | MODEL_NAME = 'auto-encoder-01'
TRAIN_DATA_FILES_PATTERN = 'data/data-*.csv'
RESUME_TRAINING = False
MULTI_THREADING = True
"""
Explanation: TF Custom Estimator to Build a NN Autoencoder for Feature Extraction
End of explanation
"""
FEATURE_COUNT = 64
HEADER = ['key']
HEADER_DEFAULTS = [[0]]
UNUSED_FEATURE_NAMES ... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session09/Day4/Matched_filter_tutorial.ipynb | mit | # ! pip install lalsuite pycbc
"""
Explanation: Welcome to the matched filtering tutorial!
Installation
Make sure you have PyCBC and some basic lalsuite tools installed.
Only execute the below cell if you have not already installed pycbc
Note –– if you were not able to install pycbc, or you got errors preventing your ... |
dragoon/kilogram | notebooks/entity_linking_for_types.ipynb | apache-2.0 | import matplotlib.pyplot as plt
from mpltools import style
import numpy as np
style.use('ggplot')
%matplotlib inline
import pandas as pd
import shelve
from collections import defaultdict
"""
Explanation: <small><i>This notebook was put together by Roman Prokofyev@eXascale Infolab. Source and license info is on GitHub.... |
JaviMerino/lisa | ipynb/thermal/ThermalSensorCharacterisation.ipynb | apache-2.0 | import logging
reload(logging)
log_fmt = '%(asctime)-9s %(levelname)-8s: %(message)s'
logging.basicConfig(format=log_fmt)
# Change to info once the notebook runs ok
logging.getLogger().setLevel(logging.INFO)
%pylab inline
import os
# Support to access the remote target
import devlib
from env import TestEnv
# Suppo... |
hashiprobr/redes-sociais | encontro07/hub-authority.ipynb | gpl-3.0 | import sys
sys.path.append('..')
import numpy as np
import socnet as sn
"""
Explanation: Encontro 07: Simulação e Demonstração de Hub/Authority
Importando as bibliotecas:
End of explanation
"""
sn.graph_width = 225
sn.graph_height = 225
"""
Explanation: Configurando a biblioteca:
End of explanation
"""
g = sn.lo... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/building_production_ml_systems/labs/4b_streaming_data_inference.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
import os
import googleapiclient.discovery
import shutil
from google.cloud import bigquery
from google.api_core.client_options import ClientOptions
from matplotlib import pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow import ... |
diegocavalca/Studies | programming/Python/tensorflow/exercises/Neural_Network_Part1.ipynb | cc0-1.0 | from __future__ import print_function
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
%matplotlib inline
from datetime import date
date.today()
author = "kyubyong. https://github.com/Kyubyong/tensorflow-exercises"
tf.__version__
np.__version__
"""
Explanation: Neural Network
End of expla... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/feature_engineering/solutions/1_bqml_basic_feat_eng.ipynb | apache-2.0 | PROJECT = !gcloud config get-value project
PROJECT = PROJECT[0]
%env PROJECT=$PROJECT
"""
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
Overview
In this lab, we utilize feature eng... |
deculler/MachineLearningTables | Chapter3-2.ipynb | bsd-2-clause | # HIDDEN
# For Tables reference see http://data8.org/datascience/tables.html
# This useful nonsense should just go at the top of your notebook.
from datascience import *
%matplotlib inline
import matplotlib.pyplot as plots
import numpy as np
from sklearn import linear_model
plots.style.use('fivethirtyeight')
plots.rc('... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/text_models/solutions/rnn_encoder_decoder.ipynb | apache-2.0 | pip install nltk
import os
import pickle
import sys
import nltk
import numpy as np
import pandas as pd
import tensorflow as tf
import utils_preproc
from sklearn.model_selection import train_test_split
from tensorflow.keras.layers import GRU, Dense, Embedding, Input
from tensorflow.keras.models import Model, load_mode... |
tpin3694/tpin3694.github.io | machine-learning/detecting_outliers.ipynb | mit | # Load libraries
import numpy as np
from sklearn.covariance import EllipticEnvelope
from sklearn.datasets import make_blobs
"""
Explanation: Title: Detecting Outliers
Slug: detecting_outliers
Summary: How to detect outliers for machine learning in Python.
Date: 2016-09-06 12:00
Category: Machine Learning
Tags: Pre... |
therealAJ/python-sandbox | data-science/learning/ud1/DataScience/TrainTest.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
from pylab import *
np.random.seed(2)
pageSpeeds = np.random.normal(3.0, 1.0, 100)
purchaseAmount = np.random.normal(50.0, 30.0, 100) / pageSpeeds
scatter(pageSpeeds, purchaseAmount)
"""
Explanation: Train / Test
We'll start by creating some data set that we want to build a mo... |
datamicroscopes/release | examples/enron-email.ipynb | bsd-3-clause | %matplotlib inline
import pickle
import time
import itertools as it
import numpy as np
import matplotlib.pylab as plt
import matplotlib.patches as patches
from multiprocessing import cpu_count
import seaborn as sns
sns.set_context('talk')
"""
Explanation: Clustering the Enron e-mail corpus using the Infinite Relationa... |
ktakagaki/kt-2015-DSPHandsOn | MedianFilter/Python/04. Summaries/Summary sine with more samples(1024).ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
import sys
#Add a new path with needed .py files
sys.path.insert(0, 'C:\Users\Dominik\Documents\GitRep\kt-2015-DSPHandsOn\MedianFilter\Python')
import functions
import gitInformation
gitInformation.printInformation()
% matplotlib inline
"""
Explanation: Test: Err... |
CCI-Tools/sandbox | notebooks/norman/xarray-ex-1.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import xarray as xr
"""
Explanation: Quick overview
Here are some quick examples of what you can do with xarray.DataArray objects. Everything is explained in much more detail in the rest of the documentation.
To begin, import numpy, pandas and xarray using their customary abbre... |
hypergravity/cham_hates_python | notebook/cham_hates_python_07_high_performance_computing.ipynb | mit | %pylab inline
# with plt.xkcd():
fig = plt.figure(figsize=(10, 10))
ax = plt.axes(frameon=False)
plt.xlim(-1.5,1.5)
plt.ylim(-1.5,1.5)
circle = plt.Circle((0.,0.), 1., color='w', fill=False)
rect = plt.Rectangle((-1,-1), 2, 2, color='gray')
plt.gca().add_artist(rect)
plt.gca().add_artist(circle)
plt.arrow(-2., 0., 3.3... |
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Transport, Emissi... |
ConnectedSystems/veneer-py | doc/training/7_Parallel_Processing_and_Veneer_Command_Line.ipynb | isc | from veneer.manage import create_command_line
help(create_command_line)
veneer_install = 'D:\\src\\projects\\Veneer\\Compiled\\Source 4.1.1.4484 (public version)'
source_version = '4.1.1'
cmd_directory = 'E:\\temp\\veneer_cmd'
veneer_cmd = create_command_line(veneer_install,source_version,dest=cmd_directory)
veneer_c... |
jbn/itikz | Quickstart.ipynb | mit | %load_ext itikz
"""
Explanation: Quick Start
Note: If you're viewing this notebook on nbviewer.jupyter.org some of the SVGs render improperly, even across cell output contexts. The bug is not in itikz.
Installation
Install TeX and pdf2svg
This is platform-dependent.
See:
Texlive
pdf2svg
Install itikz
sh
pip insta... |
nansencenter/nansat-lectures | notebooks/09 Nansat introduction.ipynb | gpl-3.0 | import os
import shutil
import nansat
idir = os.path.join(os.path.dirname(nansat.__file__), 'tests', 'data/')
"""
Explanation: Nansat: First Steps
Copy sample data
End of explanation
"""
import matplotlib.pyplot as plt
%matplotlib inline
from nansat import Nansat
n = Nansat(idir+'gcps.tif')
"""
Explanation: Open ... |
ANNarchy/ANNarchy | examples/tensorboard/BasalGanglia.ipynb | gpl-2.0 | from ANNarchy import *
from ANNarchy.extensions.tensorboard import Logger
import matplotlib.pyplot as plt
"""
Explanation: Logging with tensorboard
The tensorboard extension allows to log various information (scalars, images, etc) during training for visualization using tensorboard.
It has to be explicitly imported:
... |
mfinkle/user-data-analytics | fennec-events.ipynb | mit | update_channel = "nightly"
now = dt.datetime.now()
start = now - dt.timedelta(3)
end = now - dt.timedelta(1)
pings = get_pings(sc, app="Fennec", channel=update_channel,
submission_date=(start.strftime("%Y%m%d"), end.strftime("%Y%m%d")),
build_id=("20100101000000", "99999999999999"),... |
seifip/udacity-deep-learning-nanodegree | batch-norm/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Practice
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con... |
AllenDowney/ModSimPy | notebooks/hopper.ipynb | mit | # If you want the figures to appear in the notebook,
# and you want to interact with them, use
# %matplotlib notebook
# If you want the figures to appear in the notebook,
# and you don't want to interact with them, use
# %matplotlib inline
# If you want the figures to appear in separate windows, use
# %matplotlib q... |
isb-cgc/examples-Python | notebooks/UNC HiSeq mRNAseq gene expression.ipynb | apache-2.0 | import gcp.bigquery as bq
mRNAseq_BQtable = bq.Table('isb-cgc:tcga_201607_beta.mRNA_UNC_HiSeq_RSEM')
"""
Explanation: UNC HiSeq mRNAseq gene expression (RSEM)
The goal of this notebook is to introduce you to the mRNAseq gene expression BigQuery table.
This table contains all available TCGA Level-3 gene expression data... |
jan-rybizki/Chempy | tutorials/2-Nucleosynthetic_yields.ipynb | mit | %pylab inline
from Chempy.parameter import ModelParameters
from Chempy.yields import SN2_feedback, AGB_feedback, SN1a_feedback, Hypernova_feedback
from Chempy.infall import PRIMORDIAL_INFALL, INFALL
# This loads the default parameters, you can check and change them in paramter.py
a = ModelParameters()
# Implement... |
chrlttv/Teaching | Session2/Clustering.ipynb | mit | import pandas as pd
import numpy as np
df = pd.read_csv('NAm2.txt', sep=" ")
print(df.head())
print(df.shape)
# List of populations/tribes
tribes = df.Pop.unique()
country = df.Country.unique()
print(tribes)
print(country)
# The features that we need for clustering starts from the 9th one
# Subset of the dataframe ... |
hershaw/data-science-101 | course/class1/pca/iris/PCA - Iris dataset.ipynb | mit | from sklearn import datasets
from sklearn.decomposition import PCA
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
# %matplotlib inline
%matplotlib notebook
"""
Explanation: Principal Component Analysis with Iris Dataset
End of explanation
"""
iris = ... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/TODO/GAN/project-face-generation/dlnd_face_generation.ipynb | apache-2.0 | # can comment out after executing
!unzip processed_celeba_small.zip
data_dir = 'processed_celeba_small/'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
import problem_unittests as tests
#import helper
%matplotlib inline
"""
Explanation: Face Genera... |
opencobra/cobrapy | documentation_builder/building_model.ipynb | gpl-2.0 | from cobra import Model, Reaction, Metabolite
model = Model('example_model')
reaction = Reaction('R_3OAS140')
reaction.name = '3 oxoacyl acyl carrier protein synthase n C140 '
reaction.subsystem = 'Cell Envelope Biosynthesis'
reaction.lower_bound = 0. # This is the default
reaction.upper_bound = 1000. # This is the... |
crawles/automl_service | modelling_and_usage.ipynb | mit | %matplotlib inline
import json
import matplotlib.pylab as plt
import numpy as np
import pandas as pd
import pprint
import requests
import seaborn as sns
from sklearn.metrics import roc_auc_score
import tsfresh
from tsfresh.examples.har_dataset import download_har_dataset, load_har_dataset, load_har_classes
from tsfres... |
danielfather7/teach_Python | DSMCER_Hw/dsmcer-hw-3-statistics-danielfather7/HW3-Tai-Yu Pan.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
"""
Explanation: If a cell begins with DNC: do not change it and leave the markdown there so I can expect a basic level of organization that is common to all HW (will help me with grading). This also clearly delineates the sec... |
jhjungCode/pytorch-tutorial | 08_Flowers_retraining.ipynb | mit | !if [ ! -d "/tmp/flower_photos" ]; then curl http://download.tensorflow.org/example_images/flower_photos.tgz | tar xz -C /tmp ;rm /tmp/flower_photos/LICENSE.txt; fi
%matplotlib inline
"""
Explanation: Flowers retraining example
이미 학습된 잘 알려진 모델을 이용하여 꽃의 종류를 예측하는 예제입니다.
기존의 Minst 예제와는 거의 차이점이 없습니다. 단지 2가지만 다를 뿐입니다.
숫자... |
igabr/Metis_Projects_Chicago_2017 | 05-project-kojack/Notebook_1_DataFrame_Construction.ipynb | mit | import pandas as pd
import arrow # way better than datetime
import numpy as np
import random
import re
%run helper_functions.py
"""
Explanation: Notebook 1
This notebook contains code used to construct the dataframe that contains our raw data.
End of explanation
"""
df = pd.read_csv("tweets_formatted.txt", sep="| |"... |
linhbngo/cpsc-4770_6770 | 11-intro-to-hadoop-03.ipynb | gpl-3.0 | !hdfs dfs -rm -r intro-to-hadoop/output-movielens-02
!yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming.jar \
-input /repository/movielens/ratings.csv \
-output intro-to-hadoop/output-movielens-02 \
-file ./codes/avgRatingMapper04.py \
-mapper avgRatingMapper04.py \
-file ./codes/av... |
OpenWeavers/openanalysis | doc/OpenAnalysis/03 - Searching.ipynb | gpl-3.0 | x = list(range(10))
x
6 in x
100 in x
x.index(6)
x.index(100)
"""
Explanation: Searching Analysis
Consider a finite collection of element. Finding whether element exsists in collection is known as Searching. Following are some of the comparision based Searching Algorithms.
Linear Search
Binary Search
Before loo... |
ijingo/incubator-singa | doc/en/docs/notebook/model.ipynb | apache-2.0 | from singa import tensor, device, layer
#help(layer.Layer)
layer.engine='singacpp'
"""
Explanation: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.
SINGA Model Classes
<img src="http://singa.apache.org/en/_static/ima... |
y2ee201/Deep-Learning-Nanodegree | sentiment-analysis/Sentiment Analysis with TFLearn.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... |
nanodan/branca | examples/Elements.ipynb | mit | e = Element("This is fancy text")
"""
Explanation: Element
This is the base brick of branca. You can create an Element in providing a template string:
End of explanation
"""
print(e._name, e._id)
print(e.get_name())
"""
Explanation: Each element has an attribute _name and a unique _id. You also have a method get_na... |
bt3gl/Machine-Learning-Resources | deep_art/deepdream/examples/00-classification.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Make sure that caffe is on the python path:
caffe_root = '../' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
plt.rcParams['figure.figsize'] = (10, 10)
plt.rcParams['imag... |
dtamayo/reboundx | ipython_examples/GeneralRelativity.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1., hash="star") # Sun
sim.add(m=1.66013e-07,a=0.387098,e=0.205630, hash="planet") # Mercury-like
sim.move_to_com() # Moves to the center of momentum frame
ps = sim.particles
sim.integrate(10.)
print("pomega = %.16f"%sim.particles[1].pomega)
"""
Explanation: Adding ... |
tcfuji/python-cn-workflow | PresentableNotebook.ipynb | mit | from pandas import Series
from igraph import *
from numba import jit
import numpy as np
import os
import time
"""
Explanation: Motivation:
An application of the Louvain algorithm on fMRI time seres data.
Necessary Packages
End of explanation
"""
# Gather all the files.
files = os.listdir('timeseries/')
# Concatenat... |
HAOzj/Classic-ML-Methods-Algo | ipynbs/appendix/topics_in_sklearn/sklearn构建管道.ipynb | mit | import numpy as np
from sklearn.preprocessing import FunctionTransformer
transformer = FunctionTransformer(np.log1p)
X = np.array([[0, 1], [2, 3]])
transformer.transform(X)
"""
Explanation: sklearn构建管道
sklearn支持使用管道(Pipeline)连接多个sklearn中的模型类实例,但要求过程中的模型类对象带transform方法的且最后一个需要是分类器,回归器或者同样是带transform方法的模型类对象.
带transfor... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/int_logistic_regression.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... |
nohmapp/acme-for-now | essential_algorithms/Graphs and Trees.ipynb | mit | '''
Depth-First Search
Here is a depth-fist search for an undirected graph that may be
disconnected. It is writeen as an adjacency matrix.
'''
graph = {
'a': ['b'],
'b': ['']
}
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = Non... |
dawenl/cofactor | src/Cofactorization_ML20M.ipynb | apache-2.0 | import itertools
import glob
import os
import sys
os.environ['OPENBLAS_NUM_THREADS'] = '1'
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
from scipy import sparse
import seaborn as sns
sns.set(context="paper", font_scale=1.5, rc={"line... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/dev/.ipynb_checkpoints/n04B_evaluation_infrastructure-checkpoint.ipynb | mit | from predictor import evaluation as ev
from predictor.dummy_mean_predictor import DummyPredictor
predictor = DummyPredictor()
y_train_true_df, y_train_pred_df, y_val_true_df, y_val_pred_df = ev.run_single_val(x, y, ahead_days, predictor)
print(y_train_true_df.shape)
print(y_train_pred_df.shape)
print(y_val_true_df.s... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/05_review/4_preproc.ipynb | apache-2.0 | #Ensure that we have Apache Beam version installed.
!pip freeze | grep apache-beam || sudo pip install apache-beam[gcp]==2.12.0
import tensorflow as tf
import apache_beam as beam
import shutil
import os
print(tf.__version__)
"""
Explanation: Preprocessing Using Dataflow
Learning Objectives
- Creating datasets for Mac... |
plipp/informatica-pfr-2017 | nbs/3/2-Geo-Plotting-with-Cartopy-Exercise.ipynb | mit | birds = pd.read_csv('../../data/bird_tracking.csv')
birds.head()
"""
Explanation: Birds Migration Data
End of explanation
"""
# TODO
"""
Explanation: Exercise 1
The migration data of which birds (bird_names) are in the tracking dataset?
End of explanation
"""
# TODO
"""
Explanation: Exercise 2
Draw a basic plot... |
GeoNet/fits | examples/Notebook_4.ipynb | apache-2.0 | # Import packages
import cairosvg
import io
from PIL import Image
import matplotlib.pyplot as plt
"""
Explanation: Station location plotting using FITS (FIeld Time Series) database
In this notebook we will look at discovering the location of sites in the FITS (FIeld Time Series) database. However, as the Python packa... |
RuthAngus/granola | granola/inference_explore.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as pl
%matplotlib inline
import emcee
dw = pd.read_csv("data/dwarf.txt")
c = -3
a1, j1 = dw.age.values[:c], dw.jz.values[:c]
a2, j2 = dw.age.values[c-1:], dw.jz.values[c-1:]
x1, y1 = np.log(a1), np.log(j1)
x2, y2 = np.log(a2), np.log(j2)
xlabel, ylabel ... |
NEONInc/NEON-Data-Skills | code/Python/lidar/Calc_Biomass.ipynb | gpl-2.0 | import numpy as np
import os
import gdal, osr
import matplotlib.pyplot as plt
import sys
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
%matplotlib inline
"""
Explanation: Calculating Biomass
Background
In this lesson we will calculate the Biomass for a section of the SJER site. We will be using the... |
ccphillippi/train-a-smartcab | README.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
import pylab
%matplotlib inline
def expected_trials(total_states):
n_drawn = np.arange(1, total_states)
return pd.Series(
total_states * np.cumsum(1. / n_drawn[::-1]),
n_drawn
)
expected_trials(96).plot(
title='Expected numb... |
zomansud/coursera | ml-classification/week-2/module-3-linear-classifier-learning-assignment-blank.ipynb | mit | import graphlab
"""
Explanation: Implementing logistic regression from scratch
The goal of this notebook is to implement your own logistic regression classifier. You will:
Extract features from Amazon product reviews.
Convert an SFrame into a NumPy array.
Implement the link function for logistic regression.
Write a f... |
tensorflow/docs | site/en/tutorials/load_data/tfrecord.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... |
OriolAbril/Statistics-Rocks-MasterCosmosUAB | Statistics_block1.ipynb | mit | # sets the plots to be embedded in the notebook
%matplotlib inline
# Import useful python libraries
import numpy as np # library to work with arrays
import matplotlib.pyplot as plt # plotting library (all weird commands starting with plt., ax., fig. are matplotlib
# they are not impor... |
NEONScience/NEON-Data-Skills | tutorials/Python/Hyperspectral/hyperspectral-classification/Classification_PCA_py/Classification_PCA_py.ipynb | agpl-3.0 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy import linalg
from scipy import io
from mpl_toolkits.mplot3d import Axes3D
def PlotSpectraAndMean(Spectra, Wv, fignum):
### Spectra is NBands x NSamps
mu = np.mean(Spectra, axis=1)
print(np.shape(mu))
plt.figure(fignum)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.