repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
twosigma/beakerx | doc/python/ChartingAPI.ipynb | apache-2.0 | from beakerx import *
import pandas as pd
tableRows = pd.read_csv('../resources/data/interest-rates.csv')
Plot(title="Title",
xLabel="Horizontal",
yLabel="Vertical",
initWidth=500,
initHeight=200)
"""
Explanation: Python API to BeakerX Interactive Plotting
You can access Beaker's native interacti... |
bioinformatica-corso/lezioni | laboratorio/lezione17-09dic21/esercizio2-biopython.ipynb | cc0-1.0 | import Bio
"""
Explanation: Biopython - Esercizio2
Prendere in input un entry in formato embl di una sequenza nucleotidica di mRNA e, senza conoscere la proteina effettivamente annotata nel file ma solo sulla base della sequenza nucleotidica del trascritto, trovare tutte le proteine di oltre 1000 amminoacidi che il tr... |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/tpu/tools/colab/Classification_Iris_data_with_Keras.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
NervanaSystems/neon_course | answers/04 Writing a custom layer-ANSWER_KEY.ipynb | apache-2.0 | import neon
print neon.__version__
# use a GPU backend
from neon.backends import gen_backend
be = gen_backend('gpu', batch_size=128)
# load data
from neon.data import MNIST
mnist = MNIST(path='../data/')
train_set = mnist.train_iter
test_set = mnist.valid_iter
"""
Explanation: Building a new layer
This notebook wil... |
aborgher/Main-useful-functions-for-ML | Python_jupyter_utilities/pyHDF5.ipynb | gpl-3.0 | import h5py
import numpy as np
!rm mytestfile.hdf5
# create a new hdf5 file
f = h5py.File("mytestfile.hdf5", "w")
f.filename, f.name
"""
Explanation: h5py package to create HDF5 file
Link: http://docs.h5py.org/en/latest/mpi.html
An HDF5 file is a container for two kinds of objects:
- datasets, which are array-like... |
romil93/SentimentAnalysis-CSCI544-Fall2016 | romil/logistic_regression-with-imdb.ipynb | apache-2.0 | test_data_df.head()
"""
Explanation: And the test data.
End of explanation
"""
train_data_df.Sentiment.value_counts()
"""
Explanation: Let's count how many labels do we have for each sentiment class.
End of explanation
"""
import numpy as np
np.mean([len(s.split(" ")) for s in train_data_df.Text])
"""
Explana... |
intel-analytics/BigDL | python/nano/notebooks/pytorch/cifar10/nano-trainer-example.ipynb | apache-2.0 | from time import time
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from pl_bolts.datamodules import CIFAR10DataModule
from pl_bolts.transforms.dataset_normalizations import cifar10_normalization
from pytorch_lightning import LightningModule, seed_everything
from pytor... |
toddstrader/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
tensorflow/docs | site/en/r1/tutorials/distribute/training_loops.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... |
tensorflow/docs-l10n | site/zh-cn/agents/tutorials/2_environments_tutorial.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... |
Capepy/scipy_2015_sklearn_tutorial | notebooks/05.1 In Depth - Linear Models.ipynb | cc0-1.0 | rng = np.random.RandomState(4)
X = rng.normal(size=(1000, 50))
beta = rng.normal(size=50)
y = np.dot(X, beta) + 4 * rng.normal(size=1000)
from sklearn.utils import shuffle
X, y = shuffle(X, y)
from sklearn import linear_model, cross_validation
from sklearn.learning_curve import learning_curve
def plot_learning_curve... |
ragavvenkatesan/Convolutional-Neural-Networks | pantry/tutorials/notebooks/Multi-layer Neural Network.ipynb | mit | from yann.network import network
from yann.special.datasets import cook_mnist
data = cook_mnist()
dataset_params = { "dataset": data.dataset_location(), "id": 'mnist', "n_classes" : 10 }
net = network()
net.add_layer(type = "input", id ="input", dataset_init_args = dataset_params)
"""
Explanation: Multi-layer Neura... |
miroli/veclib | Playground.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from IPython.display import display_png
%matplotlib inline
plt.style.use('seaborn-whitegrid')
"""
Explanation: VecLib
A Python library for playing with and visualizing vectors in Jupyter notebooks. For personal learning purposes... |
gench/rec2 | RecipeRecommender_ZulkufGenc.ipynb | gpl-3.0 | import json
import numpy as np
from numpy import ma
import io
import re
import itertools
import random
from bokeh.charts import Histogram
import networkx as nx
from nltk.stem import WordNetLemmatizer
wnl = WordNetLemmatizer()
from sklearn.feature_extraction import DictVectorizer
from collections import Counter
from sk... |
xaibeing/cn-deep-learning | tutorials/intro-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
sueiras/training | tensorflow_old/03-text_use_cases/02_sentiment_model/01_Model6_CNN.ipynb | gpl-3.0 | #Imports
from __future__ import print_function
import numpy as np
import tensorflow as tf
print(tf.__version__)
data_path='/home/ubuntu/data/training/keras/aclImdb/'
"""
Explanation: Sentiment model with CNNs
Use Convolutions to create a sentiment model.
Based on: http://www.wildml.com/2015/12/implementing-a-cnn... |
NathanYee/ThinkBayes2 | code/chap05.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from thinkbayes2 import Pmf, Cdf, Suite, Beta
import thinkplot
"""
Explanation: Think Bayes: Chapter 5
This notebook presents code and exercises from Think Bayes, second edition.
... |
rkastilani/PowerOutagePredictor | PowerOutagePredictor/Tree/TreeClassifier_Example.ipynb | mit | df = pd.DataFrame()
weather = df.append({"Day_length_hr": 11,
"Avg_Temp_F": 38,
"Avg_humidity_percent": 85,
"Max_windspeed_mph": 16,
"Avg_windspeed_mph": 7,
"Max_windgust_mph": 20,
"Precipitation_in": 0.33},
... |
vvolkl/kalman-samples | constant_velocity.ipynb | gpl-2.0 | # allow use of python3 syntax
from __future__ import division, print_function, absolute_import
import numpy as np
# local script with often used
import kalman as k
# contents of local file kalman.py
# %load kalman.py
import numpy as np
import matplotlib.pyplot as plt
def kalman_predict( A, # transition matrix
... |
jdhp-docs/python-notebooks | opendata_observatoires_des_loyers_fr.ipynb | mit | %matplotlib inline
#%matplotlib notebook
import matplotlib
matplotlib.rcParams['figure.figsize'] = (9, 9)
import pandas as pd
url = "https://www.data.gouv.fr/fr/datasets/r/1fee314d-c278-424f-a029-a74d877eb185"
df2016 = pd.read_csv(url,
encoding='iso-8859-1',
sep=';',
... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_ica_from_raw.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne.preprocessing import ICA
from mne.preprocessing import create_ecg_epochs, create_eog_epochs
from mne.datasets import sample
"... |
eggie5/UCSD-MAS-DSE220 | hmwk1/Hmwk 1.ipynb | mit | import pandas as pd
%pylab inline
"""
Explanation: Hmwk #1
End of explanation
"""
df = pd.read_csv("weather.csv", header=0, index_col=0)
df
"""
Explanation: Represent the following table using a data structure of your choice
End of explanation
"""
mean_temp = df["temperature"].mean()
mean_temp
mean_humidity = df... |
FlyRanch/figurefirst | examples/regenerate/regenerate_notebook.ipynb | mit | import numpy as np
import figurefirst
fifi = figurefirst
from IPython.display import display,SVG,Markdown
layout = fifi.FigureLayout('figure_template.svg', hide_layers=['template'])
layout.make_mplfigures(hide=True)
"""
Explanation: Saving figure source data
Many scientific journals are (for good reason) requiring th... |
pysg/pyther | Modelo de impregnacion/modelo2/Activité 10_1.ipynb | mit | import numpy as np
from scipy import integrate
from matplotlib.pylab import *
def tank(t, y):
"""
Dynamic balance for a CSTR
C_A = y[0] = the concentration of A in the tank, mol/L
Returns dy/dt = F/V*(C_{A,in} - C_A) - k*C_A^2
"""
F = 20.1 # L/min
CA_in = 2.5 # mol/L
V = 100 ... |
mbakker7/ttim | pumpingtest_benchmarks/13_multiwell_slug_test-.ipynb | mit | %matplotlib inline
from ttim import *
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
"""
Explanation: Slug Test for Confined Aquifer
This test is taken from examples of AQTESOLV.
End of explanation
"""
H0 = 2.798 #initial displacement in m
b = -6.1 #aquifer thickness
rw1 = 0.102 #well radius ... |
flohorovicic/pynoddy | docs/notebooks/3-Events-Copy1.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
%matplotlib inline
"""
Explanation: Geological events in pynoddy: organisation and adpatiation
We will here describe how the single geological events of a Noddy history are organised within pynoddy. We will then evaluate i... |
mne-tools/mne-tools.github.io | 0.20/_downloads/f760cc2f1a5d6c625b1e14a0b05176dd/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
import mne
from mne.viz import plot_alignment, snapshot_brain_montage
print(__doc__)
"""
Explanation: Working w... |
max-ionov/rucoref | notebooks/singletons.ipynb | lgpl-3.0 | %cd '/Users/max/Projects/Coreference/'
%cd 'rucoref'
from anaphoralib.corpora import rueval
from anaphoralib.tagsets import multeast
from anaphoralib.experiments.base import BaseClassifier
from anaphoralib import utils
from anaphoralib.experiments import utils as exp_utils
%cd '..'
from sklearn.ensemble import Random... |
martinjrobins/hobo | examples/sampling/transformed-parameters.ipynb | bsd-3-clause | import pints
import pints.toy as toy
import pints.plot
import numpy as np
import matplotlib.pyplot as plt
# Set some random seed so this notebook can be reproduced
np.random.seed(10)
# Load a forward model
model = toy.LogisticModel()
"""
Explanation: Sampling from a transformed parameter space
This example shows you... |
Fifth-Cohort-Awesome/NightThree | Three_RSH.ipynb | mit | import csv
datafile = open('/Users/kra7830/Desktop/MSDS_School/Info_Structures/dev/NightThree/tmdb_5000_movies.csv', 'r')
myreader = csv.reader(datafile)
#for i in myreader:
#print i
##### This prints lots of texts
import pandas as pd
# Read the CSV into a pandas data frame (df)
df = pd.read_csv('/Users/kr... |
tmaila/autopilot | autopilot.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from IPython.display import display # Allows the use of display() for DataFrames
%matplotlib inline
# Import run log from CSV file
try:
# Python log file
df_py = pd.DataFrame.from_csv('results/run.py.csv')
except:
print... |
dennys-bd/Coursera-Machine-Learning-Specialization | Course 2 - ML, Regression/Overfitting_Demo_Ridge_Lasso.ipynb | mit | import graphlab
import math
import random
import numpy
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Overfitting demo
Create a dataset based on a true sinusoidal relationship
Let's look at a synthetic dataset consisting of 30 points drawn from the sinusoid $y = \sin(4x)$:
End of explanation
... |
boffi/boffi.github.io | dati_2015/ha03/06_3_DOF_System.ipynb | mit | bm = [[p(( 1, 0)), p(( 1, 1)), p(( 1, 2)), p(( 3, 0)), p(( 0, 0))],
[p(( 0, 0)), p(( 0, 0)), p(( 1, 0)), p(( 1, 0)), p(( 0, 0))],
[p(( 0, 0)), p(( 0,-1)), p(( 0,-1)), p((-1, 0)), p((-1, 0))]]
"""
Explanation: 3 DOF System
<img src="bending.svg" style="width:100%">
In the figure above
<ol type='a'>
<li> th... |
twosigma/beaker-notebook | doc/python/TableAPI.ipynb | apache-2.0 | import pandas as pd
from beakerx import *
from beakerx.object import beakerx
pd.read_csv('../resources/data/interest-rates.csv')
table = TableDisplay(pd.read_csv('../resources/data/interest-rates.csv'))
table.setAlignmentProviderForColumn('m3', TableDisplayAlignmentProvider.CENTER_ALIGNMENT)
table.setRendererForColum... |
patrickmineault/xcorr-notebooks | notebooks/Paired-sampling.ipynb | mit | %config InlineBackend.figure_format = 'retina'
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import plotnine
import seaborn as sns
sns.set(style="darkgrid")
class LNP:
"""A simple LNP model neuron."""
def __init__(self):
rg = np.arange(-31.5, 32.5)
self.w = np.cos(rg ... |
EtienneCmb/brainpipe | examples/f_Leave_p-subjects_out.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
# u can use %matplotlib notebook, but there is some bugs with xticks and title
from brainpipe.classification import *
from brainpipe.visual import *
"""
Explanation: This notebook illustrate how to permform a Leav... |
xtr33me/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... |
SSDS-Croatia/SSDS-2017 | Day-1/First day - Introduction to Machine Learning with Tensorflow.ipynb | mit | import tensorflow as tf
"""
Explanation: Summer School of Data Science - Split '17
1. Introduction to Machine Learning with TensorFlow
This hands-on session serves as an introductory course for essential TensorFlow usage and basic machine learning with TensorFlow. This notebook is partly based on and follow the approa... |
albertfxwang/grizli | examples/Grizli Demo.ipynb | mit | flt = grizli.model.GrismFLT(grism_file='ibhj34h8q_flt.fits', direct_file='ibhj34h6q_flt.fits',
pad=200, ref_file=None, ref_ext=0, seg_file=None, shrink_segimage=False)
"""
Explanation: Initialize the GrismFLT object
The GrismFLT object takes as input grism FLT files and optionally direct im... |
UWashington-Astro300/Astro300-W17 | Intro_to_OO.ipynb | mit | import numpy as np
from astropy import units as u
class SpaceRock(object):
def __init__(self, name=None, ab_mag=None, albedo=None):
self.name = name
self.ab_mag = ab_mag
self.albedo = albedo
# Create some fake data:
name = "Geralt of Rivia"
ab_mag = 5.13
albedo = 0.131
# Ini... |
dostrebel/working_place_ds_17 | 04 modules, requests/02 module - homework.ipynb | mit | import requests
import pandas as pd
"""
Explanation: Modules, Requests und arbeiten mit APIs
0. Importiere die Module requests und pandas, die verwenden würdest
End of explanation
"""
http://rpc.geocoder.us/service
http://api.nytimes.com/svc/search/v1
http://www.openhazards.com/data/GetEarthquakeProbability
http://p... |
minesh1291/Practicing-Kaggle | MNIST_2017/dump_/women_2018_gridsearchCV.ipynb | gpl-3.0 | #the seed information
df_seeds = pd.read_csv('../input/WNCAATourneySeeds_SampleTourney2018.csv')
#tour information
df_tour = pd.read_csv('../input/WRegularSeasonCompactResults_PrelimData2018.csv')
"""
Explanation: First we import some datasets of interest
End of explanation
"""
df_seeds['seed_int'] = df_seeds['Seed... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/GUI/4 - Widget List.ipynb | apache-2.0 | import ipywidgets as widgets
# Show all available widgets!
widgets.Widget.widget_types.values()
"""
Explanation: Widget List
This lecture will serve as a reference for widgets, providing a list of the GUI widgets available!
Complete list
For a complete list of the GUI widgets available to you, you can list the regist... |
yingchi/fastai-notes | deeplearning1/nbs/mnist_yingchi.ipynb | apache-2.0 | from theano.sandbox import cuda
cuda.use('gpu1')
%matplotlib inline
from importlib import reload
import utils; reload(utils)
from utils import *
from __future__ import division, print_function
"""
Explanation: Model Building for MNIST
End of explanation
"""
batch_size = 64
from keras.datasets import mnist
(X_train,... |
cliburn/sta-663-2017 | homework/01_Functions_Loops_Branching_Solutions.ipynb | mit | scores = [ 84, 76, 67, 23, 83, 23, 50, 100, 32, 84, 22, 41, 27,
29, 71, 85, 47, 77, 39, 25, 85, 69, 22, 66, 100, 92,
97, 46, 81, 88, 67, 20, 52, 62, 39, 36, 79, 54, 74,
64, 33, 68, 85, 69, 84, 30, 68, 100, 71, 33, 21, 95,
92, 72, 53, 50, 3... |
kkkddder/dmc | notebooks/week-6/02-using a pre-trained model with Keras.ipynb | apache-2.0 | import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
import sys
import re
import pickle
"""
Explanation: Lab 6.2 - Using a pre-trained model with... |
ellisztamas/faps | docs/tutorials/.ipynb_checkpoints/08_data_cleaning_in_Amajus-checkpoint.ipynb | mit | import numpy as np
from pandas import DataFrame as df
import faps as fp
import matplotlib.pyplot as plt
%pylab inline
print("Created using FAPS version {}.".format(fp.__version__))
"""
Explanation: Data cleaning for Antirrhinum majus data set from 2012
End of explanation
"""
progeny = fp.read_genotypes('../../data/... |
LucaCanali/Miscellaneous | Spark_Physics/Dimuon_mass_spectrum/Dimuon_mass_spectrum_histogram_Spark_DataFrame_Colab_version.ipynb | apache-2.0 | # Run this if you need to install Apache Spark (PySpark)
! pip install pyspark
# install sparkhistogram
! pip install sparkhistogram
"""
Explanation: Histogram of the Dimuon Mass Spectrum
This implements the dimuon mass spectrum analysis, a "Hello World!" example for data analysis in High Energy Physics. It is inte... |
CAChemE/curso-python-datos | notebooks_vacios/060-ScikitLearn-Intro.ipynb | bsd-3-clause | # X_train, X_test, Y_train, Y_test =
# preserve
X_train.shape, Y_train.shape
# preserve
X_test.shape, Y_test.shape
"""
Explanation: Introducción al aprendizaje automático con scikit-learn
En los últimos tiempos habrás oído hablar de machine learning, deep learning, reinforcement learning, muchas más cosas que contie... |
dracolytch/ml-agents | python/PPO.ipynb | apache-2.0 | import numpy as np
import os
import tensorflow as tf
from ppo.history import *
from ppo.models import *
from ppo.trainer import Trainer
from unityagents import *
"""
Explanation: Unity ML Agents
Proximal Policy Optimization (PPO)
Contains an implementation of PPO as described here.
End of explanation
"""
### Genera... |
google/starthinker | colabs/dbm_to_bigquery.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: DV360 Report To BigQuery
Move existing DV360 reports into a BigQuery table.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... |
oresat/oresat-ground-station | eb-ground-station/structure/weather-station-augmented-design/loadAnalysis.ipynb | gpl-3.0 | import numpy as np
import sys
import matplotlib.pyplot as plt
import sympy as sym
import pandas as pd
import magnitude as mag
from magnitude import mg
mag.new_mag('lbm', mag.Magnitude(0.45359237, kg=1))
mag.new_mag('lbf', mg(4.4482216152605, 'N'))
mag.new_mag('mph', mg(0.44704, 'm/s'))
from IPython.display import displ... |
fastai/course-v3 | nbs/dl2/translation.ipynb | apache-2.0 | path = Config().data_path()/'giga-fren'
"""
Explanation: Reduce original dataset to questions
End of explanation
"""
#! wget https://s3.amazonaws.com/fast-ai-nlp/giga-fren.tgz -P {path}
#! tar xf {path}/giga-fren.tgz -C {path}
# with open(path/'giga-fren.release2.fixed.fr') as f:
# fr = f.read().split('\n')
# ... |
xboard/xboard.github.io | ipynb/IDH-Longevity.ipynb | mpl-2.0 | %matplotlib inline
import pandas as pd
import requests as req
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind, ttest_rel
from scipy.stats import gaussian_kde
from statsmodels.formula.api import ols, mixedlm, gee
from statsmodels.stats.outliers_influence import ... |
tschinz/iPython_Workspace | 01_Mine/MachineLearning/tensorflow-examples_nb/0_Prerequisite/mnist_dataset_intro.ipynb | gpl-2.0 | # Import MNIST
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
# Load data
X_train = mnist.train.images
Y_train = mnist.train.labels
X_test = mnist.test.images
Y_test = mnist.test.labels
"""
Explanation: MNIST Dataset Introduction
Most examples ... |
scikit-optimize/scikit-optimize.github.io | 0.8/notebooks/auto_examples/sampler/initial-sampling-method.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
from skopt.space import Space
from skopt.sampler import Sobol
from skopt.sampler import Lhs
from skopt.sampler import Halton
from skopt.sampler import Hammersly
from skopt.sampler import Grid
from scipy.spatial.distance import pdist
... |
jhillairet/scikit-rf | doc/source/tutorials/Connecting_Networks.ipynb | bsd-3-clause | import skrf as rf
"""
Explanation: Connecting Networks
scikit-rf supports the connection of arbitrary ports of N-port networks. It accomplishes this using an algorithm called sub-network growth[1], available through the function connect(). Note that this function takes into account port impedances. If two connected po... |
deepchem/deepchem | examples/tutorials/The_Basic_Tools_of_the_Deep_Life_Sciences.ipynb | mit | !pip install --pre deepchem[tensorflow]
"""
Explanation: The Basic Tools of the Deep Life Sciences
Welcome to DeepChem's introductory tutorial for the deep life sciences. This series of notebooks is a step-by-step guide for you to get to know the new tools and techniques needed to do deep learning for the life science... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/segmentation/Kaggle TGS Salt Identification Challenge/keras top solution.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import gc
import keras
import matplotlib.pyplot as plt
plt.style.use('seaborn-white')
import seaborn as sns
sns.set_style("white")
from sklearn.model_selection import train_test_split
from skimage.transform import resize
import tensorflow as tf
import keras.backend as K
from ke... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Machine Learning/ml-training-intro/notebooks/01 - Introduction to Scikit-learn.ipynb | gpl-3.0 | from sklearn.svm import LinearSVC
"""
Explanation: Really Simple API
0) Import your model class
End of explanation
"""
svm = LinearSVC()
"""
Explanation: 1) Instantiate an object and set the parameters
End of explanation
"""
svm.fit(X_train, y_train)
"""
Explanation: 2) Fit the model
End of explanation
"""
pri... |
ajkavanagh/pyne-sqlalchemy-2015-04 | notebook/Reflection.ipynb | gpl-3.0 | from sqlalchemy import create_engine
engine = create_engine('sqlite:////vagrant/utils/db.sqlite')
from sqlalchemy import Table, Column, MetaData
metadata = MetaData()
connection = engine.connect()
user_table = Table('user', metadata, autoload=True, autoload_with=connection)
purchase_table = Table('purchase', metadata... |
WNoxchi/Kaukasos | FAI_old/lesson1/Lesson1_recode.ipynb | mit | %matplotlib inline
from __future__ import division, print_function
import os, sys, json
# import keras as K
# os.environ['KERAS_BACKEND'] = 'theano'
sys.path.insert(1, os.path.join('../utils/'))
import utils; from utils import plots
import glob as glob
import numpy as np
np.set_printoptions(precision=4, linewidth=100)... |
jadelord/TomoKTH | examples/Tutorial_01-Image_loading.ipynb | gpl-3.0 | arr = io.imread('0mm_cam0.tif')
print 'Image has been loaded as a 2d numpy array with ', arr.shape, 'rows and columns. Datatype =', arr.dtype
"""
Explanation: Reading images into array
End of explanation
"""
io.implot('0mm_cam0.tif')
cd ../particle_images/
"""
Explanation: Plotting images
End of explanation
"""
... |
a-pagano/BigDive5 | DataScience/Day4_MongoDB.ipynb | mit | from pymongo import MongoClient
client = MongoClient('mongodb://localhost:27017/')
db = client.phonebook
print db.collection_names()
"""
Explanation: MongoDB
Schema Free
Document Based
Supports Indexing
Not Transactional
Does not support relations (no JOIN)
Supports Autosharding
Automatic Replication and Failover
Re... |
Qumulo/python-notebooks | notebooks/Auto provision a new user.ipynb | gpl-3.0 | cluster = 'XXXXX' # Qumulo cluster hostname or IP where you're setting up users
api_user = 'XXXXX' # Qumulo api user name
api_password = 'XXXXX' # Qumulo api password
base_dir = 'XXXXX' # the parent path where the users will be created.
user_name = 'XXXXX' # the new "user" to set up.
import os
import sys
impor... |
PMEAL/OpenPNM | examples/reference/uncategorized/the_problem_with_domain_length_and_area.ipynb | mit | import matplotlib.pyplot as plt
import openpnm as op
%config InlineBackend.figure_formats = ['svg']
import numpy as np
np.random.seed(10)
pn = op.network.Cubic(shape=[4, 4, 1])
"""
Explanation: Problem with Domain Area and Length
In order to find network properties such as permeability using Darcy's law, it is necessa... |
robertoalotufo/ia898 | deliver/Atividade_2_3.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import sys,os
ia898path = os.path.abspath('../../')
if ia898path not in sys.path:
sys.path.append(ia898path)
import ia898.src as ia
!ls -l ../../ia898/data
f = mpimg.imread('../data/retina.tif')
plt.imshow(... |
SnowMasaya/Chainer-with-Neural-Networks-Language-model-Hands-on-Advance | .ipynb_checkpoints/chainer-natual-language-processing-checkpoint.ipynb | mit | import time
import math
import sys
import pickle
import copy
import os
import re
import numpy as np
from chainer import cuda, Variable, FunctionSet, optimizers
import chainer.functions as F
"""
Explanation: Introduction GPU
Chainer とはニューラルネットの実装を簡単にしたフレームワークです。
今回は言語の分野でニューラルネットを適用してみました。
今回は言語モデルを作成していただきます。
言語... |
samuelshaner/openmc | docs/source/pythonapi/examples/pandas-dataframes.ipynb | mit | %matplotlib inline
import glob
from IPython.display import Image
import matplotlib.pyplot as plt
import scipy.stats
import numpy as np
import pandas as pd
import openmc
"""
Explanation: This notebook demonstrates how systematic analysis of tally scores is possible using Pandas dataframes. A dataframe can be automati... |
manoharan-lab/structural-color | bulk_polydispersity_tutorial.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import time
import structcol as sc
import structcol.refractive_index as ri
from structcol import montecarlo as mc
from structcol import detector as det
from structcol import phase_func_sphere as pfs
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.misc import factor... |
bbfamily/abu | abupy_lecture/5-选股策略的开发(ABU量化使用文档).ipynb | gpl-3.0 | from __future__ import print_function
from __future__ import division
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import os
import sys
# 使用insert 0即只使用github,避免交叉使用了pip安装的abupy,导致的版本不一致问题
s... |
jch1/models | slim/slim_walkthrough.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
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
from tensorflow.c... |
mne-tools/mne-tools.github.io | 0.17/_downloads/e52b6a53120d8703a6509530cf6251dc/plot_roi_erpimage_by_rt.ipynb | bsd-3-clause | # Authors: Jona Sassenhagen <jona.sassenhagen@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.event import define_target_events
from mne.channels import make_1020_channel_selections
print(__doc__)
"""
Explanation: ===========================================================
Plot single trial activity, grou... |
mismosmi/idea2birds | src/evaluate.ipynb | mit | import numpy as np
import scipy as sp
import birds
import argparse
import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib.animation import FuncAnimation
from matplotlib.collections import PathCollection
from IPython.display import HTML
from scipy.optimize import curve_fit
#%matplotlib ipympl
%... |
coursemdetw/reveal2 | content/notebook/.ipynb_checkpoints/Elements of Evolutionary Algorithms-checkpoint.ipynb | mit | import random
from deap import algorithms, base, creator, tools
creator.create("FitnessMax", base.Fitness, weights=(1.0,))
creator.create("Individual", list, fitness=creator.FitnessMax)
def evalOneMax(individual):
return (sum(individual),)
"""
Explanation: <img src='http://www.puc-rio.br/sobrepuc/admin/vrd/brasa... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/TODO/Autoencoders/denoising-autoencoder/Denoising_Autoencoder_Solution.ipynb | apache-2.0 | import torch
import numpy as np
from torchvision import datasets
import torchvision.transforms as transforms
# convert data to torch.FloatTensor
transform = transforms.ToTensor()
# load the training and test datasets
train_data = datasets.MNIST(root='data', train=True,
download=True... |
wangzexian/summrerschool2015 | debug/Debug.ipynb | bsd-3-clause | import numpy as np
import theano
import theano.tensor as T
x = T.vector()
y = T.vector()
z = x + x
z = z * y
f = theano.function([x, y], z)
f(np.ones((2,)), np.ones((3,)))
"""
Explanation: Error messages
Very important
Have lots of information in them
Take the time to read them.
If you get multiple error messages, th... |
Kaggle/learntools | notebooks/deep_learning/raw/tut4_transfer_learning.ipynb | apache-2.0 | from IPython.display import YouTubeVideo
YouTubeVideo('mPFq5KMxKVw', width=800, height=450)
"""
Explanation: Intro
At the end of this lesson, you will be able to use transfer learning to build highly accurate computer vision models for your custom purposes, even when you have relatively little data.
Lesson
End of expl... |
konstantinstadler/pymrio | doc/source/notebooks/metadata.ipynb | gpl-3.0 | import pymrio
io = pymrio.load_test()
io.meta
io.meta('Loaded the pymrio test sytem')
"""
Explanation: Metadata and change recording
Each pymrio core system object contains a field 'meta' which stores meta data as well as changes to the MRIO system. This data is stored as json file in the root of a saved MRIO data a... |
tpin3694/tpin3694.github.io | machine-learning/reshape_an_array.ipynb | mit | # Load library
import numpy as np
"""
Explanation: Title: Reshape An Array
Slug: reshape_an_array
Summary: How to reshape a NumPy array.
Date: 2017-09-04 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
Preliminaries
End of explanation
"""
# Create a 4x3 matrix
matrix = np.arr... |
james-prior/cohpy | 20160708-dojo-fibonacci-unroll-for-speed.ipynb | mit | from itertools import islice
"""
Explanation: This plays with optimizing a fibonacci generator function for speed.
Study loop unrolling.
End of explanation
"""
def fibonacci():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
n = 45
known_good_output = tuple(islice(fibonacci(), n))
# known_g... |
krondor/nlp-dsx-pot | Watson Developer APIs for Facebook Data.ipynb | gpl-3.0 | !pip install --upgrade watson-developer-cloud
!pip install --upgrade beautifulsoup4
"""
Explanation: Analyze Facebook Data Using IBM Watson and IBM Data Platform
This is a three-part notebook written in Python_3.5 meant to show how anyone can enrich and analyze a combined dataset of unstructured and strucutured infor... |
shameeriqbal/pandas-tutorial | notebooks/3.Control_structures.ipynb | mit | def print_n_stars(n):
"""
Prints n no. of stars
Arguments:
n: number of stars to print
"""
for i in range(n):
print "*", # having a ',' tells print not to insert a new line after print
print '' # inserts a new line after the loop
return
"""
Explanation: This exercise will ... |
planet-os/notebooks | aws/era5-s3-via-boto.ipynb | mit | # Initialize notebook environment.
%matplotlib inline
import boto3
import botocore
import datetime
import matplotlib.pyplot as plt
import os.path
import xarray as xr
"""
Explanation: Accessing ERA5 Data on S3
This notebook explores how to access ERA5 data stored on a public S3 bucket as part of the AWS Public Dataset ... |
minxuancao/shogun | doc/ipython-notebooks/pca/pca_notebook.ipynb | gpl-3.0 | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
# import all shogun classes
from modshogun import *
"""
Explanation: Principal Component Analysis in Shogun
By Abhijeet Kislay (GitHub ID: <a href='https://github.com/kislayabhi'>kislayabhi</a>)
This notebook is ab... |
imcgreer/simqso | examples/bossqsos_example.ipynb | bsd-3-clause | M1450 = linspace(-30,-22,20)
zz = arange(0.7,3.5,0.5)
ple = bossqsos.BOSS_DR9_PLE()
lede = bossqsos.BOSS_DR9_LEDE()
for z in zz:
if z<2.2:
qlf = ple if z<2.2 else lede
plot(M1450,qlf(M1450,z),label='z=%.1f'%z)
legend(loc='lower left')
xlim(-21.8,-30.2)
xlabel("$M_{1450}$")
ylabel("log Phi")
"""
Explana... |
kvr777/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... |
Lattecom/HYStudy | scripts/[HYStudy 20th] Survival Analysis.ipynb | mit | import pandas as pd
import lifelines
import matplotlib.pylab as plt
%matplotlib inline
data = lifelines.datasets.load_dd()
"""
Explanation: Survival Analysis (1)
source : lifelines documents (https://lifelines.readthedocs.io/)
Survival Analysis is useful for searching break of machine or User's churn rate...and ... |
julienchastang/unidata-python-workshop | notebooks/CartoPy/CartoPy.ipynb | mit | # Set things up
%matplotlib inline
# Importing CartoPy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
"""
Explanation: <a name="top"></a>
<div style="width:1000 px">
<div style="float:right; width:98 px; height:98px;">
<img src="https://raw.githubusercontent.com/Unidata... |
VenkateshBejjenki/Machine_Learning_Specialization | Author_Classification/bag.ipynb | gpl-3.0 | # Importing pandas library
import pandas as pd
# Loding the data set
df = pd.read_table('data.csv',
sep=',',
header=None,
names=['rollNo','textData'])
# Output printing out first 5 columns
df.head()
# from sklearn.feature_extraction import text
"""
Expla... |
w4zir/ml17s | lectures/.ipynb_checkpoints/lec09-logistic-regression-example-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn import neighbors
df = pd.read_csv('datasets/exam_dataset1.csv', encoding='utf-8')
n_neighbors = 5
X = np.array(df[['exam1','exam2']])
y = np.array(df[['admission']]).ravel()
h = .02 # ste... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inm', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
Alexoner/skynet | notebooks/Dropout.ipynb | mit | # As usual, a bit of setup
import time
import numpy as np
import matplotlib.pyplot as plt
from skynet.neural_network.classifiers.fc_net import *
from skynet.utils.data_utils import get_CIFAR10_data
from skynet.utils.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from skynet.solvers.solver... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/04-Semantics-and-Sentiment-Analysis/04-Sentiment-Analysis-Assessment-Solutions.ipynb | apache-2.0 | # Import spaCy and load the language library. Remember to use a larger model!
import spacy
nlp = spacy.load('en_core_web_md')
# Choose the words you wish to compare, and obtain their vectors
word1 = nlp.vocab['wolf'].vector
word2 = nlp.vocab['dog'].vector
word3 = nlp.vocab['cat'].vector
# Import spatial and define a ... |
tiagoft/inteligencia_computacional | regressao.ipynb | mit | # Inicializacao
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
def nova_mlp(entradas, saidas, camadas):
lista_de_camadas = [entradas] + camadas + [saidas]
pesos = []
for i in xrange(len(lista_de_camadas)-1):
pesos.append(np.random.random((lista_de_camadas[i+1], lista_de... |
kimkipyo/dss_git_kkp | Python 복습/08일차.금_정규표현식, class, 크롤링, 숙제/8일차_1T,3T_정규 표현식_이메일, 핸드폰 번호, Class_.ipynb | mit | with open("crawled.txt", "r", encoding='utf8') as f: #crawled.txt는 보기와 같이 임의로 텍스트 파일을 만들었습니다.
data = f.read()
print(data)
import re
with open("crawled.txt", "r", encoding='utf8') as f:
data = f.read()
phonenumber_regex = "010" # 1. 정규표현식 (regex)
# phonenumber_regex =... |
dolittle007/dolittle007.github.io | notebooks/GLM-logistic.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn
import warnings
warnings.filterwarnings('ignore')
from collections import OrderedDict
from time import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.opti... |
dedx/STAR2015 | STAR2015Workshop.ipynb | mit | #Comments begin with #
#Allow graphics to render inside the notebook
%pylab inline
#import packages we might want to use
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
"""
Explanation: Coding in the Classroom
Jennifer Klay jklay@calpoly.edu
California Polytechnic State University, San Luis Ob... |
activitynet/ActivityNet | Notebooks/ActivityNet-Release1.3.Proposals.ipynb | mit | import sys
sys.path.append('../Evaluation')
from eval_proposal import ANETproposal
import matplotlib.pyplot as plt
import numpy as np
import json
%matplotlib inline
"""
Explanation: ActivityNet Challenge Proposal Task
This notebook is intended as demo on how to format and evaluate the performance of a submission fil... |
gapatino/Doing-frequentist-statistics-with-Scipy | PyData DC 2016 - Doing frequentist statistics with Scipy.ipynb | gpl-3.0 | import numpy as np
from scipy import stats
import pandas as pd
from tkinter import filedialog
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Use file browser to find name and path of the CSV file that contains the dataset
data_file = filedialog.askopenfilename()
print(data_file)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.