repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
codediodeio/self-driving-car-projects | behavioral-cloning/.ipynb_checkpoints/ModelNotebook-checkpoint.ipynb | mit | data = pd.read_csv('data/driving_log.csv', header=None,
names=['center', 'left', 'right', 'angle', 'throttle', 'break', 'speed'])
print(data.ix[0].center)
data.sample()
def img_id(path):
return path.split('/IMG/')[1]
image_paths = data.center.apply(img_id).values.tolist()
image_paths[:5]
# y_a... |
sot/aimpoint_mon | fit_aimpoint_drift-2021-01.ipynb | bsd-2-clause | import re
import os
# See https://stackoverflow.com/questions/59119396/
# how-to-use-django-3-0-orm-in-a-jupyter-notebook-without-triggering-the-async-con
# os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
import sys
import tables
import matplotlib.pyplot as plt
import numpy as np
from astropy.time import Time
from as... |
planet-os/notebooks | api-examples/model-comparisons.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import dateutil.parser
import datetime
from urllib.request import urlopen, Request
import simplejson as json
def extract_reference_time(API_data_loc):
"""Find reference time that corresponds to most complete forecast. Should be the earliest valu... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/miroc6/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'miroc6', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MIROC
Source ID: MIROC6
Topic: Aerosol
Sub-Topics: Transport, Emissions, Concentra... |
thom056/ada-parliament-ML | 04-VotingProfile/TopicAnalysis.ipynb | gpl-2.0 | import pandas as pd
import glob
import os
import numpy as np
import matplotlib.pyplot as plt
import sklearn
import sklearn.ensemble
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score, train_test_split, cross_val_predict, learning_curve
import sklearn.metrics
%matplo... |
farfan92/SpringBoard- | logistic_regression/Mini_Project_Logistic_Regression.ipynb | mit | %matplotlib inline
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('display.notebook_repr_html', True)
import seaborn as sns
sns.set_s... |
jsharpna/DavisSML | lectures/lecture2/.ipynb_checkpoints/lecture2-checkpoint.ipynb | mit | ## Nonlinear example
x = np.arange(.05,1,.01)
y = np.sin(1/x) + np.random.normal(0,.25,len(x))
plt.plot(x,y,'.')
"""
Explanation: Model Selection and Bias-Variance Tradeoff
Stats 208: Lecture 2
Prof. Sharpnack
Lecture slides at course github page
Some content of these slides are from STA 251 notes and STA 141B lectu... |
danlurie/bdpdb | notebooks/Coordinate Lookup Testing.ipynb | mit | mask_stack_path = '/home/despoB/lesion/anat_preproc/mni_mask_stack.nii.gz'
mask_stack_img = nib.load(mask_stack_path)
mask_stack_data = mask_stack_img.get_data()
mask_stack_data.shape
"""
Explanation: Load Test Data
Load a pre-made 4D image containing binary lesion masks from multiple patients.
End of explanation
"... |
somma/ipython_notebook | python_async_stuffs/Coroutine_lecture.ipynb | mit | def countdown(n):
print '> counting down from {}'.format(n)
while n > 0:
yield n
n -= 1
print ''
print '< countdown'
for n in countdown(10):
print n,
"""
Explanation: [Part I] Introduction to Generators and Coroutines
generator
End of explanation
"""
# calling generator fucntion ... |
enbanuel/phys202-2015-work | assignments/assignment09/IntegrationEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy import integrate
"""
Explanation: Integration Exercise 1
Imports
End of explanation
"""
def trapz(f, a, b, N):
"""Integrate the function f(x) over the range [a,b] with N points."""
# YOUR CODE HERE
h = (b-a)/N
v = np.ara... |
rodabt/notebooks | 2_cargos_contrata.ipynb | mit | import pandas as pd
import pandas_profiling
import numpy as np
from pandasql import *
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import string
df = pd.read_pickle('sueldos_contrata.pkl')
pandas_profiling.ProfileReport(df)
"""
Explanation: Análisis de puestos
End of explanation
"""
q... |
desihub/desitarget | doc/nb/mock-targets-to-mocks.ipynb | bsd-3-clause | %%html
<style>
table {margin-left: 0 !important;}
</style>
import os
datadir = '{DESI_ROOT}/datachallenge/test-mockid'.format(**os.environ)
nside, healpix = 128, 104121
"""
Explanation: Mock Targets to Mock Properties
The goal of this notebook is to demonstrate how to use the target and truth catalogs generated by... |
edarin/population_simulator | src/data/DescriptionTablesReference.ipynb | agpl-3.0 | pd.read_csv("data/demographie/pop_age_sexe_2016.csv").head()
"""
Explanation: Les tables concernant l'âge et le sexe
Output : pop_age_sexe_2016.csv
Input :
Table générée à partir de pop-1janvier-fe.xls (https://www.insee.fr/fr/statistiques/1892086)
Source : Insee, estimations de population (résultats provisoires arr... |
mit-eicu/eicu-code | notebooks/lab.ipynb | mit | # Import libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import psycopg2
import getpass
import pdvega
# for configuring connection
from configobj import ConfigObj
import os
%matplotlib inline
# Create a database connection using settings from config file
config='../db/config.ini'
#... |
roatienza/Deep-Learning-Experiments | versions/2020/backprop/backprop.ipynb | mit | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
"""
Explanation: Backprop demo on a single unit linear MLP
This is a demonstration of how backpropagation works on a single unit MLP
End of explanation
"""
class Net(nn.Module):
def __init__(self):
super(Net, s... |
dhutchis/systemml | samples/jupyter-notebooks/Deep_Learning_Image_Classification.ipynb | apache-2.0 | !pip show systemml
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.cross_validation import train_test_split # module deprecated in 0.18
#from sklearn.model_selection import train_test_split # use this module for >=0.18
from sklearn ... |
folivetti/CRUFABC | ListaExercicios.ipynb | mit | G1 = nx.erdos_renyi_graph(10,0.4)
nx.draw_shell(G1)
G2 = nx.barabasi_albert_graph(10,3)
nx.draw_shell(G2)
G3 = nx.barabasi_albert_graph(10,4)
nx.draw_shell(G3)
"""
Explanation: Exercício 01: Calcule a distância média, o diâmetro e o coeficiente de agrupamento das redes abaixo.
End of explanation
"""
G4 = nx.baraba... |
EducationalTestingService/rsmtool | rsmtool/notebooks/summary/header.ipynb | apache-2.0 | import itertools
import json
import os
import re
import pickle
import platform
import time
from collections import defaultdict as dd
from functools import partial
from os.path import abspath, dirname, exists, join
from string import Template
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.st... |
rdipietro/jupyter-notebooks | tensorflow-scan-examples/TensorFlow Scan Examples.ipynb | apache-2.0 | from __future__ import division, print_function
import tensorflow as tf
def fn(previous_output, current_input):
return previous_output + current_input
elems = tf.Variable([1.0, 2.0, 2.0, 2.0])
elems = tf.identity(elems)
initializer = tf.constant(0.0)
out = tf.scan(fn, elems, initializer=initializer)
with tf.Sess... |
llclave/Springboard-Mini-Projects | Predicting Movie Ratings from Reviews Using Naive Bayes/Mini_Project_Naive_Bayes.ipynb | mit | %matplotlib inline
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from six.moves import range
# Setup Pandas
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('... |
ES-DOC/esdoc-jupyterhub | notebooks/fio-ronm/cmip6/models/sandbox-2/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: FIO-RONM
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Thermodynami... |
saashimi/code_guild | interactive-coding-challenges/stacks_queues/set_of_stacks/set_of_stacks_challenge.ipynb | mit | %run ../stack/stack.py
%load ../stack/stack.py
class StackWithCapacity(Stack):
def __init__(self, top=None, capacity=10):
# TODO: Implement me
pass
def push(self, data):
# TODO: Implement me
pass
def pop(self):
# TODO: Implement me
pass
def is_full(se... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-7s/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-7s', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-7S
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy B... |
xgrg/alfa | notebooks/Python for science BBRC/Python for neuroimaging.ipynb | mit | import nibabel as nib
fp = '/home/grg/upf/Data/RM/rch2.nii'
im = nib.load(fp)
print im.header.keys()
print im.header['pixdim']
%matplotlib inline
im.orthoview()
from matplotlib import pyplot as plt
import numpy as np
d_t1 = np.array(im.dataobj)
d2 = d_t1[35,:,:]
plt.imshow(d2)
fp2 = '/home/grg/upf/Data/RM/rch2_wm.ni... |
victorgcapone/data-science-portifolio | Are Models from a KFold CV similar enough to be IID?.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_boston
np.random.seed(123456)
boston = load_boston()
data = pd.DataFrame(boston['data'], columns=boston['feature_names'])
data.sample(5)
x = data
y = boston['target']
"""
Explanation: Introduction
IID (Independen... |
saashimi/code_guild | wk2/extras/linked_lists/partition/partition_challenge.ipynb | mit | %run ../linked_list/linked_list.py
%load ../linked_list/linked_list.py
class MyLinkedList(LinkedList):
def partition(self, data):
# TODO: Implement me
pass
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
P... |
JeffAbrahamson/MLWeek | theory/J1-1_introduction/probability.ipynb | gpl-3.0 | import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
import sklearn
import pandas as pd
%matplotlib inline
x = np.linspace(-100, 100, 201)
plt.plot(x, x * x)
"""
Explanation: Un ipython notebook garde ses résultats depuis la dernière fois, mais pas son état. Il convient donc re-exécuter depui... |
hunterherrin/phys202-2015-work | days/day11/Interpolation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
"""
Explanation: Interpolation
Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy.
End of explanation
"""
x = np.linspace(0,4*np.pi,10)
x
"""
Explanation: Overview
W... |
phoebe-project/phoebe2-docs | 2.1/tutorials/alternate_backends.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Advanced: Alternate Backends
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
import phoe... |
mne-tools/mne-tools.github.io | 0.23/_downloads/499a81f33500445fc2e1eac0be346d47/temporal_whitening.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import fit_iir_model_raw
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
raw_fname = d... |
kubeflow/pipelines | samples/contrib/e2e-outlier-drift-explainer/kfserving/kfserving_e2e_cifar10.ipynb | apache-2.0 | import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from alibi.explai... |
google-research/google-research | milking_cowmask/Generate_ImageNet_split_shards.ipynb | apache-2.0 | import os
os.environ['UNITTEST_ON_FORGE'] = '1'
import string
import random
import pickle
import zipfile
import io
import itertools
import time
import tensorflow as tf
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit
from matplotlib import pyplot as plt
import tqdm
import tensorflow_datas... |
cbpygit/pypmj | examples/Extensions explained - antenna.ipynb | gpl-3.0 | import numpy as np
import sys
sys.path.append('..')
import os
# os.environ['PYPMJ_CONFIG_FILE'] = '' # <- path to your configuration file
import pypmj as jpy
# jpy.import_jcmwave('') <- manual import if you do not have a configuration file
jpy.load_extension('antenna')
"""
Explanation: Imports and configuration
We i... |
danlamanna/scratch | notebooks/01_Example.ipynb | apache-2.0 | M
"""
Explanation: Welcome to the Geonotebook
GeoNotebook is an application that provides client/server enviroment with inteactive visualization and analysis capabilities using Jupyter notebook, GeoJS and other open source tools.
The example notesbooks in this directory will walk you through several of the features th... |
tensorflow/docs-l10n | site/zh-cn/hub/tutorials/tf2_object_detection.ipynb | apache-2.0 | #@title Copyright 2020 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 ... |
guyk1971/deep-learning | 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... |
GoogleCloudPlatform/cloudml-samples | notebooks/tensorflow/custom-prediction-routine-keras.ipynb | apache-2.0 | PROJECT_ID = "<your-project-id>" #@param {type:"string"}
! gcloud config set project $PROJECT_ID
"""
Explanation: Creating a custom prediction routine with Keras
<table align="left">
<td>
<a href="https://cloud.google.com/ml-engine/docs/tensorflow/custom-prediction-routine-keras">
<img src="https://cloud.g... |
tensorflow/docs-l10n | site/zh-cn/addons/tutorials/losses_triplet.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0
# 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 License is d... |
diegocavalca/Studies | programming/Python/tensorflow/exercises/Control_Flow_Solutions.ipynb | cc0-1.0 | from __future__ import print_function
import tensorflow as tf
import numpy as np
from datetime import date
date.today()
author = "kyubyong. https://github.com/Kyubyong/tensorflow-exercises"
tf.__version__
np.__version__
sess = tf.InteractiveSession()
"""
Explanation: Control Flow
End of explanation
"""
x = tf.r... |
trangel/Insight-Data-Science | general-docs/nlp-preprocessing/NLP-preprocessing.ipynb | gpl-3.0 | import pandas as pd
# read subset of data from csv file into panadas dataframe
df = pd.read_csv('data_files/1_100.csv')
# get rid of any missing text data
df = df[pd.notnull(df['full_text'])]
# for now, chosing one article to illustrate preprocessing
article = df['full_text'][939]
"""
Explanation: Natural Language ... |
jg1141/deep-learning-nanodegree | 20170209 Live Song Recommender/Song Recommender_Python.ipynb | mit | %matplotlib inline
import pandas
from sklearn.cross_validation import train_test_split
import numpy as np
import time
from sklearn.externals import joblib
import Recommenders as Recommenders
import Evaluation as Evaluation
"""
Explanation: Building a song recommender
End of explanation
"""
#Read userid-songid-liste... |
atulsingh0/MachineLearning | python-machine-learning/Assignment 1.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
from sklearn.datasets import load_breast_cancer
cancer = load_breast_cancer()
#print(cancer.DESCR) # Print the data set description
cancer
"""
Explanation: You are currently looking at version 1.1 of this notebook. To download notebooks and datafiles, as well as get help on Jup... |
qiuwch/unrealcv | client/examples/generate-images.ipynb | mit | import os, sys, time, re, json
import numpy as np
# from scipy import misc # for imread
# imread = misc.imread # use this instead of the imread in matplotlib
import cv2
imread = lambda x: cv2.imread(x)[:,:,(2,1,0)]
# Load matplotlib for plotting
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Gene... |
CCI-Tools/sandbox | notebooks/norman/xarray-ex-2.ipynb | gpl-3.0 | import xarray as xr
import numpy as np
import pandas as pd
import seaborn as sns # pandas aware plotting library
np.random.seed(123)
times = pd.date_range('2000-01-01', '2001-12-31', name='time')
annual_cycle = np.sin(2 * np.pi * (times.dayofyear / 365.25 - 0.28))
base = 10 + 15 * annual_cycle.reshape(-1, 1)
tmin_va... |
aaai2018-paperid-62/aaai2018-paperid-62 | paper_selection.ipynb | mit | from glob import glob
accepted_papers = {}
track_files = glob('data/accepted*'.format(dir))
for file in track_files:
conference = file.split('_')[-1].strip('.txt')
accepted_papers[conference] = []
with open(file, 'r') as f:
for line in f:
accepted_papers[conference].append(line)
"""
Ex... |
phoebe-project/phoebe2-docs | development/tutorials/limb_darkening.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Limb Darkening
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
logger = phoebe.logger()
b = phoebe.default_binary()
... |
sz2472/foundations-homework | homework11/zhao_shengying_homework_11.ipynb | mit | df.dtypes #dtype: Data type for data or columns
print("The data type is",(type(df['Plate ID'][0])))
"""
Explanation: 1. I want to make sure my Plate ID is a string. Can't lose the leading zeroes!
End of explanation
"""
df['Vehicle Year'] = df['Vehicle Year'].replace("0","NaN") #str.replace(old, new[, max])
df.head(... |
PyladiesMx/Empezando-con-Python | NetworkX/Networkx.ipynb | mit | %matplotlib inline
import networkx as nx
import matplotlib.pyplot as gr
import scipy as sc
G=nx.Graph()
G.graph
"""
Explanation: Análisis de redes en Python (Networkx)
Bienvenidos :D
En esta sesión aprenderemos a utilizar la librería "Networkx" (http://networkx.readthedocs.io/en/networkx-1.11/index.html) que es una ... |
zonemercy/Kaggle | quora/solution/linguistic_pre_processing.ipynb | mit | from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem import LancasterStemmer
stemmer = LancasterStemmer()
lemmer = WordNetLemmatizer()
"""
Explanation: I've seen a couple of nice kernels here, but no one explained the importance of a morphological pre-processing of the data. So I decided to compare two appr... |
rjenc29/numerical | course/matplotlib/3. Vocabulary.ipynb | mit | # %load exercises/3.1-colors.py
t = np.arange(0.0, 5.0, 0.2)
plt.plot(t, t, , t, t**2, , t, t**3, )
plt.show()
"""
Explanation: Vocabulary
In the previous parts, you learned how matplotlib organizes plot-making by figures and axes. We broke down the components of a basic figure and learned how to create them. You als... |
icrtiou/coursera-ML | ex2-logistic regression/3- regularized logistic regression.ipynb | mit | sns.set(context="notebook", style="ticks", font_scale=1.5)
sns.lmplot('test1', 'test2', hue='accepted', data=df,
size=6,
fit_reg=False,
scatter_kws={"s": 50}
)
plt.title('Regularized Logistic Regression')
"""
Explanation: visualize data
End of explanation
"""
x1 = np.a... |
metpy/MetPy | v0.8/_downloads/Natural_Neighbor_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import ConvexHull, Delaunay, delaunay_plot_2d, Voronoi, voronoi_plot_2d
from scipy.spatial.distance import euclidean
from metpy.gridding import polygons, triangles
from metpy.gridding.interpolation import nn_point
"""
Explanation: Natural Neighbor ... |
xunilrj/sandbox | courses/MITx/MITx 6.86x Machine Learning with Python-From Linear Models to Deep Learning/project0/Part1.ipynb | apache-2.0 | 6*7
def tokenize(text):
return text.split(" ")
text = "In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley"
print(tokenize(text))
"""
Explanation: 6.86x - Introduction to ML Packages (Part 1)
This tutorial is designed to provide a bird's eye view of the... |
4dsolutions/Python5 | PYT_DS_Clustering.ipynb | mit | # Authors: Gael Varoquaux
# License: BSD 3 clause (C) INRIA 2014
print(__doc__)
from time import time
import numpy as np
from scipy import ndimage
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: PYT-DS SAISOFT
<a data-flickr-embed="true" href="https://www.flickr.com/photos/kirbyurner/27963... |
WNoxchi/Kaukasos | FAI_old/lesson3/L3HW_SF.ipynb | mit | import keras
import os, sys
import numpy as np
import pandas as pd
from glob import glob
from keras.optimizers import Adam
from keras.layers.core import Dense
from keras.preprocessing import image
# will need this to access any libraries in superdirectories
sys.path.insert(1, os.path.join(os.getcwd(), '../utils'))
imp... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/tutorials/Beyond_Linear_Programming.ipynb | apache-2.0 | import sys
try:
import cplex
except:
if hasattr(sys, 'real_prefix'):
#we are in a virtual env.
!pip install cplex
else:
!pip install --user cplex
"""
Explanation: Tutorial: Beyond Linear Programming, (CPLEX Part2)
This notebook describes some special cases of LP, as well as some oth... |
rchaks/retrieve-and-rank-tuning | examples/2.0 - Evaluate RnR Performance.ipynb | apache-2.0 | import sys
from os import path, getcwd
import json
from tempfile import mkdtemp
import glob
sys.path.extend([path.abspath(path.join(getcwd(), path.pardir))])
from rnr_debug_helpers.utils.rnr_wrappers import RetrieveAndRankProxy, \
RankerProxy
from rnr_debug_helpers.utils.io_helpers import load_config, smart_file_o... |
HazyResearch/metal | metal/contrib/backends/CDR.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import sys
import metal
import torch
from torch.utils.data import Dataset, DataLoader
print('PyTorch: ', torch.__version__)
print('MeTaL: ', metal.__version__)
print('Python: ', sys.version)
print('Python: ', sys.version_info)
"""
Explanation: Metal... |
google/starthinker | colabs/bigquery_to_sheet.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: BigQuery Query to Sheet
Copy the contents of a query into a Google Sheet.
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 may ... |
strandbygaard/deep-learning | tensorboard/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'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 base... |
oudalab/fajita | otherHelperCode/jupyter_ldacluster/lda_cluster_smallsizetest_english.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 = [... |
shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/HvassLabsTutorials/01_Simple_Linear_Model.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
"""
Explanation: TensorFlow Tutorial #01
Simple Linear Model
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
This tutorial demonstrates the basic workflow o... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/10_recommend/content_based_by_hand.ipynb | apache-2.0 | !pip install tensorflow==1.13.1
"""
Explanation: Content Based Filtering by hand
This lab illustrates how to implement a content based filter using low level Tensorflow operations.
The code here follows the technique explained in Module 2 of Recommendation Engines: Content Based Filtering.
To run this lab, we need to ... |
rhiever/scipy_2015_sklearn_tutorial | notebooks/01.4 Training and Testing Data.ipynb | cc0-1.0 | from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
iris = load_iris()
X, y = iris.data, iris.target
classifier = KNeighborsClassifier()
"""
Explanation: Training and Testing Data
To evaluate how well our supervised models generalize, we can split our data into a training and a ... |
ozak/geopandas | examples/overlays.ipynb | bsd-3-clause | from IPython.core.display import Image
Image(url="http://docs.qgis.org/testing/en/_images/overlay_operations.png")
"""
Explanation: Spatial overlays allow you to compare two GeoDataFrames containing polygon or multipolygon geometries
and create a new GeoDataFrame with the new geometries representing the spatial combi... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/launching_into_ml/labs/explore_data.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
from google.cloud import bigquery
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
"""
Explanation: Explore and create ML datasets
In this notebook, we will explore data corresponding to taxi rides in New Yo... |
rcrehuet/Python_for_Scientists_2017 | notebooks/2_1_Looping_over_lists.ipynb | gpl-3.0 | week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
"""
Explanation: Looping over lists
Iterating over lists can be confusing. You can mistake looping over the list elements for list items. This simple notbooks aims at pointing the differences.
Let there be the following list:
End of ... |
GoogleCloudPlatform/training-data-analyst | quests/rl/dqn/dqns_on_gcp.ipynb | apache-2.0 | %%bash
BUCKET=<your-bucket-here> # Change to your bucket name
JOB_NAME=dqn_on_gcp_$(date -u +%y%m%d_%H%M%S)
REGION='us-central1' # Change to your bucket region
IMAGE_URI=gcr.io/qwiklabs-resources/rl-qwikstart/dqn_on_gcp@sha256:326427527d07f30a0486ee05377d120cac1b9be8850b05f138fc9b53ac1dd2dc
gcloud ai-platform jobs sub... |
CAChemE/curso-python-datos | notebooks/030-SciPy.ipynb | bsd-3-clause | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: SciPy
SciPy es paquete que incluye una colección de algoritmos matemáticos y funciones construidas sobre el paquete NumPy.
Dirigida al mismo tipo de usuarios que los de aplicaciones como MATLAB, GNU Octave, y Scilab, SciPy contiene... |
arkottke/pysra | examples/example-05.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import pysra
%matplotlib inline
# Increased figure sizes
plt.rcParams["figure.dpi"] = 120
"""
Explanation: Example 5: Simulated nonlinear property
Generate simulated nonlinear properties. This example just shows an example of generating the simulated profiles.
End ... |
ntftrader/ntfdl | examples/notebooks/Intraday trades.ipynb | mit | %matplotlib inline
%pylab inline --no-import-all
pylab.rcParams['figure.figsize'] = (18, 10)
"""
Explanation: ntfdl - intraday example
This example shows how to get all trades (ticks) from the last trading day for Statoil ASA (STL). Ntfdl uses free and accessible data from the norwegian broker http://www.netfonds.no
E... |
davidbjourno/finding-stories-in-data | finding-stories-in-data.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
%matplotlib inline
"""
Explanation: Finding stories in data with Python and Jupyter notebooks
Journocoders London, April 13, 2017
David Blood/@dav... |
atlury/deep-opencl | cs480/23 Linear Dimensionality Reduction.ipynb | lgpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def mvNormalRand(n,mean,sigma):
mean = np.array(mean) # to allow entry of values as simple lists
sigma = np.array(sigma) ... |
quantopian/research_public | notebooks/data/quandl.cboe_vxxle/notebook.ipynb | apache-2.0 | # For use in Quantopian Research, exploring interactively
from quantopian.interactive.data.quandl import cboe_vxxle as dataset
# import data operations
from odo import odo
# import other libraries we will use
import pandas as pd
# Let's use blaze to understand the data a bit using Blaze dshape()
dataset.dshape
# And... |
fastai/course-v3 | nbs/dl2/09c_add_progress_bar.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#export
from exp.nb_09b import *
import time
from fastprogress.fastprogress import master_bar, progress_bar
from fastprogress.fastprogress import format_time
"""
Explanation: Adding progress bars to Learner
End of explanation
"""
path = datasets.untar_data(data... |
scotthuang1989/Python-3-Module-of-the-Week | data_structure/queue.ipynb | apache-2.0 | import queue
q = queue.Queue()
for i in range(5):
q.put(i)
while not q.empty():
print(q.get(), end=' ')
"""
Explanation: Purpose
Provide Thread-Safe FIFO Implementation
multi-producer, multi-consumer queue
Basic FIFO Queue
The Queue class implements a basic first-in, first-out container. Element are ... |
robertoalotufo/ia898 | 2S2018/09 Translacao periodica.ipynb | mit | %matplotlib inline
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
f = mpimg.imread('../data/cameraman.tif')
plt.imshow(f,cmap='gray'),plt.title('original')
H,W = f.shape
dh,dw = (-30,-80)
dhi = (-dh + H) % H # mapeamento inverso igual feito em iaffine (inversa de T)
dwi = (-dw + W... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/prod/.ipynb_checkpoints/n09_dyna_q_learner-checkpoint.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
from multiprocessing import Pool
%matplotlib inline
%pylab inline
pylab.rcPar... |
liupengyuan/python_tutorial | chapter4/jieba_wordcloud.ipynb | mit | # encoding=utf-8
import jieba
seg_list = jieba.cut("我来到北京清华大学", cut_all=True)
print("Full Mode: " + "/ ".join(seg_list)) # 全模式
seg_list = jieba.cut("我来到北京清华大学", cut_all=False)
print("Default Mode: " + "/ ".join(seg_list)) # 精确模式
seg_list = jieba.cut("他来到了网易杭研大厦") # 默认是精确模式
print(", ".join(seg_list))
seg_list = j... |
adrn/tutorials | notebooks/UVES/UVES.ipynb | cc0-1.0 | # Set up matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Analyzing UVES Spectroscopy with Astropy
Authors
Moritz Guenther, Miguel de Val-Borro, Emily Rice (Learning Goals & formatting)
Learning Goals
Input/Output: Read in spectral data from a list of FITS files using astropy.io and astr... |
Bismarrck/deep-learning | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
egillanton/Udacity-SDCND | 1. Computer Vision and Deep Learning/P2 Traffic Sign Classifier/P2.ipynb | mit | # Load pickled data
import pickle
# TODO: Fill this in based on where you saved the training and testing data
training_file = ?
validation_file=?
testing_file = ?
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(validation_file, mode='rb') as f:
valid = pickle.load(f)
with open(test... |
CORE-GATECH-GROUP/serpent-tools | examples/BranchToNodalDiffusion.ipynb | mit | import os
coeFile = os.path.join(
os.environ["SERPENT_TOOLS_DATA"],
"demo.coe")
"""
Explanation: Copyright (c) 2017-2020 Serpent-Tools developer team, GTRC
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS... |
Alexoner/skynet | notebooks/TinyImageNet_and_ModelEnsembles.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from time import time
%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 modules
# see http:/... |
elenduuche/deep-learning | tensorboard/Anna_KaRNNa_Summaries.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'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 base... |
a301-teaching/a301_code | notebooks/hydrostatic_solution.ipynb | mit | from matplotlib import pyplot as plt
import matplotlib.ticker as ticks
import urllib
import numpy as np
from a301utils.a301_readfile import download
import h5py
filename='std_soundings.h5'
download(filename)
"""
Explanation: Scale heights for typical atmospheric soundings
Plot McClatchey's US Standard Atmospheres
The... |
sorig/shogun | doc/ipython-notebooks/intro/Introduction.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
#To import all Shogun classes
from shogun import *
"""
Explanation: Machine Learning with Shogun
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> as a part of <a href="http://www.... |
esa-as/2016-ml-contest | ar4/ar4_submission2_VALIDATION.ipynb | apache-2.0 | # Import
from __future__ import division
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['figure.figsize'] = (20.0, 10.0)
inline_rc = dict(mpl.rcParams)
from classification_utilities import make_facies_log_plot
import pandas as pd
import numpy as np
#import seaborn as sns
from... |
Hebali/learning_machines | tensorflow_tutorials/Tutorial_03_LoadingData.ipynb | mit | # Import TensorFlow library:
import tensorflow as tf
# Import matplotlib and numpy libraries (used to show image):
%matplotlib inline
from matplotlib.pyplot import imshow
import numpy as np
"""
Explanation: Learning Machines
Taught by Patrick Hebron at NYU/ITP, Fall 2017
TensorFlow Basics: "Loading Data"
End of expla... |
nholtz/structural-analysis | matrix-methods/frame2d/40-test-KG82.ipynb | cc0-1.0 | from Frame2D import Frame2D
from IPython import display
display.Image('data/KG82.d/KG82a.jpg')
"""
Explanation: Kulak & Grondin Example 8.2
This example is from "Limit States Design in Structural Steel", Ninth Edition, CISC, by Kulak and Grondin.
It illustrates using the fictitious load method to determine second-orde... |
pierresendorek/tensorflow_crescendo | tensorflow_fit_gaussian_mixture_model.ipynb | lgpl-3.0 | w_true = [3,3,3]
w_true = w_true / np.sum(w_true)
mu_true = [3,10,20]
sigma_true = [2,4,1]
"""
Explanation: Coefficients to find
End of explanation
"""
def draw_from_gaussian_mixture(w, mu, sigma, n_samples):
samples = []
for i in range(n_samples):
idx_comp = np.random.multinomial(1,w).argmax()
... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_topo_compare_conditions.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne.viz import plot_evoked_topo
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
... |
CrowdTruth/CrowdTruth-core | tutorial/notebooks/.ipynb_checkpoints/Sparse Multiple Choice Task - Event Extraction-checkpoint.ipynb | apache-2.0 | import pandas as pd
test_data = pd.read_csv("../data/event-text-sparse-multiple-choice.csv")
test_data.head()
"""
Explanation: CrowdTruth for Sparse Multiple Choice Tasks: Event Extraction
In this tutorial, we will apply CrowdTruth metrics to a sparse multiple choice crowdsourcing task for Event Extraction from sente... |
jlawman/jlawman.github.io | content/sklearn/.ipynb_checkpoints/Metrics - Classification Report Breakdown (Precision, Recall, F1)-checkpoint.ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
from sklearn.datasets import make_blobs
data, labels = make_blobs(n_features=2, centers=2,cluster_std=2,random_state=3)
plt.scatter(data[:,0], data[:,1], c = labels, cmap='coolwarm');
"""
Explanation: Dummy data for classification
End of ex... |
mne-tools/mne-tools.github.io | 0.19/_downloads/11dfe5b16c319f3332711a4e798a0cef/plot_stats_cluster_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Non-parametri... |
planetlabs/notebooks | jupyter-notebooks/analytics/quickstart/02_fetching_feed_results.ipynb | apache-2.0 | import os
import requests
# if your Planet API Key is not set as an environment variable, you can paste it below
API_KEY = os.environ.get('PL_API_KEY', 'PASTE_YOUR_KEY_HERE')
# alternatively, you can just set your API key directly as a string variable:
# API_KEY = "YOUR_PLANET_API_KEY_HERE"
# construct auth tuple fo... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.proper.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.proper(prune=True, backward=False)
Create an equivalent automaton without any spontaneous transitions (i.e., transitions labeled by \e).
Arguments:
- prune whether to remove the states that become inaccessible (or non coaccsessible in the case of forward closure).
- backward whet... |
remenska/iSDM | notebooks/old/DemoFramework-GBIF.ipynb | apache-2.0 | from iSDM.species import GBIFSpecies
my_species = GBIFSpecies(name_species="Etheostoma_blennioides")
my_species.name_species
"""
Explanation: Working with GBIF data in presence point records
End of explanation
"""
%matplotlib inline
import logging
root = logging.getLogger()
root.addHandler(logging.StreamHandler())... |
matousc89/Python-Adaptive-Signal-Processing-Handbook | notebooks/AR_identification.ipynb | mit | from __future__ import print_function
import numpy as np
import matplotlib.pylab as plt
import signalz
import padasip as pa
%matplotlib inline
plt.style.use('ggplot') # nicer plots
np.random.seed(52102) # always use the same random seed to make results comparable
"""
Explanation: Comparison of Adaptive Filters (LMS... |
karlstroetmann/Algorithms | Python/Chapter-05/Quick-Select.ipynb | gpl-2.0 | def quickSelect(L, k):
assert k <= len(L), f'quickSelect({L}, {k})'
if len(L) == k:
return L
x, *R = L
S = [y for y in R if y <= x]
B = [y for y in R if y > x]
if k <= len(S):
return quickSelect(S, k)
if k == len(S) + 1:
return S + [x]
return S + [x] + quickSele... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.