repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
keras-team/keras-io | examples/vision/ipynb/mnist_convnet.ipynb | apache-2.0 | import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Simple MNIST convnet
Author: fchollet<br>
Date created: 2015/06/19<br>
Last modified: 2020/04/21<br>
Description: A simple convnet that achieves ~99% test accuracy on MNIST.
Setup
End of explanation
"""
# Model / dat... |
tensorflow/docs-l10n | site/ja/tfx/tutorials/tfx/components_keras.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... |
ganguli-lab/twpca | notebooks/warp_unit_tests.ipynb | mit | _, _, data = twpca.datasets.jittered_neuron()
model = TWPCA(data, n_components=1, warpinit='identity')
np.all(np.isclose(model.params['warp'], np.arange(model.shared_length), atol=1e-5, rtol=2))
np.nanmax(np.abs(model.transform() - data)) < 1e-5
"""
Explanation: check identity warp does not change data appreciably
E... |
oddt/notebooks | DUD-E.ipynb | bsd-3-clause | from __future__ import print_function, division, unicode_literals
import oddt
from oddt.datasets import dude
print(oddt.__version__)
"""
Explanation: <h1>DUD-E: A Database of Useful Decoys: Enhanced</h1>
End of explanation
"""
%%bash
mkdir -p ./DUD-E_targets/
wget -qO- http://dude.docking.org/targets/ampc/ampc.tar.... |
iAInNet/tensorflow_in_action | _pratice_cifar10.ipynb | gpl-3.0 | max_steps = 3000
batch_size = 128
data_dir = 'data/cifar10/cifar-10-batches-bin/'
model_dir = 'model/_cifar10_v2/'
"""
Explanation: 全局参数
End of explanation
"""
X_train, y_train = cifar10_input.distorted_inputs(data_dir, batch_size)
X_test, y_test = cifar10_input.inputs(eval_data=True, data_dir=data_dir, batch_size=... |
mitdbg/modeldb | demos/webinar-2020-5-6/02-mdb_versioned/01-train/01 Basic NLP.ipynb | mit | !python -m spacy download en_core_web_sm
"""
Explanation: Versioning Example (Part 1/3)
In this example, we'll train an NLP model for sentiment analysis of tweets using spaCy.
Through this series, we'll take advantage of ModelDB's versioning system to keep track of changes.
This workflow requires verta>=0.14.4 and ... |
cipri-tom/Swiss-on-Amazon | filter_swiss_helpful_reviews.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import yaml
"""
Explanation: The following script extracts the (more) helpful reviews from the swiss reviews and saves them locally.
From the extracted reviews it also saves a list with their asin identifiers.
The list of asin id... |
simonsfoundation/CaImAn | demos/notebooks/demo_Ring_CNN.ipynb | gpl-2.0 | get_ipython().magic('load_ext autoreload')
get_ipython().magic('autoreload 2')
import glob
import logging
import numpy as np
import os
logging.basicConfig(format=
"%(relativeCreated)12d [%(filename)s:%(funcName)20s():%(lineno)s] [%(process)d] %(message)s",
# filename="/tm... |
Kaggle/learntools | notebooks/deep_learning_intro/raw/tut3.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
from IPython.display import display
red_wine = pd.read_csv('../input/dl-course-data/red-wine.csv')
# Create training and validation splits
df_train = red_wine.sample(frac=0.7, random_state=0)
df_valid = red_wine.drop(df_train.index)
display(df_train.head(4))
# Scale to [0, 1]
max_ =... |
GoogleCloudPlatform/mlops-on-gcp | model_serving/caip-load-testing/03-analyze-results.ipynb | apache-2.0 | import time
from datetime import datetime
from typing import List
import numpy as np
import pandas as pd
import google.auth
from google.cloud import logging_v2
from google.cloud.monitoring_dashboard.v1 import DashboardsServiceClient
from google.cloud.logging_v2 import MetricsServiceV2Client
from google.cloud.monito... |
Neuroglycerin/neukrill-net-work | notebooks/augmentation/Preliminary Online Augmentation Results.ipynb | mit | import pylearn2.utils
import pylearn2.config
import theano
import neukrill_net.dense_dataset
import neukrill_net.utils
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import holoviews as hl
%load_ext holoviews.ipython
import sklearn.metrics
cd ..
settings = neukrill_net.utils.Settings("settings.... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/examples/tracebuffer_i2c.ipynb | bsd-3-clause | from pprint import pprint
from time import sleep
from pynq import PL
from pynq import Overlay
from pynq.drivers import Trace_Buffer
from pynq.iop import Pmod_TMP2
from pynq.iop import PMODA
from pynq.iop import PMODB
from pynq.iop import ARDUINO
ol = Overlay("base.bit")
ol.download()
pprint(PL.ip_dict)
"""
Explanatio... |
rnder/data-science-from-scratch | notebook/ch21_network_analysis.ipynb | unlicense | from __future__ import division
import math, random, re
from collections import defaultdict, Counter, deque
from linear_algebra import dot, get_row, get_column, make_matrix, magnitude, scalar_multiply, shape, distance
from functools import partial
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn... |
Open-Power-System-Data/renewable_power_plants | download_and_process.ipynb | mit | version = '2020-08-25'
"""
Explanation: <div style="width:100%; background-color: #D9EDF7; border: 1px solid #CFCFCF; text-align: left; padding: 10px;">
<b>Renewable power plants: Download and process notebook</b>
<ul>
<li><a href="main.ipynb">Main notebook</a></li>
<li>Download and process... |
dh7/ML-Tutorial-Notebooks | Fizz Buzz.ipynb | bsd-2-clause | import numpy as np
import tensorflow as tf
"""
Explanation: Fizz Buzz with Tensor Flow.
This notebook to explain the code from Fizz Buzz in Tensor Flow blog post written by Joel Grus
You should read his post first it is super funny!
His code try to play the Fizz Buzz game by using machine learning.
This notebook is... |
stsouko/CGRtools | doc/tutorial/2_signatures.ipynb | lgpl-3.0 | import pkg_resources
if pkg_resources.get_distribution('CGRtools').version.split('.')[:2] != ['4', '0']:
print('WARNING. Tutorial was tested on 4.0 version of CGRtools')
else:
print('Welcome!')
# load data for tutorial
from pickle import load
from traceback import format_exc
with open('molecules.dat', 'rb') a... |
vbsteja/code | Python/ML_DL/DL/Neural-Networks-Demystified-master/.ipynb_checkpoints/Part 4 Backpropagation-checkpoint.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('GlcnxUlrtek')
"""
Explanation: <h1 align = 'center'> Neural Networks Demystified </h1>
<h2 align = 'center'> Part 4: Backpropagation </h2>
<h4 align = 'center' > @stephencwelch </h4>
End of explanation
"""
%pylab inline
#Import code from last time
from partTwo ... |
shaivaldalal/CS6053_DataScience | HW3_sd3462.ipynb | mit | #Importing basic libraries
import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier #Decision Tree
import matplotlib.pyplot as plt # To plot graphs
from sklearn.metrics import accuracy_score # To test accuracy
from sklearn import tree
churn=pd.read_csv("../Datasets/Cell2Cell_data.csv")
#... |
bharat-b7/NN_glimpse | 2.2.1 CNN HandsOn - MNIST & FC Nets.ipynb | unlicense | import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"] = ""
#os.environ['THEANO_FLAGS'] = "device=gpu2"
from keras.models import load_model
from keras.models import Sequential
from keras.layers.core import Dense, Dropout
from keras.optimizers import SGD
nb_classe... |
lewisamarshall/ionize | interaction_constants.ipynb | gpl-2.0 | # imports
from ionize import Aqueous
from math import sqrt, pi
import pint
ur = pint.UnitRegistry()
Q = ur.Quantity
# define values
temperature = Q(25, 'degC')
e = ur.elementary_charge
kb = ur.boltzmann_constant
dielectric = Aqueous.dielectric(temperature.magnitude)
viscosity = Aqueous.viscosity(temperature.magnitude)... |
yttty/python3-scraper-tutorial | Python_Spider_Tutorial_01.ipynb | gpl-3.0 | #encoding:UTF-8
import urllib.request
url = "http://www.pku.edu.cn"
data = urllib.request.urlopen(url).read()
data = data.decode('UTF-8')
print(data)
"""
Explanation: 用Python 3开发网络爬虫
By Terrill Yang (Github: https://github.com/yttty)
由你需要这些:Python3.x爬虫学习资料整理 - 知乎专栏整理而来。
用Python 3开发网络爬虫 - Chapter 01
1. 一个简单的伪代码
以下这个简... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/automl/showcase_automl_image_classification_export_edge.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: AutoML image classification model for export to edge
<table align="l... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NCC
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection, ... |
davidparks21/qso_lya_detection_pipeline | lucid_work/notebooks/feature_visualization.ipynb | mit | # Imports
import numpy as np
import tensorflow as tf
import scipy.ndimage as nd
import time
import imageio
import matplotlib
import matplotlib.pyplot as plt
import lucid.modelzoo.vision_models as models
from lucid.misc.io import show
import lucid.optvis.objectives as objectives
import lucid.optvis.param as param
imp... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session13/Day3/RealWorldLombScargle.ipynb | mit | np.random.seed(185)
# calculate the periodogram
x = 10*np.random.rand(100)
y = gen_periodic_data(x, period=5.25, amplitude=7.4, noise=0.8)
y_unc = np.ones_like(x)*np.sqrt(0.8)
"""
Explanation: Real World Considerations for the Lomb-Scargle Periodogram
Version 0.2
By AA Miller (Northwestern/CIERA)
23 Sep 2021
In Lect... |
MissouriDSA/twitter-locale | twitter/twitter_7.ipynb | mit | # BE SURE TO RUN THIS CELL BEFORE ANY OF THE OTHER CELLS
import psycopg2
import pandas as pd
import re
# pull in our stopwords
from nltk.corpus import stopwords
stops = stopwords.words('english')
"""
Explanation: Twitter: An Analysis
Part 7
We've explored the basics of natural language processing using Postgres and ... |
justanr/notebooks | fillingtheswearjar.ipynb | mit | def run(prog: str, stdin: str="") -> StringIO:
stdout = StringIO()
memory = [0] * 30_000
memptr = 0
instrptr = 0
progsize = len(prog)
# stores the location of the last [ s we encountered
brackets = []
while instrptr < progsize:
op = progsize[instrptr]
instrptr += 1
... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/tsa_arma_0.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy import stats
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.graphics.api import qqplot
"""
Explanation: Autoregressive Moving Average (ARMA): Sunspots data
End of explanat... |
NeuroDataDesign/pan-synapse | pipeline_3/background/non_maxima_supression.ipynb | apache-2.0 | import sys
import scipy.io as sio
import glob
import numpy as np
import matplotlib.pyplot as plt
from skimage.filters import threshold_otsu
sys.path.append('../code/functions')
import qaLib as qLib
sys.path.append('../../pipeline_1/code/functions')
import connectLib as cLib
from IPython.display import Image
import rand... |
Astrohackers-TW/IANCUPythonAdventure | notebooks/notebooks4beginners/04_python_tutorial_sci-packages2.ipynb | mit | from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
time = np.linspace(0, 10, 200)
counts = 50 * np.sin(2 * np.pi * 1. / 2.5 * time) + 100 + np.random.normal(0, 5., len(time))
plt.plot(time, counts, 'k.')
counts_err = 4 * np.random.rand(len(time)) + 1
plt.errorb... |
amueller/scipy-2017-sklearn | notebooks/16.Performance_metrics_and_Model_Evaluation.ipynb | cc0-1.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
np.set_printoptions(precision=2)
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
digits = load_digits()
X, y = digits.data, digits.target
X_train, X_test, y_train, y_te... |
GoogleCloudDataproc/cloud-dataproc | notebooks/python/3.1. Spark DataFrame & Pandas Plotting - Python.ipynb | apache-2.0 | !scala -version
"""
Explanation: 3.1. Spark DataFrames & Pandas Plotting - Python
Create Dataproc Cluster with Jupyter
This notebook is designed to be run on Google Cloud Dataproc.
Follow the links below for instructions on how to create a Dataproc Cluster with the Juypter component installed.
Tutorial - Install and ... |
jrg365/gpytorch | examples/04_Variational_and_Approximate_GPs/Non_Gaussian_Likelihoods.ipynb | mit | import math
import torch
import gpytorch
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Non-Gaussian Likelihoods
Introduction
This example is the simplest form of using an RBF kernel in an ApproximateGP module for classification. This basic model is usable when there is not much training dat... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/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', 'miroc', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MIROC
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Bal... |
mertnuhoglu/study | py/jupyter/Course-Introduction to Deep Learning-Coursera.ipynb | apache-2.0 | import numpy as np
A = np.array([[56.0, 0.0, 4.4, 68.0],
[1.2,104.0,52.0,8.0],
[1.8,135.0,99.0,0.9]])
print(A)
cal = A.sum(axis=0)
print(cal)
percentage = 100*A/cal.reshape(1,4)
print(percentage)
"""
Explanation: 14 Broadcasting example
End of explanation
"""
import numpy as np
a = np... |
rmenegaux/bqplot | examples/Wealth of Nations.ipynb | apache-2.0 | # Required imports
import pandas as pd
from bqplot import (LogScale, LinearScale, OrdinalColorScale, ColorAxis,
Axis, Scatter, CATEGORY10, Label, Figure)
from bqplot.default_tooltip import Tooltip
from ipywidgets import VBox, IntSlider, Button
from IPython.display import display
import os
import num... |
JJINDAHOUSE/deep-learning | first-neural-network/Your_first_neural_network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
GoogleCloudPlatform/bigquery-oreilly-book | 09_bqml/text_embeddings.ipynb | apache-2.0 | import tensorflow as tf
import tensorflow_hub as tfhub
model = tf.keras.Sequential()
model.add(tfhub.KerasLayer("https://tfhub.dev/google/tf2-preview/gnews-swivel-20dim/1",
output_shape=[20], input_shape=[], dtype=tf.string))
model.summary()
model.predict(["""
Long years ago, we made a tryst... |
jhillairet/scikit-rf | doc/source/examples/networktheory/Transmission Line Losses.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import skrf as rf
rf.stylely()
"""
Explanation: Transmission Line Losses on a Loaded Lossy Line
When dealing with RF power, for instance in radio, industry or scientific applications, a recurrent problem is to handle the inevitable RF losses corre... |
MTG/sms-tools | notebooks/E4-STFT.ipynb | agpl-3.0 | import os
import sys
import numpy as np
from scipy.signal import get_window
from scipy.fftpack import fft, fftshift
import math
import matplotlib.pyplot as plt
%matplotlib notebook
eps = np.finfo(float).eps
sys.path.append('../software/models/')
import stft
import utilFunctions as UF
# E4 - 1.1: Complete function e... |
GoogleCloudPlatform/mlops-on-gcp | immersion/guided_projects/guided_project_3_nlp_starter/tfx_starter.ipynb | apache-2.0 | import absl
import os
import tempfile
import time
import pandas as pd
import tensorflow as tf
import tensorflow_data_validation as tfdv
import tensorflow_model_analysis as tfma
import tensorflow_transform as tft
import tfx
from pprint import pprint
from tensorflow_metadata.proto.v0 import schema_pb2, statistics_pb2, ... |
ceos-seo/data_cube_notebooks | notebooks/Data_Challenge/Weather.ipynb | apache-2.0 | # Supress Warnings
import warnings
warnings.filterwarnings('ignore')
# Import common GIS tools
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import rasterio.features
import folium
import math
# Import Planetary Computer tools
import pystac_client
import planetary_computer
"""
Explanation: 2... |
poldrack/fmri-analysis-vm | analysis/machinelearning/MachineLearningBasics.ipynb | mit | import numpy,pandas
%matplotlib inline
import matplotlib.pyplot as plt
import scipy.stats
from sklearn.model_selection import LeaveOneOut,KFold
from sklearn.preprocessing import PolynomialFeatures,scale
from sklearn.linear_model import LinearRegression,LassoCV,Ridge
import seaborn as sns
import statsmodels.formula.api ... |
nkundiushuti/pydata2017bcn | TensorBoardDemo.ipynb | gpl-3.0 | from keras.models import Model
from keras.layers import Convolution2D, BatchNormalization, MaxPooling2D, Flatten, Dense
from keras.layers import Input, Dropout
from keras.layers.advanced_activations import ELU
from keras.regularizers import l2
from keras.optimizers import SGD
import tensorflow as tf
from settings imp... |
dboonz/aspp2015 | Advanced NumPy Patterns.ipynb | bsd-3-clause | gene0 = [100, 200, 50, 400]
gene1 = [50, 0, 0, 100]
gene2 = [350, 100, 50, 200]
expression_data = [gene0, gene1, gene2]
"""
Explanation: Intro
Juan Nunez-Iglesias
Victorian Life Sciences Computation Initiative (VLSCI)
University of Melbourne
Quick example: gene expression, without numpy
| | Cell type A | Cell... |
Applied-Groundwater-Modeling-2nd-Ed/Chapter_4_problems-1 | P4.5_Flopy_Hubbertville_areal_model_BCs.ipynb | gpl-2.0 | %matplotlib inline
import sys
import os
import shutil
import numpy as np
from subprocess import check_output
# Import flopy
import flopy
"""
Explanation: <img src="AW&H2015.tiff" style="float: left">
<img src="flopylogo.png" style="float: center">
Problem P4.5 Hubbertville Areal Model Perimeter Boundary Conditions
In... |
jmschrei/pomegranate | examples/naivebayes_simple_male_female.ipynb | mit | from pomegranate import *
import seaborn
seaborn.set_style('whitegrid')
%pylab inline
"""
Explanation: Naive Bayes Simple Male or Female
author: Nicholas Farn [<a href="sendto:nicholasfarn@gmail.com">nicholasfarn@gmail.com</a>]
This example shows how to create a simple Gaussian Naive Bayes Classifier using pomegranate... |
aylward/ITKTubeTK | examples/archive/VesselExtractionUsingCTA_TrainVascularModel/VesselExtractionUsingCTA_TrainVascularModel.ipynb | apache-2.0 | import os
import sys
import numpy
# Path for TubeTK libs and bin
#Values takend from TubeTK launcher
#sys.path.append("C:/src/TubeTK_Python_ITK/SlicerExecutionModel-build/GenerateCLP/")
#sys.path.append("C:/src/TubeTK_Python_ITK/SlicerExecutionModel-build/GenerateCLP/Release")
#sys.path.append("C:/src/TubeTK_Python_... |
gtrichards/PHYS_T480 | TimeSeries2.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
from astroML.time_series import generate_power_law
from astroML.fourier import PSD_continuous
N = 2014
dt = 0.01
beta = 2
t = dt * np.arange(N)
y = generate_power_law(# Complete
f, PSD = PSD_continuous(# Complete
fig = plt.figure(figsize=(8, 4))
ax1 = fig.a... |
nohmapp/acme-for-now | essential_algorithms/Moderate Difficulty.ipynb | mit | letters_map = {'2':'ABC', '3':'DEF', '4':'GHI', '5':'JKL',
'6':'MNO', '7':'PQRS', '8':'TUV', '9':'WXYZ'}
def printWords(number, ):
#number is phone number
def printWordsUtil(numb, curr_digit, output, n):
if curr_digit == n:
print('%s ' % output)
return
for i in ... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/dev/n04B_evaluation_infrastructure.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... |
tpin3694/tpin3694.github.io | machine-learning/.ipynb_checkpoints/calculate_difference_between_dates_and_times-checkpoint.ipynb | mit | # Load library
import pandas as pd
"""
Explanation: Title: Calculate Difference Between Dates And Times
Slug: calculate_difference_between_dates_and_times
Summary: How to calculate differences between dates and times for machine learning in Python.
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessi... |
mmoll/hammer-cli | rel-eng/gem_release.ipynb | gpl-3.0 | %cd ..
"""
Explanation: Release of hammer-cli gem
Requirements
push access to https://github.com/theforeman/hammer-cli
push access to rubygems.org for hammer-cli
sudo yum install transifex-client python-slugify asciidoc
ensure neither the git push or gem push don't require interractive auth. If you can't use api key ... |
anabranch/data_analysis_with_python_and_pandas | 3 - NumPy Basics/3-3 NumPy Array Basics - Vectorization.ipynb | apache-2.0 | import sys
print(sys.version)
import numpy as np
print(np.__version__)
npa = np.random.random_integers(0,50,20)
"""
Explanation: NumPy Array Basics - Vectorization
End of explanation
"""
npa
"""
Explanation: Now I’ve harped on about vectorization in the last couple of videos and I’ve told you that it’s great but I... |
emjotde/UMZ | Cwiczenia/02/Uczenie Maszynowe - Ćwiczenia 2.1 - Wykresy i krzywe.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
## initialize the axes
fig = plt.figure()
ax = fig.add_subplot(111)
## format axes
ax.set_ylabel('volts')
ax.set_title('a sine wave')
t = np.arange(0.0, 1.0, 0.01)
s = np.sin(2*np.pi*t)
line, = ax.plot(t, s, color='blue', lw=2)
"""
Explanation: ... |
KasperPRasmussen/bokeh | examples/howto/charts/deep_dive-attributes.ipynb | bsd-3-clause | from bokeh.charts.attributes import AttrSpec, ColorAttr, MarkerAttr
"""
Explanation: Bokeh Charts Attributes
One of Bokeh Charts main contributions is that it provides a flexible interface for applying unique attributes based on the unique values in column(s) of a DataFrame.
Internally, the bokeh chart uses the AttrSp... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/numpy/02.01-Understanding-Data-Types.ipynb | mit | L = list(range(10))
L
type(L[0])
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub.
The text is released under the CC-... |
bjshaw/phys202-2015-work | assignments/assignment09/IntegrationEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import integrate
"""
Explanation: Integration Exercise 2
Imports
End of explanation
"""
def integrand(x, a):
return 1.0/(x**2 + a**2)
def integral_approx(a):
# Use the args keyword argument to feed extra a... |
cleuton/datascience | book/capt10/server_load.ipynb | apache-2.0 | import numpy as np
from sklearn.preprocessing import normalize
from sklearn.preprocessing import StandardScaler
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as stats
%matplotlib inline
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
from skle... |
dstrockis/outlook-autocategories | notebooks/3-Playing with text analytics tools.ipynb | apache-2.0 | # Load data
import pandas as pd
with open('./data_files/8lWZYw-u-yNbGBkC4B--ip77K1oVwwyZTHKLeD7rm7k.csv') as data_file:
df = pd.read_csv(data_file)
df.head()
"""
Explanation: Hypotheses
Cleaner features will improve accuracy & robustness
Including the body of the email will improve accuracy
Extracting meaning fro... |
NirantK/deep-learning-practice | 01-InitNN/first-neural-network.ipynb | apache-2.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some ... |
laserson/phip-stat | notebooks/phip_modeling/bayesian-modeling-stats.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
cpm = pd.read_csv('/Users/laserson/tmp/phip_analysis/phip-9/cpm.tsv', sep='\t', header=0, index_col=0)
upper_bound = sp.stats.scoreatpercentile(cpm.values.ravel(), 99.9)
upper_bound
fig... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Top... |
ioos/notebooks_demos | notebooks/2016-12-20-searching_glider_deployments.ipynb | mit | import requests
url = "http://data.ioos.us/gliders/providers/api/deployment"
response = requests.get(url)
res = response.json()
print("Found {0} deployments!".format(res["num_results"]))
"""
Explanation: Accessing glider data via the Glider DAC API with Python
IOOS provides an API for getting information on all th... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_ecog.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# Chris Holdgraf <choldgraf@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from mayavi import mlab
import mne
from mne.viz import plot_alignment, snapshot_brain_montage
print(__doc__)
""... |
amorgun/shad-ml-notebooks | notebooks/s1-6/pca.ipynb | unlicense | # Будем строить графики зависимости различных параметров от размерности пространства
def plot_dim(prop, dims=(1, 30), samples=10000, **kwargs):
ds = range(dims[0], dims[1] + 1)
plot(ds, list(map(lambda d: prop(d, samples=samples, **kwargs), ds)))
xlim(dims)
from scipy.stats import gaussian_kde
def kde_plot(... |
phoebe-project/phoebe2-docs | development/tutorials/emcee_custom_lnprob.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
import phoebe
from phoebe import u # units
import numpy as np
logger = phoebe.logger('error')
"""
Explanation: Advanced: Custom Cost Funtion (with emcee)
IMPORTANT: this tutorial assumes basic knowledge (and uses a file resulting from) the emcee tutorial, although the custom cost ... |
dato-code/tutorials | notebooks/getting_started_with_python.ipynb | apache-2.0 | print 'Hello World!'
"""
Explanation: Getting Started with Python and GraphLab Create
Python is a popular high-level programming language. It's a simple language, designed with an emphsis on code readability. If you already have programming experience, Python is easy to learn.
Installing GraphLab and Python
Follow the... |
roebius/deeplearning_keras2 | nbs/lesson4.ipynb | apache-2.0 | ratings = pd.read_csv(path+'ratings.csv')
ratings.head()
len(ratings)
"""
Explanation: Set up data
We're working with the movielens data, which contains one rating per row, like this:
End of explanation
"""
movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict
users = ratings.userId.un... |
AllenDowney/DataExploration | nsfg.ipynb | mit | from __future__ import print_function, division
import numpy as np
import thinkstats2
"""
Explanation: Import and Validation
Copyright 2015 Allen Downey
License: Creative Commons Attribution 4.0 International
End of explanation
"""
def ReadFemPreg(dct_file='2002FemPreg.dct',
dat_file='2002FemPreg.da... |
TorbjornT/pyAccuRT | examples/Example1.ipynb | mit | import accuread as ar
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use(['ggplot'])
moddir = '../tests/testdata/'
d = ar.ReadART('demo1', # basename of simulation
basefolder=moddir, # folder where the Output-folder is located
scalar=True, # read scalar irradiance
... |
jamesjia94/BIDMach | tutorials/NVIDIA/.ipynb_checkpoints/ClusteringImages-checkpoint.ipynb | bsd-3-clause | import BIDMat.{CMat,CSMat,DMat,Dict,IDict,Image,FMat,FND,GDMat,GMat,GIMat,GSDMat,GSMat,HMat,IMat,Mat,SMat,SBMat,SDMat}
import BIDMat.MatFunctions._
import BIDMat.SciFunctions._
import BIDMat.Solvers._
import BIDMat.JPlotting._
import BIDMach.Learner
import BIDMach.models.{FM,GLM,KMeans,KMeansw,ICA,LDA,LDAgibbs,Model,NM... |
adrn/thejoker | docs/examples/2-Customize-prior.ipynb | mit | import astropy.table as at
from astropy.time import Time
import astropy.units as u
from astropy.visualization.units import quantity_support
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
import pymc3 as pm
import exoplanet.units as xu
import thejoker as tj
# set up a random number generator to ... |
ucsd-ccbb/jupyter-genomics | notebooks/crispr/Dual CRISPR 1-Construct Scaffold Trimming.ipynb | mit | g_num_processors = 3
g_fastqs_dir = '/Users/Birmingham/Repositories/ccbb_tickets/20160210_mali_crispr/data/raw/20160504_D00611_0275_AHMM2JBCXX'
g_trimmed_fastqs_dir = '/Users/Birmingham/Repositories/ccbb_tickets/20160210_mali_crispr/data/interim/20160504_D00611_0275_AHMM2JBCXX'
g_full_5p_r1 = 'TATATATCTTGTGGAAAGGACGAAA... |
woodmd/haloanalysis | notebooks/Select_Population.ipynb | bsd-3-clause | import os
import sys
from collections import OrderedDict
import yaml
import numpy as np
from astropy.io import fits
from astropy.table import Table, Column, join, hstack, vstack
from haloanalysis.utils import create_mask, load_source_rows
from haloanalysis.sed import HaloSED
from haloanalysis.model import CascModel,... |
csaladenes/csaladenes.github.io | present/bi/2018/jupyter/pelda.ipynb | mit | df=pd.read_excel('formazottbi2.xlsx')
df
"""
Explanation: Példa 1
End of explanation
"""
pd.DataFrame(df.stack()).head()
"""
Explanation: A stack egymásra rakja az oszlopokat.
End of explanation
"""
df.columns
df.set_index(['Tevékenység','Ország']).head(2)
"""
Explanation: Most nem teljesen jó, mert előbb az o... |
cliburn/sta-663-2017 | notebook/10A_CodeOptimization.ipynb | mit | %%file distance.py
import numpy as np
def euclidean_dist(u, v):
"""Returns Euclidean distance betwen numpy vectors u and v."""
w = u - v
return np.sqrt(np.sum(w**2))
%%file test_distance.py
import numpy as np
from numpy.testing import assert_almost_equal
from distance import euclidean_dist
def test_non_... |
ellisztamas/faps | docs/tutorials/06_simulating_data.ipynb | mit | import numpy as np
import faps as fp
import matplotlib.pylab as plt
import pandas as pd
from time import time, localtime, asctime
print("Created using FAPS version {}.".format(fp.__version__))
"""
Explanation: Simulating data and power analysis
Tom Ellis, August 2017
End of explanation
"""
np.random.seed(37)
allele... |
wanderer2/pymc3 | docs/source/notebooks/dp_mix.ipynb | apache-2.0 | %matplotlib inline
from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
import pymc3 as pm
import scipy as sp
import seaborn as sns
from statsmodels.datasets import get_rdataset
from theano import tensor as tt
blue, *_ = sns.color_palette()
SEED = 5132290 # from random.org
np.ran... |
vvishwa/deep-learning | autoencoder/Convolutional_Autoencoder_Solution.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
mne-tools/mne-tools.github.io | 0.21/_downloads/2fc30e4810d35d643811cc11759b3b9a/plot_resample.ipynb | bsd-3-clause | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
#
# License: BSD (3-clause)
from matplotlib import pyplot as plt
import mne
from mne.datasets import sample
"""
Explanation: Resampling data
When performing experiments where timing is critical, a signal with a high
sampling rate is desired. However, having a sign... |
mne-tools/mne-tools.github.io | 0.24/_downloads/8ea2bfc401dbdff70c284d271d62fa8c/label_from_stc.ipynb | bsd-3-clause | # Author: Luke Bloy <luke.bloy@gmail.com>
# Alex Gramfort <alexandre.gramfort@inria.fr>
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.minimum_norm import read_inverse_operator, apply_inverse
from mne.datasets import sample
print(__doc__)
data_path = sample.da... |
danresende/deep-learning | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
NeuPhysics/aNN | ipynb/Basics.ipynb | mit | import numpy as np
print np.linspace(0,9,10), np.exp(-np.linspace(0,9,10))
"""
Explanation: A Physicist's Crash Course on Artificial Neural Network
What is a Neuron
What a neuron does is to response when a stimulation is given. This response could be strong or weak or even null. If I would draw a figure, of this behav... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-out-Dex-27d.ipynb | mit | ph_sel_name = "Dex"
data_id = "27d"
# ph_sel_name = "all-ph"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:36:12 2017
Duration: 8 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from ... |
mwytock/cvxpy | examples/notebooks/WWW/water_filling_BVex5.2.ipynb | gpl-3.0 | #!/usr/bin/env python3
# @author: R. Gowers, S. Al-Izzi, T. Pollington, R. Hill & K. Briggs
import numpy as np
import cvxpy as cvx
def water_filling(n,a,sum_x=1):
'''
Boyd and Vandenberghe, Convex Optimization, example 5.2 page 145
Water-filling.
This problem arises in information theory, in allocating power to ... |
napsternxg/ipython-notebooks | Keras Demo.ipynb | apache-2.0 | X_org, y = iris.data, iris.target
print "Classes present in IRIS", iris.target_names
# Convert y to one hot vector for each category
enc = OneHotEncoder()
y= enc.fit_transform(y[:, np.newaxis]).toarray()
# **VERY IMPORTANT STEP** Scale the values so that mean is 0 and variance is 1.
# If this step is not performed th... |
lamastex/scalable-data-science | _360-in-525/2018/02/SimonLindgren/MeTooInJupyterIpythonNBAction/Simon_MetooStep1.ipynb | unlicense | from IPython.display import HTML
import os
"""
Explanation: Simon #metoo step 1
End of explanation
"""
HTML("""
<video width="320" height="240" controls>
<source src="btf.m4v" type="video/mp4">
</video>
""")
"""
Explanation: Data was collected using this method. It uses the Twitter API to go some days back in tim... |
njtwomey/ADS | 03_data_transformation_and_integration/04_survey_demo.ipynb | mit | import pandas as pd
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
"""
Explanation: Joining data from Google forms questionnaires.
End of explanation
"""
columns = ['Datetime', 'ID', 'Course', 'Python_Experience', 'Favourite_Language']
df1 = pd.read_csv('Data Fusion.csv', names=col... |
f-guitart/data_mining | notes/98 - Data Storage and File Formats with Pandas.ipynb | gpl-3.0 | import pandas as pd
iqsize = pd.read_csv("https://raw.githubusercontent.com/f-guitart/data_mining/master/data/iqsize.csv")
iqsize.head()
type(iqsize)
iqsize["sex"][:10]
iqsize["sex"].to_csv("myseries.csv")
%ls myseries.csv
"""
Explanation: Data reading and writting using Pandas
We will focus on three formats to st... |
mbeyeler/opencv-machine-learning | notebooks/09.03-Getting-Acquainted-with-Deep-Learning.ipynb | mit | from keras.models import Sequential
model = Sequential()
"""
Explanation: <!--BOOK_INFORMATION-->
<a href="https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-opencv" target="_blank"><img align="left" src="data/cover.jpg" style="width: 76px; height: 100px; background: white; padding: 1px; bord... |
sdpython/actuariat_python | _doc/notebooks/sessions/2017_session6.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Session 26/6/2017 - machine learning
Découverte des trois problèmes de machine learning exposé dans l'article Machine Learning - session 6.
End of explanation
"""
import pandas
df = pandas.read_csv("data/housing.data", delim_whitespace=... |
stuser/temp | AI_Academy/trend_micro_basic_data_intro.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.family']='SimHei' #顯示中文
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
# Load in the train datasets
train = pd.read_csv('input/training-set.csv', encoding = "utf-8", header=None)
test = pd.read_csv('input/... |
LSST-Supernova-Workshops/Pittsburgh-2016 | Tutorials/QuickMC/Topic5_workbook.ipynb | mit | %matplotlib inline
import sys, platform, os
from matplotlib import pyplot as plt
import numpy as np
import astropy as ap
import pylab as pl
# we start by setting the cosmological parameters of interest, and reading in our data
cosmoparams_orig = [70., 0.3, 0.7, -0.9, 0.2]
redshift=np.arange(0.001,1.3,0.01) # a redshif... |
semio/ddf_utils | examples/etl/migrant.ipynb | mit | import numpy as np
import pandas as pd
# from ddf_utils.dsl import *
source = '../source/UN_MigrantStockByOriginAndDestination_2019.xlsx'
"""
Explanation: Create DDF dataset from UN International migrant stock 2019 dataset
In this notebook we are going to demonstrate how to create a DDF dataset with ddf_utils. We wil... |
BrownDwarf/ApJdataFrames | notebooks/Rebull2016b.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
pd.options.display.max_columns = 150
%config InlineBackend.figure_format = 'retina'
import astropy
from astropy.table import Table
from astropy.io import ascii
import numpy as np
"""
Explanation: ApJdataFrames Rebull 2016 a ... |
BrainIntensive/OnlineBrainIntensive | resources/nipype/nipype_tutorial/notebooks/basic_interfaces.ipynb | mit | %pylab inline
from nilearn.plotting import plot_anat
plot_anat('/data/ds102/sub-01/anat/sub-01_T1w.nii.gz', title='original',
display_mode='ortho', dim=-1, draw_cross=False, annotate=False)
"""
Explanation: Interfaces
In Nipype, interfaces are python modules that allow you to use various external packages (e... |
ybao2016/tf-slim-model | slim_walkthrough.ipynb | apache-2.0 | import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
import math
import numpy as np
import tensorflow as tf
import time
from datasets import dataset_utils
# Main slim library
slim = tf.contrib.slim
"""
Explanation: TF-Slim Walkthrough
This notebook will walk you through the basics of using TF-Slim to... |
shead-custom-design/pipecat | docs/battery-chargers.ipynb | gpl-3.0 | # nbconvert: hide
from __future__ import absolute_import, division, print_function
import sys
sys.path.append("../features/steps")
import test
serial = test.mock_module("serial")
serial.serial_for_url.side_effect = test.read_file("../data/icharger208b-charging", stop=3)
import serial
port = serial.serial_for_url("/... |
ioos/pyoos | notebooks/NERRS.ipynb | lgpl-3.0 | from datetime import datetime, timedelta
import pandas as pd
from pyoos.collectors.nerrs.nerrs_soap import NerrsSoap
# FROM pyoos SOS handling
# Convenience function to build record style time series representation
def flatten_element(p):
rd = {'time':p.time}
for m in p.members:
rd[m['standard']] = m['... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.