repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Xilinx/PYNQ | boards/Pynq-Z1/base/notebooks/audio/audio_playback.ipynb | bsd-3-clause | from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
pAudio = base.audio
"""
Explanation: Welcome to Pynq Audio
This notebook shows the basic recording and playback features of the board.
It uses the audio jack to play back recordings from the built-in microphone, as well as a pre-recorded audio s... |
Xilinx/meta-petalinux | recipes-multimedia/gstreamer/gstreamer-vcu-notebooks/vcu-demo-camera-encode-decode-display.ipynb | mit | from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here... |
heprom/pymicro | examples/SampleDataUserGuide/5_SampleData_data_compression.ipynb | mit | from config import PYMICRO_EXAMPLES_DATA_DIR # import file directory path
import os
dataset_file = os.path.join(PYMICRO_EXAMPLES_DATA_DIR, 'example_microstructure') # test dataset file path
tar_file = os.path.join(PYMICRO_EXAMPLES_DATA_DIR, 'example_microstructure.tar.gz') # dataset archive path
"""
Explanation: 6 - D... |
mulhod/reviewer_experience_prediction | jupyter_notebooks/Exploring_Review_Data.ipynb | mit | import os
import sys
from json import loads
from collections import Counter
import numpy as np
import pandas as pd
# So, let's take a look at how many lines are in our reviews files
# Note: I just started processing GTAV after ending all the other processes
os.chdir('..')
! wc -l data/*.jsonlines
"""
Explanation: Ex... |
open-forcefield-group/openforcefield | examples/check_dataset_parameter_coverage/check_parameter_coverage.ipynb | mit | from openff.toolkit.topology import Molecule, Topology
from openff.toolkit.typing.engines.smirnoff import (ForceField,
UnassignedValenceParameterException, BondHandler, AngleHandler,
ProperTorsionHandler, ImproperTorsionHandler,
vdWHandler)
from simtk import unit
import numpy as np
from rdkit import Chem
from rdkit.Ch... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/labs/serving_ml_prediction.ipynb | apache-2.0 | PROJECT = "cloud-training-demos" # Replace with your PROJECT
BUCKET = PROJECT
REGION = "us-central1" # Choose an available region for Cloud MLE
TFVERSION = "2.6" # TF version for CMLE to use
import os
os.environ["BUCKET"] = BUCKET
os.environ["PROJECT"] = PROJECT
os.environ["REGION"] = REGIO... |
Evfro/RecSys_ISP2017 | team_contest.ipynb | mit | test_data = pd.read_csv("https://github.com/Evfro/RecSys_ISP2017/raw/master/test_data_new.gz", compression='gzip')
test_data.head()
"""
Explanation: Preparing data
get test users data
End of explanation
"""
ml_data = get_movielens_data()
"""
Explanation: This data is not a part of the Movielens-1M dataset, however,... |
mavillan/SciProg | 02_numpy/02_actividad.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def image_plot(data, title='FITS image'):
plt.figure(figsize=(10,10))
im = plt.imshow(data, cmap=plt.cm.afmhot, interpolation=None)
plt.title(title)
#plt.axis('off')
divider = make_axes_locata... |
marioberges/F16-12-752 | projects/zhiangz_suxinm/code/project_lr_treeLr.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#outdoor air temperature
oa = pd.read_csv("../data/oa_temp_utc_f.csv");
oa.columns = ['time', 'oa']
oa.set_index("time", drop = True, inplace = True);
oa.index = pd.to_datetime(oa.index)
oa = oa.replace('/', np.nan)
oa['oa'] = oa['oa'].astype(floa... |
akseshina/dl_course | seminar_4/.ipynb_checkpoints/object_detection-checkpoint.ipynb | gpl-3.0 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
%matplotlib inline
# This is needed since the notebook is stored in th... |
probml/pyprobml | deprecated/gan_mixture_of_gaussians.ipynb | mit | !pip install -q flax
from typing import Sequence
import matplotlib.pyplot as plt
import jax
import jax.numpy as jnp
import flax.linen as nn
from flax.training import train_state
import optax
import functools
import scipy as sp
import math
rng = jax.random.PRNGKey(0)
"""
Explanation: <a href="https://colab.researc... |
jeiros/Jupyter_notebooks | python/markov_analysis/PyEMMA-API.ipynb | mit | import pyemma
pyemma.__version__
"""
Explanation: Testing the pyEMMA API
End of explanation
"""
import matplotlib.pylab as plt
import numpy as np
%pylab inline
"""
Explanation: Now we import a few general packages that we need to start with. The following imports basic numerics and algebra routines (numpy) and plot... |
JarronL/pynrc | notebooks/Basic_Usage.ipynb | mit | # Import the usual libraries
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# Enable inline plotting at lower left
%matplotlib inline
"""
Explanation: Basic Usage
This tutorial walks through the basic usage of the pynrc package to calculate sensitivities and saturation limits for NIRCam in a var... |
galbiati/nns-for-mnk | Training & Prototyping.ipynb | mit | autoencoder = Autoencoder(ae.autoencoder) # initialize autoencoder obj
ae_trainer = AutoencoderTrainer(stopthresh=1, print_interval=1) # initialize trainer
ae_start_params = L.get_all_param_values(autoencoder.autoencoder) # cache starting parameters(move to network obj)
ae_trainer.train_au... |
flohorovicic/pynoddy | docs/notebooks/7-Gippsland-Basin-Uncertainty.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
%matplotlib inline
#import the ususal libraries + the pynoddy UncertaintyAnalysis class
import sys, os
# determine path of repository to set paths corretly below
repo_path = os.path.realpath('/Users/flow/git/pynoddy/')... |
SKA-ScienceDataProcessor/crocodile | examples/notebooks/wsnapshot.ipynb | apache-2.0 | %matplotlib inline
import sys
sys.path.append('../..')
from matplotlib import pylab
from ipywidgets import interact
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
pylab.rcParams['figure.figsize'] = 12, 10
import functools
import numpy
import scipy
import scipy.special
from astropy.coordinat... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/solutions/multi_worker_with_keras.ipynb | apache-2.0 | import json
import os
import sys
"""
Explanation: Multi-worker training with Keras
Learning Objectives
Multi-worker Configuration
Choose the right strategy
Train the model
Multi worker training in depth
Introduction
This notebook demonstrates multi-worker distributed training with Keras model using tf.distribute.Str... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-3/cmip6/models/sandbox-2/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-3', 'sandbox-2', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: TEST-INSTITUTE-3
Source ID: SANDBOX-2
Topic: Atmos
Sub-Topics: Dynamical... |
tensorflow/docs-l10n | site/en-snapshot/neural_structured_learning/tutorials/graph_keras_lstm_imdb.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... |
planetlabs/notebooks | jupyter-notebooks/webtiles/visualize_imagery_over_time.ipynb | apache-2.0 | import os
# Setup the API Key from the `PL_API_KEY` environment variable
PLANET_API_KEY = os.getenv('PL_API_KEY')
# If you're following along with this notebook, you can enter your API Key on the following line, and uncomment it:
# PLANET_API_KEY = 'YOUR_KEY_HERE'
assert PLANET_API_KEY, 'api key not set'
# Import hel... |
googlegenomics/datalab-examples | datalab/genomics/FacetsDemo1000GenomesMetadata.ipynb | apache-2.0 | FACETS_INSTALL_DIR = './'
%%bash -s "$FACETS_INSTALL_DIR"
if [ ! -d "${1}/facets" ]; then
# Install facets - only need to do this once per Datalab instance.
cd $1
git clone https://github.com/PAIR-code/facets
cd facets
jupyter nbextension install facets-dist/
else
echo Facets is already install... |
tatjanus/cianparser | parser.ipynb | bsd-2-clause | district = 'http://www.cian.ru/cat.php?deal_type=sale&district%5B0%5D=13&district%5B1%5D=14&district%5B2%5D=15&district%5B3%5D=16&district%5B4%5D=17&district%5B5%5D=18&district%5B6%5D=19&district%5B7%5D=20&district%5B8%5D=21&district%5B9%5D=22&engine_version=2&offer_type=flat&p={}&room1=1&room2=1&room3=1&room4=1&room5=... |
vaxherra/vaxherra.github.io | _files/bacterial_names/RNNs.ipynb | mit | ! wget https://www.arb-silva.de/fileadmin/silva_databases/release_132/Exports/SILVA_132_LSUParc_tax_silva.fasta.gz
"""
Explanation: Bacterial name generator with RNNs
In this post I’ll cover how to build a Recurrent Neural Network (RNN) from scratch using python3.6 with basic numerical libraries like numpy. Then I'll ... |
GEMScienceTools/rmtk | notebooks/vulnerability/derivation_fragility/equivalent_linearization/miranda_2000_firm_soils/miranda_2000_firm_soils.ipynb | agpl-3.0 | from rmtk.vulnerability.derivation_fragility.equivalent_linearization.miranda_2000_firm_soils import miranda_2000_firm_soils
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Miranda (2000) for firm soils
This methodology, proposed in Miranda (2000), aims to estimate the maximum lateral i... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/tfx_pipelines/walkthrough/solutions/tfx_walkthrough_vertex.ipynb | apache-2.0 | import os
import time
from pprint import pprint
import absl
import tensorflow as tf
import tensorflow_data_validation as tfdv
import tensorflow_model_analysis as tfma
import tensorflow_transform as tft
import tfx
from tensorflow_metadata.proto.v0 import schema_pb2
from tfx.components import (
CsvExampleGen,
Ev... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_custom_image_classification_online_tfserving.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: Custom training image classification model using TF Serving containe... |
junhwanjang/DataSchool | Lecture/14. 선형 회귀 분석/7) 분산 분석 기반의 카테고리 분석.ipynb | mit | from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder()
x0 = np.random.choice(3, 10)
x0
encoder.fit(x0[:, np.newaxis])
X = encoder.transform(x0[:, np.newaxis]).toarray()
X
dfX = pd.DataFrame(X, columns=encoder.active_features_)
dfX
"""
Explanation: 분산 분석 기반의 카테고리 분석
회귀 분석 대상이 되는 독립 변수가 카테고리 값을 가지는... |
WillenZh/deep-learning-project | tutorials/autoencoder/Simple_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)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
PySCeS/PyscesToolbox | example_notebooks/Symca.ipynb | bsd-3-clause | mod = pysces.model('lin4_fb')
sc = psctb.Symca(mod)
"""
Explanation: Symca
Symca is used to perform symbolic metabolic control analysis [3,4] on metabolic pathway models in order to dissect the control properties of these pathways in terms of the different chains of local effects (or control patterns) that make up the... |
jinntrance/MOOC | coursera/ml-clustering-and-retrieval/assignments/4_em-with-text-data_blank.ipynb | cc0-1.0 | import graphlab
'''Check GraphLab Create version'''
from distutils.version import StrictVersion
assert (StrictVersion(graphlab.version) >= StrictVersion('1.8.5')), 'GraphLab Create must be version 1.8.5 or later.'
"""
Explanation: Fitting a diagonal covariance Gaussian mixture model to text data
In a previous assignm... |
datapolitan/lede_algorithms | class5_1/.ipynb_checkpoints/vectorization-checkpoint.ipynb | gpl-2.0 | bill_titles = ['An act to amend Section 44277 of the Education Code, relating to teachers.']
vectorizer = CountVectorizer()
features = vectorizer.fit_transform(bill_titles).toarray()
print features
print vectorizer.get_feature_names()
"""
Explanation: Basic vectorization
Vectorizing text is a fundamental concept in ... |
opengeostat/pygslib | doc/source/Ipython_templates/broken/vtk_tools.ipynb | mit | import pygslib
import numpy as np
"""
Explanation: VTK tools
Pygslib use VTK:
as data format and data converting tool
to plot in 3D
as a library with some basic computational geometry functions, for example to know if a point is inside a surface
Some of the functions in VTK were obtained or modified from Adamos Kyr... |
kmorel/kmorel.github.io | images/better-plots/Detail_Make.ipynb | mit | import pandas
import numpy
import toyplot
import toyplot.pdf
import toyplot.png
import toyplot.svg
print('Pandas version: ', pandas.__version__)
print('Numpy version: ', numpy.__version__)
print('Toyplot version: ', toyplot.__version__)
"""
Explanation: When analyzing data, I usually use the following three module... |
mdeff/ntds_2016 | algorithms/03_ex_classification.ipynb | mit | # Load libraries
import numpy as np # Math
import scipy.io # Import data
import time
import sklearn.neighbors, sklearn.linear_model, sklearn.ensemble, sklearn.naive_bayes # Baseline classification techniques
import matplotlib.pyplot as plt
# Load 400 text documents representing 5 classes
# X_train matrix contains the ... |
fsalmoir/PyGeM | tutorials/tutorial-1-stl.ipynb | mit | %matplotlib inline
import pygem as pg
"""
Explanation: PyGeM
Tutorial 1: Free Form Deformation on a sphere in stl file format
In this tutorial we will show the typical workflow. In particular we are going to parse the parameters file for the FFD, read an stl file of a sphere, perform the FFD and write the results on a... |
cstrelioff/ARM-ipynb | Chapter3/chptr3.5-R.ipynb | mit | %%R
# I had to import foreign to get access to read.dta
library("foreign")
kidiq <- read.dta("../../ARM_Data/child.iq/kidiq.dta")
# I won't attach kidiq-- i generally don't attach to avoid confusion(s)
#attach(kidiq)
"""
Explanation: 3.5 Graphical displays of data and fitted models
Read the data
Data are in the child... |
GoogleCloudPlatform/training-data-analyst | blogs/t2t/translate_ende.ipynb | apache-2.0 | %bash
pip install tensor2tensor
import os
PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID
BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME
REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
# this is what this notebook is demonstrating
PROBLEM= 'my_translate_p... |
mne-tools/mne-tools.github.io | 0.24/_downloads/5bedf835c134d956a9b527dc8c5f488c/20_rejecting_bad_data.ipynb | bsd-3-clause | import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_filt-0-40_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
events_file = os.path.join(sample_data... |
archman/phantasy | docs/source/src/notebooks/phantasy_lattice.ipynb | bsd-3-clause | import phantasy
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Lattice
PS: Since phantasy is still under development, this notebook might be updated frequently.
Import modules/packages
End of explanation
"""
mp = phantasy.MachinePortal(machine='FRIB_FLAME', segment='LINAC')
"""
Explanation: Mod... |
mne-tools/mne-tools.github.io | 0.20/_downloads/e6b765a72099a336669c021aac76fd0a/plot_sleep.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets.sleep_physionet.age import fetch_data
from mne.time_freq... |
oditorium/blog | iPython/Graphs1-Spectrum.ipynb | agpl-3.0 | import numpy as np
class GraphMatrix:
"""
class to manage and create graph matrices
the constructor takes the dimension of the matrix
"""
version = "2.0"
def __init__(self, dimension):
self.array = np.zeros((dimension,dimension))
self.dim = dimension
d... |
BBN-Q/QGL | doc/ex3_two-qubit_sequences.ipynb | apache-2.0 | from QGL import *
"""
Explanation: Two-Qubit Characterization Sequences
Examples of two-qubit sequences, including CR gates
End of explanation
"""
cl = ChannelLibrary("example")
q1 = cl["q1"]
# Repeat similar configuration for q2
q2 = cl.new_qubit("q2")
aps2_3 = cl.new_APS2("BBNAPS3", address="192.168.5.103")
aps... |
deepmind/enn | enn/colabs/enn_demo.ipynb | apache-2.0 | # 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 applicable law or agreed to in writing, software
# distributed under ... |
InsightSoftwareConsortium/SimpleITK-Notebooks | Python/60_Registration_Introduction.ipynb | apache-2.0 | import SimpleITK as sitk
# Utility method that either downloads data from the Girder repository or
# if already downloaded returns the file name for reading from disk (cached data).
%run update_path_to_download_script
from downloaddata import fetch_data as fdata
# Always write output to a separate directory, we don't... |
rsignell-usgs/notebook | NEXRAD/THREDDS_Radar_Server.ipynb | mit | import matplotlib
import warnings
warnings.filterwarnings("ignore", category=matplotlib.cbook.MatplotlibDeprecationWarning)
%matplotlib inline
"""
Explanation: Using Python to Access NCEI Archived NEXRAD Level 2 Data
This notebook shows how to access the THREDDS Data Server (TDS) instance that is serving up archived N... |
radu941208/DeepLearning | Convolutional_Neural_Network/Keras+-+Tutorial+-+Happy+House+v2.ipynb | mit | import numpy as np
from keras import layers
from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D
from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D
from keras.models import Model
from keras.preprocessing import im... |
cdawei/digbeta | dchen/tour/pruned_data.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import os, pickle, random
import pandas as pd
import numpy as np
import cvxopt
random.seed(1234554321)
np.random.seed(123456789)
cvxopt.base.setseed(123456789)
"""
Explanation: Experiment on Pruned Data
Pruning a real dataset such as there is only one trajectory for ... |
piscataway/datascience | lab/04 Regularization-v2.ipynb | mit | %pylab inline
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.cross_validation import train_test_split
try:
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
except ImportError:
# use ba... |
minxuancao/shogun | doc/ipython-notebooks/logdet/logdet.ipynb | gpl-3.0 | %matplotlib inline
from scipy.sparse import eye
from scipy.io import mmread
from matplotlib import pyplot as plt
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
matFile=os.path.join(SHOGUN_DATA_DIR, 'logdet/apache2.mtx.gz')
M = mmread(matFile)
rows = M.shape[0]
cols = M.shape[1]
A = M + eye(row... |
Olsthoorn/IHE-python-course-2017 | exercises/Feb21/py_exploratory_comp_1_20170221.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
aList = ['a', 'quark', 'flies', 'in', 'this', 'room', 'at', 3, 'oclock']
# print("{} {} {} {} {} {} {} {} {}".format(1,2,'three',4,5,6,6, 7, 8, 9)) # (aList))
print("{} {} {} {} {} {} {} {} {}".format(*aList))
plt.legend?
import numpy as np # funct... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-hr5/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-hr5', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-HR5
Topic: Aerosol
Sub-Topics: Transport, Emissions,... |
mne-tools/mne-tools.github.io | stable/_downloads/3bb9354e99617f5fdf32e50748fc566d/15_inplace.ipynb | bsd-3-clause | import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
# the preload flag loads the data into memory now
raw = mne.io.read_raw_fif(sample_data_raw_file, preload=True)... |
zipeiyang/liupengyuan.github.io | chapter1/homework/localization/3-22/201611680181_作业3.22.ipynb | mit | name=input('请输入你的名字')
print(name)
date=float(input('请输入你的生日'))
if 1.19<date<2.19:
print('你是水瓶座')
elif 2.18<date<3.21:
print('你是双鱼座')
elif 3.20<date<4.20:
print('你是白羊座')
elif 4.19<date<5.21:
print('你是金牛座')
elif 5.20<date<6.22:
print('你是双子座')
elif 6.21<date<7.23:
print('你是巨蟹座')
elif 7.22<date<8.23... |
infilect/ml-course1 | keras-notebooks/ANN/1.1 Introduction - Deep Learning and ANN.ipynb | mit | # Import the required packages
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy
# Display plots in notebook
%matplotlib inline
# Define plot's default figure size
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
#read the datasets
train = pd.read_csv("../data/i... |
InsightSoftwareConsortium/ITKExamples | src/Numerics/Optimizers/ExhaustiveOptimizer/PlotExhaustiveOptimizer.ipynb | apache-2.0 | import os
import sys
import itertools
from math import pi, sin, cos, sqrt
from urllib.request import urlretrieve
import matplotlib.pyplot as plt
import numpy as np
import itk
from itkwidgets import view, compare, checkerboard, cm
module_path = os.path.abspath(os.path.join('.'))
if module_path not in sys.path:
s... |
anonyXmous/CapstoneProject | pyspark.ipynb | unlicense | %pylab inline
import pandas as pd
import seaborn as sns
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
"""
Explanation: MapReduce using SPARK
End of explanation
"""
import findspark
findspark.init('c:\spark')
import pyspark
sc = pyspark.SparkContext()
sc
sc.parallelize([1, 2, 3, 4, ... |
mne-tools/mne-tools.github.io | stable/_downloads/2455121b46e43615a45b660a36d0ad93/30_epochs_metadata.ipynb | bsd-3-clause | import os
import numpy as np
import pandas as pd
import mne
kiloword_data_folder = mne.datasets.kiloword.data_path()
kiloword_data_file = os.path.join(kiloword_data_folder,
'kword_metadata-epo.fif')
epochs = mne.read_epochs(kiloword_data_file)
"""
Explanation: Working with Epoch meta... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_custom_image_classification_online_custom_training_container.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: Custom training image classification model for online prediction with custom traini... |
tjwei/HackNTU_Data_2017 | Week11/DIY_AI/FeedForward-Forward Propagation.ipynb | mit | # 參考答案
%run solutions/ff_oneline.py
"""
Explanation: Feedforward Network
一樣有輸入 x, 輸出 y。 但是中間預測、計算的樣子有點不同。
<img src="https://upload.wikimedia.org/wikipedia/en/5/54/Feed_forward_neural_net.gif" />
模型是這樣的
一樣考慮輸入是四維向量,輸出有 3 個類別。
我們的輸入 $x=\begin{pmatrix} x_0 \ x_1 \ x_2 \ x_3 \end{pmatrix} $ 是一個向量,我們看成 column vector 好了
第 ... |
seifip/udacity-deep-learning-nanodegree | !P4 - Language Translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
dtamayo/rebound | ipython_examples/UniquelyIdentifyingParticlesWithHashes.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1., hash=999)
sim.add(a=0.4, hash="mercury")
sim.add(a=1., hash="earth")
sim.add(a=5., hash="jupiter")
"""
Explanation: Uniquely Identifying Particles With Hashes
In many cases, one can just identify particles by their position in the particle array, e.g. using sim.p... |
deepmind/reverb | examples/frame_stacking.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... |
caisq/tensorflow | tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb | apache-2.0 | from __future__ import absolute_import, division, print_function
# Import TensorFlow >= 1.9 and enable eager execution
import tensorflow as tf
tf.enable_eager_execution()
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import unicodedata
import re
import numpy as np
import os
im... |
AccelAI/AI-DL-Enthusiasts-Meetup | Deep-Learning-Book-Review/Linear_Algebra_with_Python_and_NumPy.ipynb | mit | # First, we need to import the package NumPy, which is the library enabling all the fun with algebraic structures.
from numpy import *
"""
Explanation: Linear Algebra with Python and NumPy
End of explanation
"""
z = 3 + 4j # Define complex number z
print('z =', z)
print('Re(z) =', real(... |
spatialaudio/nbsphinx | doc/code-cells.ipynb | mit |
# 2 empty lines before, 1 after
"""
Explanation: This notebook is part of the nbsphinx documentation: https://nbsphinx.readthedocs.io/.
Code Cells
Code, Output, Streams
An empty code cell:
Two empty lines:
Leading/trailing empty lines:
End of explanation
"""
6 * 7
"""
Explanation: A simple output:
End of explana... |
AllenDowney/ThinkBayes2 | examples/shuttle.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 classes from thinkbayes2
from thinkbayes2 import Pmf, Cd... |
google/applied-machine-learning-intensive | content/04_classification/02_multiclass_classification/colab.ipynb | apache-2.0 | # 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 the L... |
XENON1T/pax | examples/parse_s1_corrmap/Parse S1 xyz correction map.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
fig = plt.figure(figsize=(12, 12))
ax = fig.add_subplot(111, projection='3d')
sc = ax.scatter(data['xmid'], data['ymid'], data['zmid'],
c=data['ly'])
plt.colorbar(sc, label='Relative light yield')
plt.show()
"""
... |
ScalABM/models-library | london-stock-exchange/gode-sunder-model.ipynb | apache-2.0 | tmp_df = pd.read_json('./data/zero-intelligence/Gpi2.json', orient='records')
zi_data = tmp_df.iloc[::-1].set_index('timestamp')
zi_data.head()
zi_data.tail()
zi_data.describe()
"""
Explanation: Importing the raw JSON data
End of explanation
"""
zi_data['spread'] = zi_data.bidPrice - zi_data.askPrice
zi_data.spr... |
DOV-Vlaanderen/pydov | docs/notebooks/search_grondwatervergunningen.ipynb | mit | %matplotlib inline
import inspect, sys
import warnings; warnings.simplefilter('ignore')
# check pydov path
import pydov
"""
Explanation: Example of DOV search methods for groundwater permits (grondwatervergunningen)
Mind that the data source of groundwater permits is just a WFS. It can be accessed with simple WFS ca... |
molgor/spystats | notebooks/Spatial Model Fitting using GLS-Copy2.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps')
sys.path.append('..')
sys.path.append('../spystats')
import django
django.setup()
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
## Use the ggplot style
plt.style.use('ggplot')
import tools
"""
Explanatio... |
dxl0632/deeplearning_nd_udacity | intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
erscott/RASLseqTools | ipynb/RASLseqTools_STAR_example.ipynb | mit | import pandas as pd
import os, sys, time, random
import numpy as np
from scipy import stats
sys.path.append('../')
from RASLseqTools import *
sys.path.append('../RASLseqTools')
import RASLseqAnalysis_STAR
import seaborn
%pylab inline
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
"""
Explanation: L... |
vascotenner/holoviews | doc/Tutorials/Introduction.ipynb | bsd-3-clause | import holoviews as hv
hv.notebook_extension()
"""
Explanation: Welcome to HoloViews!
This tutorial explains the basics of how to use HoloViews to explore your data. If this is your first contact with HoloViews, you may want to start by looking at our showcase to get a good idea of what can be achieved with HoloViews.... |
vaishaksuresh/udacity_data_analyst | P0/Data_Analyst_ND_Project0.ipynb | gpl-2.0 | import pandas as pd
# pandas is a software library for data manipulation and analysis
# We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd.
# hit shift + enter to run this cell or block of code
path = r'~/Downloads/chopstick-effectiveness.csv'
# Change the path to the location w... |
oudalab/fajita | otherHelperCode/jupyter_ldacluster/lda_cluster_smallsizetest_arabic.ipynb | mit | %%time
texts = []
docIds=[]
actuallyTrained=0;
temp=0;
for i in sen.find():
if temp<1000:
temp=temp+1
try:
raw = ''.join(i['document']).lower()
tokens = tokenizer.tokenize(raw)
stopped_tokens = [i for i in tokens if not i in en_stop]
stemmed_tokens = [... |
irsisyphus/machine-learning | 5 Training and Ensemble.ipynb | apache-2.0 | # Added version check for recent scikit-learn 0.18 checks
from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
"""
Explanation: Assignment 5
This assignment has weighting $1.5$.
Model tuning and evaluation
End of explanation
"""
import pandas as pd
wdbc_source = '... |
dbkinghorn/blog-jupyter-notebooks | ML-LR-part4.ipynb | gpl-3.0 | import pandas as pd # data handeling
import numpy as np # numeriacal computing
import matplotlib.pyplot as plt # plotting core
import seaborn as sns # higher level plotting tools
%matplotlib inline
sns.set()
# simple function to demo step size
def f(x) : # A parabola
f = x**2
return f
def Df(x) : # The de... |
AllenDowney/ThinkBayes2 | workshop/workshop01soln.ipynb | mit | from __future__ import print_function, division
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
from thinkbayes2 import Pmf, Suite
import thinkplot
"""
Explanation: Bayesian Statistics Made Simple
Code and exercises from my workshop on Bayesian statistics in Python.
Copyright 2016 Allen Downey
... |
xpharry/Udacity-DLFoudation | tutorials/dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
aaossa/Dear-Notebooks | GitHub/UsingAPI_ES.ipynb | gpl-3.0 | # Primero tenemos que importar las librerias que usaremos
import base64
import json
import requests
# Si queremos imprimir los json de respuesta
# de una forma mas agradable a la vista podemos usar
def print_pretty(jsonstring, indent=4, sort_keys=False):
print(json.dumps(jsonstring, indent=indent, sort_keys=sort_... |
tpin3694/tpin3694.github.io | machine-learning/feature_selection_using_random_forest.ipynb | mit | import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.feature_selection import SelectFromModel
from sklearn.metrics import accuracy_score
"""
Explanation: Title: Feature Selection Using Random Forest
Slug: f... |
FCH808/FCH808.github.io | Data Wrangling with MongoDB/Project/Data Wrangling with MongoDB - Write-up.ipynb | mit | for st_type, ways in abq_st_types.iteritems():
for name in ways:
better_name = update_name(name, mapping)
if name != better_name:
print name, "=>", better_name
Honolulu:
Kalakaua Ave => Kalakaua Avenue
Lusitania St. => Lusitania Street
...
Albuquerque:
Valley View Dr NW => Valley View ... |
snegirigens/DLND | intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
sueiras/training | caffe/Instant_Recognition_with_Caffe.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Make sure that caffe is on the python path:
caffe_root = '/home/ubuntu/digits/caffe/' # 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,... |
therealAJ/python-sandbox | data-science/learning/ud1/DataScience/Outliers.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
incomes = np.random.normal(27000, 15000, 10000)
incomes = np.append(incomes, [1000000000])
import matplotlib.pyplot as plt
plt.hist(incomes, 50)
plt.show()
"""
Explanation: Dealing with Outliers
Sometimes outliers can mess up an analysis; you usually don't want a handful of data... |
NZRS/content-analysis | .ipynb_checkpoints/Content Analysis-checkpoint.ipynb | agpl-3.0 | %matplotlib inline
import pickle
import plotly.plotly as py
from plotly.graph_objs import *
# module from NZRS
import content_stats
from IPython.core.display import Image
from urllib2 import quote
from IPython.display import display
import plotly.tools as tls
from IPython.display import HTML
from collections import Cou... |
GoogleCloudPlatform/mlops-on-gcp | workshops/kfp-caip-sklearn/lab-01-caip-containers/exercises/lab-01.ipynb | apache-2.0 | import json
import os
import numpy as np
import pandas as pd
import pickle
import uuid
import time
import tempfile
from googleapiclient import discovery
from googleapiclient import errors
from google.cloud import bigquery
from jinja2 import Template
from kfp.components import func_to_container_op
from typing import N... |
AllenDowney/ThinkBayes2 | examples/btp01soln.ipynb | mit | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from thinkbayes2 import Hist, Pmf, Cdf, Suite, Beta
import thinkplot
"""
Explanation: Bayes Theorem Problems
This notebook presents code and exercises from Think Bayes, second edi... |
pachyderm/pfs | etc/testing/introspect/introspect.ipynb | apache-2.0 | import pandas as pd
df = pd.DataFrame.from_dict(results)
# Transpose
df = df.T
# NaN -> 0
df = df.fillna(0)
df['pass_rate'] = df['success'] / (df['failed'] + df['success'])
# sort by failed
df = df.sort_values(by=["pass_rate"])
df
"""
Explanation: Finding flakiest test suites
The following produces a table of tes... |
dnc1994/MachineLearning-UW | ml-classification/blank/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... |
obscode/bootcamp | Visualization.ipynb | mit | import numpy as np
import pandas as pd
from astropy.io import ascii
"""
Explanation: Visualization
In this tutorial we're going to learn how to:
- Read in data tables (the easy way!)
- Select different samples from the data set
- Make figures to visualize the data
Reading in data
Often, you will be given data in the f... |
DigitalSlideArchive/HistomicsTK | docs/examples/creating_gallery_images_review.ipynb | apache-2.0 | import os
import tempfile
import shutil
from imageio import imread
from pandas import read_csv
import girder_client
from histomicstk.annotations_and_masks.review_gallery import \
get_all_rois_from_folder_v2, get_all_rois_from_slide_v2, \
_plot_rapid_review_vis, create_review_galleries
import matplotlib.pylab a... |
tpin3694/tpin3694.github.io | python/generate_tweets_using_markov_chain.ipynb | mit | import markovify
"""
Explanation: Title: Generate Tweets Using Markov Chains
Slug: generate_tweets_using_markov_chain
Summary: Generate Tweets Using Markov Chains
Date: 2016-11-01 12:00
Category: Python
Tags: Other
Authors: Chris Albon
Preliminaries
End of explanation
"""
# Get raw text as string
with open("brown... |
UCSBarchlab/PyRTL | ipynb-examples/example1-combologic.ipynb | bsd-3-clause | import random
import pyrtl
pyrtl.reset_working_block()
"""
Explanation: Example 1: A simple combination logic block example.
This example declares a block of hardware with three one-bit inputs,
(a,b,c) and two one-bit outputs (sum, cout). The logic declared is a
simple one-bit adder and the definition uses some of ... |
leriomaggio/numpy_euroscipy2015 | 05_memmapping.ipynb | mit | import numpy as np
# Let's create a Memory-Mapped Array in write mode
nrows, ncols = 1000000, 100
f = np.memmap('memmapped.dat', dtype=np.float32, mode='w+', shape=(nrows, ncols))
"""
Explanation: Processing large NumPy arrays with memory mapping
Reference: IPython Interactive Computing and Visualization Cookbook - ... |
rsignell-usgs/python-training | web-services/02-create_map.ipynb | cc0-1.0 | import os
try:
import cPickle as pickle
except ImportError:
import pickle
run_name = '2015-08-17'
fname = os.path.join(run_name, 'config.pkl')
with open(fname, 'rb') as f:
config = pickle.load(f)
"""
Explanation: <img style='float: left' width="150px" src="http://bostonlightswim.org/wp/wp-content/uploads... |
YangDS/recommenders | notebooks/Example 1 Content-based Recommender with TF-IDF.ipynb | gpl-3.0 | import glob
corpus = []
for file in glob.glob("data/papers/*.txt"):
with open(file, "r") as paper:
corpus.append((file, paper.read()))
"""
Explanation: Content-based Recommender
Another Example: scikit-learn: TF/IDF and cosine similarity for computer science papers
Computer Science Papers
Task: Finding ... |
1iyiwei/pyml | code/ch08/ch08.ipynb | mit | %load_ext watermark
%watermark -a '' -u -d -v -p numpy,pandas,matplotlib,sklearn,nltk
"""
Explanation: Copyright (c) 2015, 2016 Sebastian Raschka
https://github.com/1iyiwei/pyml
MIT License
Python Machine Learning - Code Examples
Chapter 8 - Applying Machine Learning To Sentiment Analysis
Let's apply what we have lear... |
guyk1971/deep-learning | intro-to-rnns/Anna_KaRNNa_Exercises.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is bas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.