repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
subhachandrachandra/MNIST_Notebooks | MNIST_TF_CNN_Tutorial.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
import time
"""
Explanation: This Notebook implements the TensorFlow advanced tutorial which uses a Multilayer Convolutional Network on the MNIST dataset
End of explanation
"""
mnist = input_data.read_d... |
xunilrj/sandbox | courses/MITx/MITx 6.86x Machine Learning with Python-From Linear Models to Deep Learning/project3/.ipynb_checkpoints/Part2-checkpoint.ipynb | apache-2.0 | # Start by importing torch
import torch
"""
Explanation: 6.86x - Introduction to ML Packages (Part 2)
This tutorial is designed to provide a short introduction to deep learning with PyTorch.
You can start studying this tutorial as you work through unit 3 of the course.
For more resources, check out the PyTorch tutoria... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/formulas.ipynb | bsd-3-clause | import numpy as np # noqa:F401 needed in namespace for patsy
import statsmodels.api as sm
"""
Explanation: Formulas: Fitting models using R-style formulas
Since version 0.5.0, statsmodels allows users to fit statistical models using R-style formulas. Internally, statsmodels uses the patsy package to convert formulas... |
mdda/fossasia-2016_deep-learning | notebooks/2-CNN/2-MNIST/2-MNIST-CNN.ipynb | mit | import numpy as np
import theano
import theano.tensor as T
import lasagne
import matplotlib.pyplot as plt
%matplotlib inline
import gzip
import pickle
# Seed for reproduciblity
np.random.seed(42)
"""
Explanation: Theano + Lasagne :: MNIST CNN
This is a quick illustration of a Convolutional Neural Network being trai... |
ML4DS/ML4all | C_lab2_NNs/Hand_Digit_with_NN_professor.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
size=18
params = {'legend.fontsize': 'Large',
'axes.labelsize': size,
'axes.titlesize': size,
'xtick.labelsize': size*0.75,
'ytick.labelsize': size*0.75}
plt.rcParams.update(params)
"""
Explanation: <h1>Tabl... |
CompPhysics/MachineLearning | doc/pub/How2ReadData/ipynb/How2ReadData.ipynb | cc0-1.0 | import numpy as np
"""
Explanation: <!-- dom:TITLE: Data Analysis and Machine Learning: Getting started, our first data and Machine Learning encounters -->
Data Analysis and Machine Learning: Getting started, our first data and Machine Learning encounters
<!-- dom:AUTHOR: Morten Hjorth-Jensen at Department of Physics,... |
awjuliani/DeepRL-Agents | Simple-Policy.ipynb | mit | import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
"""
Explanation: Simple Reinforcement Learning in Tensorflow Part 1:
The Multi-armed bandit
This tutorial contains a simple example of how to build a policy-gradient based agent that can solve the multi-armed bandit problem. For more inf... |
balarsen/pymc_learning | Propagation_of_uncertainty/Examples.ipynb | bsd-3-clause | import numpy as np
import pymc as mc
H = mc.Normal('H', 2.00, (0.03)**-2)
h = mc.Normal('h', 0.88, (0.04)**-2)
@mc.deterministic()
def Q(H=H, h=h):
return H-h
model = mc.MCMC((H,h,Q))
model.sample(1e4, burn=100, burn_till_tuned=True)
# mc.Matplot.plot(model)
# mc.Matplot.plot(Q)
print(Q.summary())
print("MCMC g... |
gcarq/freqtrade | freqtrade/templates/strategy_analysis_example.ipynb | gpl-3.0 | from pathlib import Path
from freqtrade.configuration import Configuration
# Customize these according to your needs.
# Initialize empty configuration object
config = Configuration.from_files([])
# Optionally, use existing configuration file
# config = Configuration.from_files(["config.json"])
# Define some constant... |
flsantos/startup_acquisition_forecast | .ipynb_checkpoints/1_1_dataset_more_features-checkpoint.ipynb | mit | #I'm considering only Acquisitions made in USA, with USD (dollars)
acquisitions = pd.read_csv('data/acquisitions.csv')
acquisitions = acquisitions[acquisitions['acquirer_country_code'] == 'USA']
acquisitions[:3]
#acquirer_permalink
#rounds_agg = df_rounds.groupby(['company_permalink', 'funding_round_type'])['raised_am... |
mimoralea/applied-reinforcement-learning | notebooks/04-q-learning.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tempfile
import pprint
import math
import json
import sys
import gym
from gym import wrappers
from subprocess import check_output
from IPython.display import HTML
"""
Explanation: Model-Free Reinforcement Learning
Remember how in last Note... |
rmalouf/learning | Plurals (population learnability).ipynb | mit | data['Outcomes'] = 'plural'
data['Outcomes'][1] = 'singular'
data
W = ndl.rw(data,M=10)
A = activation(W)
A
"""
Explanation: Singular / plural distinction
End of explanation
"""
pd.DataFrame([data['Outcomes'], A.idxmax(1), A.idxmax(1) == data['Outcomes']], index = ['Truth', 'Prediction', 'Accurate?']).T
np.mean(A.... |
NeuroDataDesign/fngs | docs/ebridge2/fngs_reg/week_0327/specs.ipynb | apache-2.0 | %%script false
## disklog.sh
#!/bin/bash -e
# run this in the background with nohup ./disklog.sh > disk.txt &
#
while true; do
echo "$(du -s $1 | awk '{print $1}')"
sleep 30
done
##cpulog.sh
import psutil
import time
import argparse
def cpulog(outfile):
with open(outfile, 'w') as outf:
while(Tr... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_ml/td2a_clustering.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: 2A.ml - Clustering
Ce notebook utilise les données des vélos de Chicago Divvy Data. Il s'inspire du challenge créée pour découvrir les habitudes des habitantes de la ville City Bike. L'idée est d'explorer plusieurs alg... |
zerothi/ts-tbt-sisl-tutorial | TS_04/run.ipynb | gpl-3.0 | chain = sisl.Geometry([[0,0,0]], atoms=sisl.Atom[6], sc=[1.4, 1.4, 11])
elec_x = chain.tile(4, axis=0).add_vacuum(11 - 1.4, 1)
elec_x.write('ELEC_X.fdf')
elec_y = chain.tile(4, axis=1).add_vacuum(11 - 1.4, 0)
elec_y.write('ELEC_Y.fdf')
chain_x = elec_x.tile(4, axis=0)
chain_y = elec_y.tile(4, axis=1)
chain_x = chain_x.... |
imamol555/Machine-Learning | NumPy.ipynb | mit | test = "Hello World"
print ("test: " + test)
"""
Explanation: About iPython Notebooks
iPython Notebooks are interactive coding environments embedded in a webpage. After writing your code, you can run the cell by either pressing "SHIFT"+"ENTER" or by clicking on "Run Cell" (denoted by a play symbol) in the upper bar o... |
rjleveque/ptha_tutorial | Notebooks/Make_Textfile_Demo.ipynb | bsd-2-clause | %pylab inline
from __future__ import print_function
import sys, os
from ptha_paths import data_dir, events_dir
"""
Explanation: Make Textfile Demo
Demonstrates how to read in the topography or an event and write it out to a text file, as might be needed to read it into ArcGIS, for example.
End of explanation
"""
fi... |
psci2195/espresso-ffans | doc/tutorials/11-ferrofluid/11-ferrofluid_part2.ipynb | gpl-3.0 | import espressomd
espressomd.assert_features('DIPOLES', 'LENNARD_JONES')
from espressomd.magnetostatics import DipolarP3M
from espressomd.magnetostatic_extensions import DLC
import numpy as np
"""
Explanation: Ferrofluid - Part II
Table of Contents
Applying an external magnetic field
Magnetization curve
Remark: Th... |
IsacLira/data-science-cookbook | 2017/06-linear-regression/resp_slr_sayonara_lailson.ipynb | mit | import pandas as pd
from sklearn.model_selection import train_test_split
from math import sqrt
%matplotlib inline
import matplotlib.pyplot as plt
class Prediction(object):
def __init__(self):
self.x_column = None
self.y_column = None
#Dados iniciais (Para deixar todas as funções genéricas) ... |
drewlinsley/draw_classify | draw/datasets/Sketch.ipynb | mit | #%%bash
#cd ~/Downloads
#wget http://cybertron.cg.tu-berlin.de/eitz/projects/classifysketch/sketches_png.zip
#unzip sketches_png.zip
files = !find ~/Desktop/res_results_problem_4 -name "*.jpg"
len(files)
#a = process(files[0])
#a.shape
outpath = '/Users/drewlinsley/Documents/draw/draw/datasets'
datasource = 'sketch_u... |
RyanChinSang/ECNG3020-ORSS4SCVI | BETA/TestCode/Tensorflow/Test/object_detection/object_detection_tutorial.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
"""
Explanation: Object Detection Demo
Welcome to the object detection ... |
sz2472/foundations-homework | homework_5_shengying_zhao_graded.ipynb | mit | import requests
!pip3 install requests
response = requests.get("https://api.spotify.com/v1/search?q=Lil&type=artist&market=US&limit=50")
print(response.text)
data = response.json()
type(data)
data.keys()
data['artists'].keys()
artists=data['artists']
type(artists['items'])
artist_info = artists['items']
for ... |
pgmpy/pgmpy_notebook | notebooks/10. Learning Bayesian Networks from Data.ipynb | mit | import pandas as pd
data = pd.DataFrame(data={'fruit': ["banana", "apple", "banana", "apple", "banana","apple", "banana",
"apple", "apple", "apple", "banana", "banana", "apple", "banana",],
'tasty': ["yes", "no", "yes", "yes", "yes", "yes", "yes",
... |
gghezzo/prettypython | nb/.ipynb_checkpoints/Mobile Market Demo - Feb 2017-checkpoint.ipynb | mit | from PIL import Image
import pytesseract
import googlemaps
import gmaps as jupmap
import sys
from datetime import datetime
# get my private keys for google maps and gmaps
f = open('private.key', 'r')
for line in f:
temp = line.rstrip('').replace(',','').replace('\n','').split(" ")
exec(temp[0])
myMap = goo... |
swails/mdtraj | examples/principal-components.ipynb | lgpl-2.1 | %matplotlib inline
from __future__ import print_function
import mdtraj as md
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
"""
Explanation: scikit-learn is a machine learning library for python, with a very easy to use API and great documentation.
End of explanation
"""
traj = md.load('ala2.h... |
ES-DOC/esdoc-jupyterhub | notebooks/ipsl/cmip6/models/ipsl-cm6a-lr/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ipsl', 'ipsl-cm6a-lr', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: IPSL
Source ID: IPSL-CM6A-LR
Topic: Ocean
Sub-Topics: Timestepping Framework, Adv... |
PyLadiesCZ/pyladies.cz | original/v1/s011-dicts/requests.ipynb | mit | import requests
"""
Explanation: Requests
Nejdřiv si nainstaluj Requests, knihovnu pro webové klienty:
$ pip install requests
A pak v Pythonu:
End of explanation
"""
odpoved = requests.get('http://python.cz')
"""
Explanation: Knihovna Requests ti umožní stahovat webové stránky serverů na Internetu, podobně jako to... |
martinggww/lucasenlights | MachineLearning/DataScience-Python3/PolynomialRegression.ipynb | cc0-1.0 | %matplotlib inline
from pylab import *
import numpy as np
np.random.seed(2)
pageSpeeds = np.random.normal(3.0, 1.0, 1000)
purchaseAmount = np.random.normal(50.0, 10.0, 1000) / pageSpeeds
scatter(pageSpeeds, purchaseAmount)
"""
Explanation: Polynomial Regression
What if your data doesn't look linear at all? Let's loo... |
hydrogo/MORS | sandbox/try_3.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
data = pd.read_csv('../data/hbv_s_data.csv', index_col=0, parse_dates=True)
"""
Explanation: Try to write temperature-based potential evaporation (PET) model
End of explanation
"""
evap_true = np.array([0.6,1.9,2.4,1.8,1.4,1.... |
StephenHarrington/spark | cs1001x_lab4.ipynb | mit | import sys
import os
from test_helper import Test
baseDir = os.path.join('data')
inputPath = os.path.join('cs100', 'lab4', 'small')
ratingsFilename = os.path.join(baseDir, inputPath, 'ratings.dat.gz')
moviesFilename = os.path.join(baseDir, inputPath, 'movies.dat')
"""
Explanation: version 1.0.2
+
Introduction to M... |
tuanavu/coursera-university-of-washington | machine_learning/1_machine_learning_foundations/assignment/week6/Deep Features - Exercise.ipynb | mit | import graphlab
"""
Explanation: Using deep features to build an image classifier
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
"""
Explanation: Load a common image analysis dataset
We will use a popular benchmark d... |
mne-tools/mne-tools.github.io | dev/_downloads/13f9133d0e7c13dded3c5dd2cf828dd3/gamma_map_inverse.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne.datasets import sample
from mne.inverse_sparse import gamma_map, make_stc_from_dipoles
from mne.viz import (plot_sparse_source_estimates,... |
tjmahr/DeepLearning | LogisticFunction.ipynb | gpl-2.0 | %load_ext version_information
%version_information theano, numpy
"""
Explanation: Tutorial on the logistic function
The Logistic Function
End of explanation
"""
import theano
import theano.tensor as T
import numpy as np
# Same recipe as last tutorial:
x = T.dmatrix("x") # Define variables
s = 1 / ... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/hadgem3-gc31-hm/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-hm', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: MOHC
Source ID: HADGEM3-GC31-HM
Topic: Ocean
Sub-Topics: Timestepping Framewor... |
alorozco53/RPYAApublic | proyecto1/FacebookComments.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
from ipywidgets import interact, interact_manual
from sklearn.preprocessing import OneHotEncoder
from sklearn.linear_model import LinearRegression, Ridge, Lasso
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics imp... |
tensorflow/docs-l10n | site/zh-cn/guide/keras/customizing_what_happens_in_fit.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... |
albahnsen/PracticalMachineLearningClass | notebooks/13-Ensembles_RandomForest.ipynb | mit | import pandas as pd
import numpy as np
# read in the data
url = 'https://raw.githubusercontent.com/albahnsen/PracticalMachineLearningClass/master/datasets/hitters.csv'
hitters = pd.read_csv(url)
# remove rows with missing values
hitters.dropna(inplace=True)
hitters.head()
# encode categorical variables as integers
h... |
nimish-jose/dlnd | language-translation/dlnd_language_translation.ipynb | gpl-3.0 | """
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... |
readsoftware/read | admin/ReadCursorSample.ipynb | gpl-3.0 | import module.readQueryCursor as rqc
"""
Explanation: Working with readQueryCursor library
connecting to postgreSQL database
End of explanation
"""
myRQC = rqc.ReadQueryCursor({
'host':'localhost',
'port':'5432',
'database':'dbname',
'user': 'dbusername',
... |
quantopian/zipline | docs/notebooks/tutorial.ipynb | apache-2.0 | # assuming you're running this notebook in zipline/docs/notebooks
import os
if os.name == 'nt':
# windows doesn't have the cat command, but uses 'type' similarly
! type "..\..\zipline\examples\buyapple.py"
else:
! cat ../../zipline/examples/buyapple.py
"""
Explanation: Zipline Beginner Tutorial
Basics
Zip... |
yhat/ggplot | docs/how-to/Visualizing Distributions.ipynb | bsd-2-clause | ggplot(diamonds, aes(x='price')) + geom_density()
ggplot(diamonds, aes(x='price')) + stat_density()
"""
Explanation: Distributions
ggplot provides 2 main ways to visualize distributions: histograms and density plots. Both are fairly easy to do, but it's not recommended that you use them at the same time. Reason being... |
mne-tools/mne-tools.github.io | 0.21/_downloads/075ba1175413b0aa0dc66e721f312729/plot_mixed_norm_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne.datasets import sample
from mne.inverse_sparse import mixed_norm, make_stc_from_dipoles
from mne.minimum_norm import make_inverse... |
apryor6/apryor6.github.io | visualizations/seaborn/notebooks/violinplot.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
plt.rcParams['figure.figsize'] = (20.0, 10.0)
plt.rcParams['font.family'] = "serif"
df = pd.read_csv('../../../datasets/movie_metadata.csv')
df.head()
"""
Explanation: seaborn.violinplot
Violinplots summa... |
kabrapratik28/Stanford_courses | cs231n/assignment1/features.ipynb | apache-2.0 | import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading extenrnal modu... |
maartenbreddels/ipyvolume | docs/source/examples/bokeh.ipynb | mit | import ipyvolume
import ipyvolume as ipv
import vaex
"""
Explanation: ipyvolume & bokeh
This example shows how the selection from a ipyvolume quiver plot can be controlled with a bokeh scatter plot and it's selection tools.
Ipyvolume quiver plot
The 3d quiver plot is done using ipyvolume
End of explanation
"""
ds = ... |
SIMEXP/Projects | NSC2006/labo1/.ipynb_checkpoints/labo_NSC2006_donnees_multidimentionnelles_Matlab-checkpoint.ipynb | mit | %matplotlib inline
from pymatbridge import Matlab
mlab = Matlab()
mlab.start()
%load_ext pymatbridge
"""
Explanation: <div align="center">
<h2> Méthodes quantitatives en neurosciences </h2>
</div>
<div align="center">
<b><i> Cours NSC-2006, année 2015</i></b><br>
<b>Laboratoire d'analyse de données multidimensionne... |
zrhans/python | topicos/Estacoes-ATMOS-2011.ipynb | gpl-2.0 | import sys
import numpy as np
import pandas as pd
print(sys.version) # Versao do python - Opcional
print(np.__version__) # VErsao do modulo numpy - Opcional
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
import datetime
import time
#?pd.date_range
#rng = pd.date_range('1/1/2011', periods=90, freq... |
kevinsung/OpenFermion | docs/tutorials/intro_workshop_exercises.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 unde... |
tensorflow/docs-l10n | site/ja/hub/tutorials/tweening_conv3d.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
BuzzFeedNews/2015-07-h2-visas-and-enforcement | notebooks/superior-forestry-cases.ipynb | mit | import pandas as pd
import sys
sys.path.append("../utils")
import loaders
"""
Explanation: Superior Forestry Cases
The Python code below finds and enumerates the WHD investigations corresponding to Superior Forestry, Inc., and prints them to a simple table, which you can find at the bottom of this page.
End of explana... |
bsmithyman/zephyr | Demo 2 - Remote parallel computation [distributed].ipynb | mit | # profile = 'phobos' # remote workstation
# profile = 'pantheon' # remote cluster
profile = 'mpi' # local machine
"""
Explanation: Demo 2 - Remote parallel computation [distributed]
Demo for site visit | Brendan Smithyman | April 8, 2015
Choice of IPython / jupyter cluster profile
End of explanation
"""
import num... |
verilylifesciences/variant-qc | notebooks/PrivateVariants.ipynb | apache-2.0 | #@title Default title text
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... |
CalebBell/fluids | docs/Data/Friction.ipynb | mit | import numpy as np
from fluids.friction import friction_factor, oregon_Res, oregon_fd_smooth
import matplotlib.pyplot as plt
Res = np.logspace(np.log10(oregon_Res[0]), np.log10(oregon_Res[-1]), 500)
fds_calc = [friction_factor(Re) for Re in Res]
plt.loglog(oregon_Res, oregon_fd_smooth, 'x', label='Oregon Data')
plt.lo... |
Ensembl/cttv024 | tests/reports/template.ipynb | apache-2.0 | from reports import helpers
helpers.calc_run_str()
# pg = pd.read_csv(filename, sep='\t', na_values=['None'])
pg = helpers.load_file(filename)
"""
Explanation: POSTGAP Report
This notebook was automatically generated as a summary of POSTGAP output.
Setup
Note that for command line usage (python reporter.py <filen... |
elastic/examples | Machine Learning/Query Optimization/notebooks/doc2query - 1 - BM25 tuning.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
import importlib
import os
import sys
from copy import deepcopy
from elasticsearch import Elasticsearch
from skopt.plots import plot_objective
# project library
sys.path.insert(0, os.path.abspath('..'))
import qopt
importlib.reload(qopt)
from qopt.notebooks import evaluate_mrr100... |
sdpython/ensae_teaching_cs | _doc/notebooks/sklearn_ensae_course/04_supervised_regression.ipynb | mit | from sklearn.datasets import load_boston
data = load_boston()
print(data.data.shape)
print(data.target.shape)
"""
Explanation: 2A.ML101.4: Supervised Learning: Regression of Housing Data
Here we'll do a short example of a regression problem: learning a continuous value
from a set of features.
We'll use the simple Bost... |
tensorflow/docs-l10n | site/ja/tutorials/structured_data/time_series.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... |
mu4farooqi/deep-learning-projects | language-translation/dlnd_language_translation.ipynb | gpl-3.0 | """
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... |
fmaschler/networkit | Doc/Notebooks/Tutorial_Solutions_Part_3.ipynb | mit | %matplotlib inline
from networkit import *
import matplotlib.pyplot as plt
cd ~/Documents/workspace/NetworKit
%matplotlib inline
G = readGraph("input/MIT8.edgelist", Format.EdgeListTabZero)
def avgFriendDegree(v):
""" Calculate the average degree of the neighbors of a node"""
degSum = 0
for u in G.neigh... |
garth-wells/IA-maths-Ipython | Lecture01.ipynb | bsd-3-clause | import sympy
from sympy import symbols, Eq, Derivative, init_printing, Function, dsolve, exp, classify_ode, checkodesol
# This initialises pretty printing
init_printing()
from IPython.display import display
# Support for interactive plots
from ipywidgets import interact
# This command makes plots appear inside the b... |
simonsfoundation/CaImAn | demos/notebooks/demo_multisession_registration.ipynb | gpl-2.0 | import pickle
from caiman.base.rois import register_multisession
from caiman.utils import visualization
from caiman.utils.utils import download_demo
from matplotlib import pyplot as plt
import numpy as np
"""
Explanation: Multisession registration with CaImAn
This notebook will help to demonstrate how to use CaImAn on... |
ysh329/Homework | CS100.1x Introduction to Big Data with Apache Spark/lab1_word_count_student.ipynb | mit | wordsList = ['cat', 'elephant', 'rat', 'rat', 'cat']
wordsRDD = sc.parallelize(wordsList, 4)
# Print out the type of wordsRDD
print type(wordsRDD)
"""
Explanation: +
Word Count Lab: Building a word count application
This lab will build on the techniques covered in the Spark tutorial to develop a simple word count app... |
fabiencampillo/systemes_dynamiques_agronomie | 3_premiers_modeles.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
t0, t1 = 0, 10
temps = np.linspace(t0,t1,200, endpoint=True)
population = lambda t: x0*np.exp((rb-rd)*t)
legende = []
for x0, rb, rd in zip([1, 1, 1], [1, 1, 0.9], [0.9, 1, 1]):
plt.plot(temps, population(temps))
legende = legende + [r'$\l... |
wikistat/Apprentissage | ExemplesJouet/Apprent-Python-Blobs.ipynb | gpl-3.0 | %matplotlib inline
from matplotlib import pyplot as plt
# option d'impression
import numpy as np
np.set_printoptions(precision=3)
"""
Explanation: <center>
<a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:left; max-width: 120px; displ... |
paolorivas/homeworkfoundations | 06/.ipynb_checkpoints/Homework_06_Paolo_Rivas_Legua-checkpoint.ipynb | mit | import requests
response = requests.get("https://api.forecast.io/forecast/5afc9217d7eea82824254c951b1b57f4/-12.0561,-77.0268")
weather_Lima = response.json()
weather_Lima.keys()
"""
Explanation: You'll be using the Dark Sky Forecast API from Forecast.io, available at https://developer.forecast.io. It's a pretty simp... |
Schwittleymani/ECO | src/tests/py_nltk/word2vec.ipynb | apache-2.0 | from gensim.models import Word2Vec
"""
Explanation: word2vec is a technique for encoding words (or other tokens in a sequence) into high dimensional vectors. These vectors can be used for similarity lookups and arithmetic operations. The word2vec algorithm is implemented by gensim.
End of explanation
"""
model = Wor... |
saudijack/unfpyboot | Day_02/00_Scipy/scipy_Practice-solutions.ipynb | mit | %pylab inline
import scipy as sp
"""
Explanation: Import NumPy and SciPy (not needed when using --pylab)
End of explanation
"""
zz = np.loadtxt('wiggleZ_DR1_z.dat',dtype='float'); # Load WiggleZ redshifts
np.min(zz) # Check bounds
np.max(zz)
"""
Explanation: Load data from file
End of explanation
"""
nbins = 50... |
miaecle/deepchem | examples/tutorials/05_Putting_Multitask_Learning_to_Work.ipynb | mit | %tensorflow_version 1.x
!curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import deepchem_installer
%time deepchem_installer.install(version='2.3.0')
"""
Explanation: Tutorial Part 5: Putting Multitask Learning to Work
This notebook walks through the cr... |
zzsza/Datascience_School | 13. Scikit-Learn, Statsmodel/04. Scikit-Learn 패키지의 샘플 데이터 - classification용.ipynb | mit | from sklearn.datasets import load_iris
iris = load_iris()
print(iris.DESCR)
df = pd.DataFrame(iris.data, columns=iris.feature_names)
sy = pd.Series(iris.target, dtype="category")
sy = sy.cat.rename_categories(iris.target_names)
df['species'] = sy
df.tail()
sns.pairplot(df, hue="species")
plt.show()
"""
Explanation: ... |
adrn/tutorials | notebooks/color-excess/color-excess.ipynb | cc0-1.0 | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import astropy.units as u
from astropy.table import Table
from dust_extinction.parameter_averages import CCM89, F99
from synphot import units, config
from synphot import SourceSpectrum,SpectralElement,Observation,ExtinctionModel1D
from synphot.model... |
Usherwood/usherwood_ds | tutoriais/Conceitos Básicos 2 - Loops, Funções e Classes .ipynb | bsd-2-clause | a = [0,5,10,3,2]
for elemento in a: # 'for' e 'in' são palavres chaves, 'elemento' é só um nome variável dummy.
print(elemento) # O travessão é muito importante, Python conheça onde um loop existe do travessão de 2 ou 4 espações.
# nota: usando jupyter ou pycharm (ou muitos IDEs) pode usar 'ta... |
quoniammm/happy-machine-learning | Udacity-DL/.ipynb_checkpoints/DLND Your first neural network-checkpoint.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... |
phoebe-project/phoebe2-docs | 2.3/tutorials/distribution_types.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
import phoebe
from phoebe import u # units
import numpy as np
logger = phoebe.logger()
b = phoebe.default_binary()
"""
Explanation: Advanced: Distribution Types
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an on... |
JrtPec/opengrid | notebooks/Demo/Demo_Forecast.io.ipynb | apache-2.0 | import os
import sys
import inspect
import pandas as pd
import charts
"""
Explanation: What's new in the Forecastwrapper
Solar Irradiance on a tilted plane
Wind on an oriented building face
No more "include this", "include that". Everything is included. (I implemented these flags to speed to speed up some things (whi... |
tensorflow/model-remediation | docs/counterfactual/guide/creating_a_custom_counterfactual_dataset.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... |
dm-wyncode/zipped-code | content/posts/coding/recursion_looping_relationship.ipynb | mit | def reduce(function, iterable, initializer=None):
it = iter(iterable)
if initializer is None:
try:
initializer = next(it)
except StopIteration:
raise TypeError('reduce() of empty sequence with no initial value')
accum_value = initializer
# it exhausted if initiali... |
Riptawr/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... |
franzpl/StableGrid | jupyter_notebooks/hardware_in_comparison.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
"""
Explanation: Hardware in comparison
This notebook deals with mains frequency measurements with optocoupler and schmitt trigger hardware to verify that both hardware solutions have the same results. Therefore, both h... |
tensorflow/federated | docs/tutorials/custom_federated_algorithm_with_tff_optimizers.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... |
JasonNK/udacity-dlnd | 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... |
tkarna/cofs | demos/01-2d-channel.ipynb | mit | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
from thetis import *
"""
Explanation: 2D Channel with Time-Dependent Boundary Conditions
This example demonstrates the simulation of a flow in a 2D channel in a closed rectangular domain using constant and time dependent boundary conditions.
The flow... |
adamsteer/nci-notebooks | pgpointcloud/Postgres-pointcloud Lower darling.ipynb | apache-2.0 | import os
import psycopg2 as ppg
import numpy as np
import ast
from osgeo import ogr
import shapely as sp
from shapely.geometry import Point,Polygon,asShape
from shapely.wkt import loads as wkt_loads
from shapely import speedups
import cartopy as cp
import cartopy.crs as ccrs
import pandas as pd
import pandas.io.s... |
eds-uga/csci1360-fa16 | lectures/L5.ipynb | mit | ages = [21, 22, 19, 19, 22, 21, 22, 31]
"""
Explanation: Lecture 5: Loops
CSCI 1360: Foundations for Informatics and Analytics
Overview and Objectives
In this lecture, we'll go over the basics of looping in Python. By the end of this lecture, you should be able to
Perform basic arithmetic operations using arbitrary-l... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_11/Begin/Resampling.ipynb | bsd-3-clause | # min: minutes
my_index = pd.date_range('9/1/2016', periods=9, freq='min')
"""
Explanation: Resampling
documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html
For arguments to 'freq' parameter, please see Offset Aliases
create a date range to use as an index
End of explanati... |
bliebeskind/Gene-Ages | Notebooks/robustness_of_geneEnrichment.ipynb | mit | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Sensitivity of enrichment analysis to quality trimming
In this sheet we explore how trimming the gene-age data by various quality measures affects enrichment analysis of gene ontology and other terms
End of ... |
fisicatyc/Cuantica_Jupyter | Superposicion.ipynb | mit | """Bibliotecas"""
import matplotlib.pyplot as plt
from numpy import *
from ipywidgets import *
from IPython.display import * # Importa los métodos de renderizado
from math import factorial,exp
%matplotlib inline
#se crea un arreglo para definir en que valores se va a trabajar
t=arange(-1,1,0.01)
#se define la funci... |
jdvelasq/ingenieria-economica | 2016-03/IE-03-calculos-sobre-flujos.ipynb | mit | import cashflows as cf
"""
Explanation: Cálculos sobre flujos de dinero
Notas de clase sobre ingeniería economica avanzada usando Python
Juan David Velásquez Henao
jdvelasq@unal.edu.co
Universidad Nacional de Colombia, Sede Medellín
Facultad de Minas
Medellín, Colombia
Software utilizado
Este es un documento intera... |
mozillazg/redis-py-doc | docs/examples/asyncio_examples.ipynb | mit | import redis.asyncio as redis
connection = redis.Redis()
print(f"Ping successful: {await connection.ping()}")
await connection.close()
"""
Explanation: Asyncio Examples
All commands are coroutine functions.
Connecting and Disconnecting
Utilizing asyncio Redis requires an explicit disconnect of the connection since th... |
jaropolk2/python_statistics | sample_distribution_evaluation.ipynb | unlicense | sample = np.random.choice([1,2,3,4,5,6], 100)
"""
Explanation: Дискретное распределение
Сгенерируем выборку объёма 100 из дискретного распределения с шестью равновероятными исходами.
End of explanation
"""
# посчитаем число выпадений каждой из сторон:
from collections import Counter
c = Counter(sample)
print("Числ... |
rsterbentz/phys202-2015-work | assignments/assignment03/NumpyEx01.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 1
Imports
End of explanation
"""
def checkerboard(size):
"""Return a 2d checkboard of 0.0 and 1.0 as a NumPy array"""
a =... |
rjenc29/numerical | tensorflow/2_fullyconnected.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from six.moves import range
"""
Explanation: Deep Learning
Assignment 2
Previously in 1_n... |
gaufung/ISL | training-materials/Stasmodels-training/Formulas.ipynb | mit | import numpy as np
import statsmodels.api as sm
"""
Explanation: Formulas: Fitting models using R-style formulas
loading modules and fucntions
End of explanation
"""
from statsmodels.formula.api import ols
import statsmodels.formula.api as smf
dir(smf)
"""
Explanation: import convention
End of explanation
"""
dt... |
turbomanage/training-data-analyst | quests/rl/early_rl/early_rl.ipynb | apache-2.0 | !pip install gym==0.12.5 --user
"""
Explanation: Early Reinforcement Learning
With the advances of modern computing power, the study of Reinforcement Learning is having a heyday. Machines are now able to learn complex tasks once thought to be solely in the domain of humans, from conrolling the heating and cooling in m... |
google/gps_building_blocks | py/gps_building_blocks/ml/diagnostics/binary_classification_diagnostics_example.ipynb | apache-2.0 | # Uncomment to install gps_building_blocks
# !pip install gps_building_blocks
import pandas as pd
import numpy as np
from gps_building_blocks.cloud.utils import bigquery as bigquery_utils
from gps_building_blocks.ml.diagnostics import binary_classification
"""
Explanation: Binary Classification Model Diagnostics Exa... |
Ruediger-Braun/compana16 | Lektion12.ipynb | gpl-3.0 | from sympy import *
init_printing()
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Lektion 12
End of explanation
"""
x = Symbol('x', real=True)
A = Matrix(3,3, [x,x,0,0,x,x,0,0,x])
A
A.exp()
"""
Explanation: Matrixexponentiale
End of explanation
"""
x = Symbol('x')
p = se... |
xmnlab/notebooks | probability/Probabilistic-Graphical-Model.ipynb | mit | from nxpd import draw
import networkx as nx
def draw_graph(
graph, labels=None
):
# create networkx graph
G = nx.DiGraph()
G.graph['dpi'] = 120
G.add_nodes_from(set([
graph[k1][k2]
for k1 in range(len(graph))
for k2 in range(len(graph[k1]))
]))
G.add_edges_from(gr... |
rhnvrm/mini-projects | adam/adam_implementation.ipynb | mit | %matplotlib inline
import numpy as np
import math
import matplotlib.pyplot as plt
"""
Explanation: Implementation of ADAM
This method computes individual adaptive learning rates for different parameters from estimates of first and second moments of the gradients; the name Adam is derived from adaptive moment estimatio... |
ga7g08/ga7g08.github.io | _notebooks/2015-08-22-Hierarchical-Linear-Regression-Models-In-PyMC3.ipynb | mit | N = 100
a_val = 2
mu_b_val = 2
sigma_b_val = 1
b = np.random.normal(mu_b_val, sigma_b_val, N)
xobs = np.random.uniform(0, 10, N)
yobs = a_val + b * xobs
plt.plot(xobs, yobs, "o")
plt.ylabel(r"$y_\mathrm{obs}$")
plt.xlabel(r"$x_\mathrm{obs}$")
plt.show()
"""
Explanation: Hierarchical Linear Regression Models in PyMC... |
batfish/pybatfish | jupyter_notebooks/Analyzing Routing Policies.ipynb | apache-2.0 | # Import packages
%run startup.py
from pybatfish.datamodel.route import BgpRouteConstraints
bf = Session(host="localhost")
# Initialize a network and snapshot
NETWORK_NAME = "example_network"
SNAPSHOT_NAME = "example_snapshot"
SNAPSHOT_PATH = "networks/route-analysis"
bf.set_network(NETWORK_NAME)
bf.init_snapshot(SN... |
undercertainty/ou_nlp | .ipynb_checkpoints/Untitled-checkpoint.ipynb | apache-2.0 | filename='semeval2013-task7/semeval2013-Task7-5way/beetle/train/Core/FaultFinding-BULB_C_VOLTAGE_EXPLAIN_WHY1.xml'
import pandas as pd
from xml.etree import ElementTree as ET
tree=ET.parse(filename)
"""
Explanation: A simple (ie. no error checking or sensible engineering) notebook to extract the student answer data... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.