repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
AllenDowney/ThinkBayes2
soln/chap05.ipynb
mit
# If we're running on Colab, install empiricaldist # https://pypi.org/project/empiricaldist/ import sys IN_COLAB = 'google.colab' in sys.modules if IN_COLAB: !pip install empiricaldist # Get utils.py from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename...
mne-tools/mne-tools.github.io
0.20/_downloads/36ac16a286b47b66f1b51a959c65b5b9/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # 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 f_...
JannesKlaas/MLiFC
Week 4/Ch. 18 - Temporal Order Matters.ipynb
mit
from keras.datasets import imdb from keras.preprocessing import sequence max_words = 10000 # Our 'vocabulary of 10K words max_len = 500 # Cut texts after 500 words # Get data from Keras (x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=max_words) print(len(x_train), 'train sequences') print(len(x_test...
quantumlib/ReCirq
docs/hfvqe/quickstart.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...
AhmetHamzaEmra/Deep-Learning-Specialization-Coursera
Convolutional Neural Networks/Keras+-+Tutorial+-+Happy+House+v2.ipynb
mit
import numpy as np from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D from keras.models import Model from keras.preprocessing import im...
spacy-io/thinc
examples/03_pos_tagger_basic_cnn.ipynb
mit
!pip install "thinc>=8.0.0a0" "ml_datasets>=0.2.0a0" "tqdm>=4.41" """ Explanation: Basic CNN part-of-speech tagger with Thinc This notebook shows how to implement a basic CNN for part-of-speech tagging model in Thinc (without external dependencies) and train the model on the Universal Dependencies AnCora corpus. The t...
mne-tools/mne-tools.github.io
dev/_downloads/d7719f60a0c257a5313f06f110154ff3/20_dipole_fit.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.forward import make_forward_dipole from mne.evoked import combine_evoked from mne.simulation import simulate_evoked from nilearn.plotting import plot_anat from nilearn.datasets import load_mni152_template data_path = mne.data...
eyaltrabelsi/my-notebooks
Lectures/Debugging Notebooks.ipynb
mit
import random def find_max (values): max = 0 print(f"Initial max is {max}") for val in values: if val > max: max = val return max sample = random.sample(range(100), 10) find_max(sample) """ Explanation: Debugging Notebooks Naive Way - print End of explanation """ import random de...
csiu/100daysofcode
datamining/api-reddit.ipynb
mit
import yaml import praw import nltk from nltk.classify import NaiveBayesClassifier from nltk.corpus import subjectivity from nltk.sentiment import SentimentAnalyzer from nltk.sentiment.util import * from nltk import tokenize from nltk.sentiment.vader import SentimentIntensityAnalyzer import pandas as pd import matp...
esumitra/minecraft-programming
notebooks/Adventure3.ipynb
mit
import sys # sys.path.append('/Users/esumitra/workspaces/mc/mcpipy') # Run this once before starting your tasks import mcpi.minecraft as minecraft import mcpi.block as block import time mc = minecraft.Minecraft.create() """ Explanation: Superpowers for Steve With our newly learned programming skills let's give Steve ...
ML4DS/ML4all
TM4.DTUCourse/notebook/DTU02901_student.ipynb
mit
# Common imports import numpy as np # import pandas as pd # import os from os.path import isfile, join # import scipy.io as sio # import scipy import zipfile as zp # import shutil # import difflib """ Explanation: Exploring and undertanding documental databases with topic models and graph analysis Exercise notebook ...
YaleDHLab/lab-workshops
machine-learning/numerical-optimization.ipynb
mit
import matplotlib.pyplot as plt import numpy as np %matplotlib inline np.random.seed(13) # identify the number of houses to include in the dataset n_observations = 15 # generate a price and square footage value for each house prices = np.linspace(200, 400, num=n_observations) footage = np.linspace(1000, 2000, num=n_...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/Word2Vec/3_word2vec_activity.ipynb
apache-2.0
reset -fs import collections import math import os from pprint import pprint import random import urllib.request import zipfile import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from sklearn.manifold import TSNE %matplotlib inline """ Explanation: Apply word2vec to dataset Download some...
mayankjohri/LetsExplorePython
Section 1 - Core Python/Chapter 02 - Data Types Part - 1/String.ipynb
gpl-3.0
#### Standard String Examples: friend = 'Chandu\tNalluri' print(friend) manager_details = "# Roshan Musheer:\nExcellent Manager and human being." print(manager_details) """ Explanation: String Strings are Python builtins datatype for handling text. They are immutable thus you can not add, remove or updated any char...
lileiting/goatools
notebooks/goea_nbt3102_all_study_genes.ipynb
bsd-2-clause
# Get http://geneontology.org/ontology/go-basic.obo from goatools.base import download_go_basic_obo obo_fname = download_go_basic_obo() """ Explanation: Run a GOEA. Print study genes as either IDs symbols We use data from a 2014 Nature paper: Computational analysis of cell-to-cell heterogeneity in single-cell RNA-se...
woters/ds101
2-sklearn.ipynb
mit
from IPython.display import Image Image("images/ml-model.png", width=500) """ Explanation: 2 - Intro в Scikit-learn Цели Основные понятия: Модели Кластеризация, Классификация, Регрессия Fit, Predict, Evaluate Accuracy, confusion matrix Overfitting, training/test data, and crossvalidation API: model.fit() model...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/migration/UJ1 Vertex SDK AutoML Image Classification.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex AI: Vertex AI Migration: AutoML Image Classification <table align="left"> <td> <a ...
jskksj/cv2stuff
cv2stuff/notebooks/ConfigParser.ipynb
isc
config = configparser.ConfigParser() config.sections() config.read('example.ini') config.sections() 'bitbucket.org' in config 'bytebong.com' in config config['bitbucket.org']['User'] config['DEFAULT']['Compression'] topsecret = config['topsecret.server.com'] topsecret['ForwardX11'] topsecret['Port'] for key i...
ecervera/mindstorms-nb
task/motors.ipynb
mit
from functions import connect, forward, backward, stop, left, right, disconnect, next_notebook from time import sleep connect() # Executeu, polsant Majúscules + Enter """ Explanation: Moviments bàsics del robot El robot té dos motors, que controlen cadascuna de les rodes amb uns engranatges. Estan connectats amb cab...
drphilmarshall/OM10
examples/LSST/OM10_LSSTDESC.ipynb
mit
import om10 import os, numpy as np db = om10.DB(catalog=os.path.expandvars("$OM10_DIR/data/qso_mock.fits")) db.select_random(maglim=22.0,area=18000.0,IQ=0.75) good = db.sample[np.where(\ (db.sample['IMSEP'] > 1.0) * \ (db.sample['APMAG_I'] < 21.0) * \ (np.max(db.sample['DELAY'],axis=1) > 10.0...
yihaochen/FLASHtools
xray/xray_APEC_emissivity.ipynb
gpl-2.0
h5f = h5py.File('apec_emissivity_v2.h5', 'r') """ Explanation: Read the hdf5 file using h5py End of explanation """ for k, v in h5f.items(): print(k, v) """ Explanation: It works similar to a dictionary in python. We can print the keys and values in this file. End of explanation """ h5f['E'].value """ Explan...
beyondvalence/biof509_wtl
Wk03-OOP/Wk03-Paradigms.ipynb
mit
primes = [] i = 2 while len(primes) < 25: for p in primes: if i % p == 0: break else: primes.append(i) i += 1 print(primes) """ Explanation: Week 3 - Programming Paradigms Learning Objectives List popular programming paradigms Demonstrate object oriented programming Compare pr...
jc091/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...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/solutions/serving_ml_prediction.ipynb
apache-2.0
PROJECT = "cloud-training-demos" # Replace with your PROJECT BUCKET = PROJECT REGION = "us-central1" # Choose an available region for Cloud MLE TFVERSION = "2.6" # TF version for CMLE to use import os os.environ["BUCKET"] = BUCKET os.environ["PROJECT"] = PROJECT os.environ["REGION"] = REGIO...
sinkap/bart
notebooks/thermal/Thermal.ipynb
apache-2.0
import trappy config = {} # TRAPpy Events config["THERMAL"] = trappy.thermal.Thermal config["OUT"] = trappy.cpu_power.CpuOutPower config["IN"] = trappy.cpu_power.CpuInPower config["PID"] = trappy.pid_controller.PIDController config["GOVERNOR"] = trappy.thermal.ThermalGovernor # Control Temperature config["CONTROL_T...
cjam/deep-onc
notebooks/keras-mnist-example.ipynb
mit
# matplotlib is used for...you guessed it: plotting! import matplotlib.pyplot as plt # This next line is a Jupyter directive. It tells Jupyter that we want our plots to show # up right below the code that creates them. %matplotlib inline import tensorflow as tf from keras import backend,__version__ as keras_version ...
walkon302/CDIPS_Recommender
notebooks/Dimensionality_Reduction_on_Features.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import seaborn import pandas as pd from sklearn.decomposition import PCA import pickle %matplotlib inline # load smaller user behavior dataset user_profile = pd.read_pickle('../data_user_view_buy/user_profile_items_nonnull_features_20_mins_5_views_v2_sample1000.pkl') ...
pablosv/memexp
abalysis.ipynb
gpl-3.0
# General libraries import os import pickle import numpy as np # Plot, in nb, only when .show() is called import matplotlib.pyplot as plt %matplotlib notebook plt.ioff() # Personal libraries import tools.evaluation as ev import tools.plot as pt """ Explanation: Script that analyzes the results from kinetic simulati...
intel-analytics/analytics-zoo
docs/docs/colab-notebook/orca/quickstart/keras_lenet_mnist.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
planetlabs/notebooks
jupyter-notebooks/analytics/user-guide/03_change_detection.ipynb
apache-2.0
import os import requests # Configure Auth and Base URL # Planet Analytics API base URL PAA_BASE_URL = "https://api.planet.com/analytics/" # API Key Config API_KEY = os.environ['PL_API_KEY'] # Alternatively, you can just set your API key directly as a string variable: # API_KEY = "YOUR_PLANET_API_KEY_HERE" # Setup...
qutip/qutip-notebooks
examples/trilinear.ipynb
lgpl-3.0
%pylab inline from qutip import * import time #number of states for each mode N0=8 N1=8 N2=8 K=1.0 #damping rates gamma0=0.1 gamma1=0.1 gamma2=0.4 alpha=sqrt(3)#initial coherent state param for mode 0 epsilon=0.5j #sqeezing parameter tfinal=4.0 dt=0.05 tlist=arange(0.0,tfinal+dt,dt) taulist=K*tlist #non-dimensional t...
geratarra/Machine-Learning
Tareas/Logistic Regression/regresion_logistica.ipynb
gpl-2.0
%matplotlib inline from scipy.stats import logistic import numpy as np import matplotlib.pyplot as plt from IPython.display import Image # Esto es para desplegar imágenes en la libreta """ Explanation: Regresión logística En esta libreta vamos a desarrollar los algoritmos de regresión logística, y vamos a aplicar los...
sarahmid/programming-bootcamp-v2
lab7_exercises.ipynb
mit
import imp my_utils = imp.load_source('my_utils', '../utilities/my_utils.py') #CHANGE THIS PATH # test that this worked print "Test my_utils.gc():", my_utils.gc("ATGGGCCCAATGG") print "Test my_utils.reverse_compl():", my_utils.reverse_compl("GGGGTCGATGCAAATTCAAA") print "Test my_utils.read_fasta():", my_utils.read_fas...
bjshaw/phys202-2015-work
assignments/assignment10/ODEsEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 3 Imports End of explanation """ g = 9.81 # m/s^2 l = 0.5 # length of pendulum...
Illumina/interop
docs/src/Tutorial_05_Imaging_Table.ipynb
gpl-3.0
run_folder = r"" """ Explanation: Using the Illumina InterOp Library in Python: Part 5 Install If you do not have the Python InterOp library installed, then you can do the following: $ pip install interop You can verify that InterOp is properly installed: $ python -m interop --test Before you begin If you plan to us...
akchinSTC/systemml
samples/jupyter-notebooks/SystemML-PySpark-Recommendation-Demo.ipynb
apache-2.0
!pip show systemml %load_ext autoreload %autoreload 2 %matplotlib inline import numpy as np import matplotlib.pyplot as plt from systemml import MLContext, dml # pip install systeml plt.rcParams['figure.figsize'] = (10, 6) """ Explanation: SystemML PySpark Recommendation Demo This demonstrates using SystemML for pr...
kadircet/CENG
783/HW1/task5_next_char.ipynb
gpl-3.0
import random import numpy as np from metu.data_utils import load_nextchar_dataset, plain_text_file_to_dataset 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' ...
gassantos/ML4Edatics
Relatório de Aprendizado de Máquina - Trabalho 02 (LoadTXT).ipynb
gpl-3.0
#import os import pandas as pd import numpy as np import matplotlib as plt from numpy import loadtxt, where, append, zeros, ones, array, linspace, logspace from pylab import scatter, show, legend, xlabel, ylabel #%matplotlib inline # Carregando o arquivo gerado pelo MATLAB #import scipy.io #mat = scipy.io.loadmat('...
mne-tools/mne-tools.github.io
0.17/_downloads/dc0d85321d22190ec4d4c4394d0057f4/plot_opm_data.ipynb
bsd-3-clause
# sphinx_gallery_thumbnail_number = 4 import os.path as op import numpy as np import mne from mayavi import mlab data_path = mne.datasets.opm.data_path() subject = 'OPM_sample' subjects_dir = op.join(data_path, 'subjects') raw_fname = op.join(data_path, 'MEG', 'OPM', 'OPM_SEF_raw.fif') bem_fname = op.join(subjects_d...
mayankjohri/LetsExplorePython
Section 2 - Advance Python/Chapter S2.01 - Functional Programming/n/0 - Introduction to Programming Paradigm.ipynb
gpl-3.0
L = [1, 2, 4 , 6, 5, 7, 3] """ Explanation: Introduction to Programming Paradigms Imperative: It uses statements that change a program's state. It focuses on describing how a program operates. It is useful in manipulating data structures and produces elegant & simple code. In computer science, imperative programmin...
mayank-johri/LearnSeleniumUsingPython
Section 2 - Advance Python/Chapter S2.01 - Functional Programming/03_map_reduce_and_filter.ipynb
gpl-3.0
names = [ "Manish", "Aalok", "Mayank","Durga"] lst = [] for name in names: lst.append(len(name)) print(lst) names = ("Manish", "Aalok", "Mayank","Durga") tmp = map(len, names) print(tmp) lst = tuple(tmp) print(lst) # This is a map that squares every number in the passed collection: power = map(lambda x: ...
tpin3694/tpin3694.github.io
machine-learning/minibatch_k-means_clustering.ipynb
mit
# Load libraries from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.cluster import MiniBatchKMeans """ Explanation: Title: Mini-Batch k-Means Clustering Slug: minibatch_k-means_clustering Summary: How to conduct mini-batch k-means clustering in scikit-learn. Date: 2017-09-22 12:...
bocklund/notebooks
atomate/Cu-Mg-prlworkflows-example.ipynb
mit
from fireworks import LaunchPad # lpad = LaunchPad.auto_load() lpad = LaunchPad.from_file('/Users/brandon/.fireworks/my_launchpad.yaml') """ Explanation: Cu-Mg workflows Goal: fully describe the Cu-Mg system with DFT calculations Phases There are 5 phases in Cu-Mg that will be described with the following models Phase...
RaRe-Technologies/gensim
docs/src/auto_examples/tutorials/run_doc2vec_lee.ipynb
lgpl-2.1
import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) """ Explanation: Doc2Vec Model Introduces Gensim's Doc2Vec model and demonstrates its use on the Lee Corpus &lt;https://hekyll.services.adelaide.edu.au/dspace/bitstream/2440/28910/1/hdl_28910.pdf&gt;__. End of ex...
mathcoding/programming
notebooks/Lab1_Introduzione.ipynb
mit
345 """ Explanation: Elementi di Programmazione Un linguaggio di programmazione serve sia per istruire una macchina ad eseguire dei conti, che per organizzare le nostre idee su come quei conti devono essere eseguiti. Per questo, nella scelta di un linguaggio di programmazione, dobbiamo tener presente quali sono gli st...
rustychris/stomel
examples/refine_existing_grid.ipynb
gpl-2.0
import paver import trigrid import matplotlib.pyplot as plt import numpy as np import field %matplotlib notebook # Load and display a 25k cell grid of San Francisco Bay p=paver.Paving(suntans_path='/home/rusty/models/suntans/spinupdated/rundata/original_grid') fig,ax=plt.subplots() p.tg_plot() ; """ Explanation: Re...
dnc1994/MachineLearning-UW
ml-clustering-and-retrieval/4_em-with-text-data.ipynb
mit
import graphlab """ Explanation: Fitting a diagonal covariance Gaussian mixture model to text data In a previous assignment, we explored k-means clustering for a high-dimensional Wikipedia dataset. We can also model this data with a mixture of Gaussians, though with increasing dimension we run into two important issue...
sguthrie/predicting-depression
MPI-LeipzigDataset.ipynb
gpl-3.0
%%bash ls MPI-Leipzig/behavioral_data_MPILMBB/phenotype | head """ Explanation: Examining the MPI-Leipzig Mind-Brain-Body Dataset The MRI data are available at https://openfmri.org/dataset/ds000221/. The behavioral data are available via NITRC: https://www.nitrc.org/projects/mpilmbb/. Note I was required to edit one f...
y2ee201/Deep-Learning-Nanodegree
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that takes in a sequence of letters, an...
kubeflow/kfp-tekton-backend
components/gcp/dataproc/submit_pyspark_job/sample.ipynb
apache-2.0
%%capture --no-stderr KFP_PACKAGE = 'https://storage.googleapis.com/ml-pipeline/release/0.1.14/kfp.tar.gz' !pip3 install $KFP_PACKAGE --upgrade """ Explanation: Name Data preparation using PySpark on Cloud Dataproc Label Cloud Dataproc, GCP, Cloud Storage,PySpark, Kubeflow, pipelines, components Summary A Kubeflow Pi...
GoogleCloudPlatform/asl-ml-immersion
notebooks/introduction_to_tensorflow/labs/adv_logistic_reg_TF2.0.ipynb
apache-2.0
import os import tempfile import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import sklearn import tensorflow as tf from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.preprocessing import Stan...
LDSSA/learning-units
units/15-classifiers/examples/Unit 15 - Classifiers - Example.ipynb
mit
# Import pandas and numpy import pandas as pd import numpy as np # Import the classifiers we will be using from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier # Import train/te...
dmnfarrell/mhcpredict
examples/sarscov2.ipynb
apache-2.0
import os, math, time, pickle, subprocess from importlib import reload from collections import OrderedDict, defaultdict import numpy as np import pandas as pd pd.set_option('display.width', 180) import epitopepredict as ep from epitopepredict import base, sequtils, plotting, peptutils, analysis from IPython.display imp...
AndreySheka/dl_ekb
hw9/Seminar9-en-Avito.ipynb
mit
low_RAM_mode = True very_low_RAM = False #If you have <3GB RAM, set BOTH to true import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Deep learning for Natural Language Processing Simple text representations, bag of words Word embedding and... not just another w...
fluxcapacitor/source.ml
jupyterhub.ml/notebooks/train_deploy/zz_under_construction/tensorflow/optimize/01_Explore_Environment.ipynb
apache-2.0
%%bash pull_force_overwrite_local """ Explanation: Explore Your Environment Get Latest Code End of explanation """ %%html <iframe width=800 height=600 src="http://pipeline.io"></iframe> """ Explanation: PipelineAI End of explanation """ import requests url = 'http://169.254.169.254/computeMetadata/v1/instance/...
probml/pyprobml
notebooks/misc/text_autoencoders_pytorch.ipynb
mit
import torch from multiprocessing import cpu_count print(cpu_count()) print(torch.cuda.is_available()) !git clone https://github.com/shentianxiao/text-autoencoders.git !ls %cd text-autoencoders !ls """ Explanation: <a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/notebooks/text_autoen...
mit-eicu/eicu-code
notebooks/demo/03-plot-timeseries.ipynb
mit
# Import libraries import pandas as pd import matplotlib.pyplot as plt import psycopg2 import os # Plot settings %matplotlib inline plt.style.use('ggplot') fontsize = 20 # size for x and y ticks plt.rcParams['legend.fontsize'] = fontsize plt.rcParams.update({'font.size': fontsize}) # Connect to the database - which i...
qinwf-nuan/keras-js
notebooks/layers/pooling/MaxPooling1D.ipynb
mit
data_in_shape = (6, 6) L = MaxPooling1D(pool_size=2, strides=None, padding='valid') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(250) data_in = 2 * np.random.random(data_in_shape) - 1 resu...
h-mayorquin/hopfield_sequences
notebooks/2016-12-11(Study of connectivity distribution).ipynb
mit
from __future__ import print_function import sys sys.path.append('../') import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import seaborn as sns from hopfield import Hopfield %matplotlib inline sns.set(font_scale=2.0) prng = np.random.RandomState(seed=100) normalize = True T =...
arongdari/almc
notebooks/Rescal_vs_brescal.ipynb
gpl-2.0
import numpy as np import logging from scipy.io.matlab import loadmat from scipy.sparse import csr_matrix import matplotlib import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score import rescal from almc.bayesian_rescal import BayesianRescal %matplotlib inline #logger = logging.getLogger() #logger....
t-vi/pytorch-tvmisc
hacks/computed_parameters.ipynb
mit
import torch import numpy import inspect # this should raise the "we'll do gross things Python internals flag" """ Explanation: Computed Parameters - a PyTorch hack by Thomas Viehmann If you are anything like me, you like PyTorch and you enjoy an occasional clever hack. So here we go. The other day we joked online w...
birdsarah/bokeh-miscellany
old/slider_example/Gapminder homage 0_6 play button - WIP.ipynb
gpl-2.0
# Links via http://www.gapminder.org/data/ """ population_url = "http://spreadsheets.google.com/pub?key=phAwcNAVuyj0XOoBL_n5tAQ&output=xls" fertility_url = "http://spreadsheets.google.com/pub?key=phAwcNAVuyj0TAlJeCEzcGQ&output=xls" life_expectancy_url = "http://spreadsheets.google.com/pub?key=tiAiXcrneZrUnnJ9dBU-PAw&o...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Sequence Tests -XGB -dbptm+ELM -scalesTrain-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] scale = [-1, "standard", "robust", "minmax", "max"] for i in par: for j in scale:...
hannorein/rebound
ipython_examples/CloseEncounters.ipynb
gpl-3.0
import rebound import numpy as np def setupSimulation(): sim = rebound.Simulation() sim.integrator = "ias15" # IAS15 is the default integrator, so we don't need this line sim.add(m=1.) sim.add(m=1e-3,a=1.) sim.add(m=5e-3,a=1.25) sim.move_to_com() return sim """ Explanation: Catching close e...
saideepchandg/twitter-relationship-using-neo4j
Twitter analysis using Neo4j v2.ipynb
mit
### checking rate limit - friends list limit = api.rate_limit_status() limit['resources']['friends']['/friends/list']['remaining'] limit['resources']['friends']['/friends/list'] """ Explanation: Twitter API rate limits End of explanation """ import datetime as dt given_date =dt.datetime.fromtimestamp( int(li...
mne-tools/mne-tools.github.io
dev/_downloads/84d68dbced84793d122fec3a2cf0cde5/source_power_spectrum.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD-3-Clause import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, compute_source_psd print(__doc__) """ Explanation: Compute source power spectral den...
carnby/matta
examples/Let's Make a Map Too.ipynb
bsd-3-clause
from __future__ import print_function, unicode_literals import matta import json import unicodedata # we do this to load the required libraries when viewing on NBViewer matta.init_javascript(path='https://rawgit.com/carnby/matta/master/matta/libs') """ Explanation: matta - view and scaffold d3.js visualizations in I...
stefanbuenten/nanodegree
p3/L1_Data_Wrangling.ipynb
mit
# set up environment import numpy as np import pandas as pd """ Explanation: Lesson 1 Data Wrangling End of explanation """ # read data from local file system data = pd.read_excel("2013_ERCOT_Hourly_Load_Data.xls") data.head() data.dtypes data["COAST"].describe() print(data["COAST"].max(), data["COAST"].min(), np...
alexandratutino/rna-analysis-notebooks
Bar Graph for Multiple Genes.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import csv aortaData = [] aortaDataNumbers = [] cerebellumData = [] cerebellumDataNumbers= [] arteryData = [] arteryDataNumbers = [] with open ("genomicdata.csv") as csvfile: readCSV = csv.reader(csvfile, delimiter= '\t') #gives access to the CSV file for col...
albahnsen/PracticalMachineLearningClass
notebooks/22-RecurrentNeuralNetworks_LSTM.ipynb
mit
import pandas as pd data = pd.read_csv('https://raw.githubusercontent.com/albahnsen/PracticalMachineLearningClass/master/datasets/phishing.csv') data.head() data.tail() """ Explanation: 22 - Recurren Neural Netwoks and LSTM by Alejandro Correa Bahnsen and Jesus Solano version 1.4, May 2019 Part of the class Practica...
shuiruge/little_mcmc
tests/simulated_annealing.ipynb
mit
import sys sys.path.append('../sample/') from simulated_annealing import Temperature, SimulatedAnnealing from random import uniform, gauss import numpy as np import matplotlib.pyplot as plt """ Explanation: Description This is a test of SimulatedAnnealing. Basics End of explanation """ def temperature_of_time(t, re...
intel-analytics/BigDL
apps/sentiment-analysis/sentiment.ipynb
apache-2.0
from bigdl.dllib.feature.dataset import base import numpy as np def download_imdb(dest_dir): """Download pre-processed IMDB movie review data :argument dest_dir: destination directory to store the data :return The absolute path of the stored data """ file_name = "imdb.npz" fil...
texib/deeplearning_homework
theano-scan.ipynb
mit
import theano import theano.tensor as T """ Explanation: 練習 Theano 的 Scan Function End of explanation """ k = T.iscalar('K') a = T.vector('A') i = T.vector('A') result, updates = theano.scan(fn=lambda pre , k : pre*a , outputs_info = i, non_sequences=a, n...
ebellm/ztf_summerschool_2015
notebooks/Introduction_to_Python_and_Astropy.ipynb
bsd-3-clause
# and "code" cells for computation and output, like this one! Press Shift-Enter to execute it. 2+2 """ Explanation: Hands-on Exercise 0: Introduction to Python & Astropy by Leo Singer (2014) and Eric Bellm (2015-2016) Introduction Our hands-on exercises will use the Python programming language. No previous experien...
smattis/BET-1
examples/compare/comparison.ipynb
gpl-3.0
num_samples_left = 50 num_samples_right = 50 delta = 0.5 # width of measure's support per dimension L = unit_center_set(2, num_samples_left, delta) R = unit_center_set(2, num_samples_right, delta) plt.scatter(L._values[:,0], L._values[:,1], c=L._probabilities) plt.xlim([0,1]) plt.ylim([0,1]) plt.show() plt.scatter(R....
Olsthoorn/IHE-python-course-2017
exercises/Feb28/tuplesListsSets.ipynb
gpl-2.0
from pprint import pprint import numpy as np """ Explanation: <figure> <IMG SRC="../../logo/logo.png" WIDTH=250 ALIGN="right"> </figure> IHE Python course, 2017 Tuples, lists and sets T.N.Olsthoorn, Feb 2017 End of explanation """ myTuple = ('This', 'is', 'our', 'tuple', 'number', 1) print("This tuple contains {}...
ZoeyYiZhou/141BProject
zJupyterNB_Script/ScriptPrecipitationAPI_Kai.ipynb
cc0-1.0
for i in range(9): print county_name[i] zipcode=[93210,93263,93202,93638,93620,95641,95242,95326,93201] ZipcodeList=[{ "County_N":county_name[i], "zipcode":zipcode[i] } for i in range(len(zipcode))] COUNTYZIP=pd.DataFrame(ZipcodeList, columns=["County_N", "zipcode"]) COUNTYZIP """ Explanation: Lets extract the z...
trungdong/datasets-provanalytics-dmkd
Application 3 - RRG Messages.ipynb
mit
import pandas as pd filepath = lambda k: "rrg/depgraphs-%d.csv" % k # An example of reading the data file df = pd.read_csv(filepath(5), index_col=0) df.head() """ Explanation: Application 3: RRG Chat Messages Identifying instructions from chat messages in the Radiation Response Game Goal: To determine if the proven...
avloss/serving
example_jupyter/tf_serving_rest_example.ipynb
apache-2.0
import tensorflow as tf x = tf.placeholder(tf.float32, shape=[None, 784]) y_ = tf.placeholder(tf.float32, shape=[None, 10]) W = tf.Variable(tf.zeros([784,10])) b = tf.Variable(tf.zeros([10])) y = tf.matmul(x,W) + b cross_entropy = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y)) t...
solgaardlab/dphox
doc/source/00_photonics.ipynb
mit
import dphox as dp import numpy as np import holoviews as hv from trimesh.transformations import rotation_matrix hv.extension('bokeh') import warnings warnings.filterwarnings('ignore') # ignore shapely warnings """ Explanation: Photonic design in dphox At a glance In this tutorial, the goal is to demonstrate how pra...
hbjornoy/DataAnalysis
Homework01/Homework-1-final.ipynb
apache-2.0
# Imports %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import glob import csv import calendar import webbrowser from datetime import datetime # Constants DATA_FOLDER = 'Data/' """ Explanation: Table of Contents <p><div class="lev1"><a href="#Task-1.-Compiling-Ebola-Data">...
ktaneishi/deepchem
examples/notebooks/Uncertainty.ipynb
mit
import deepchem as dc import numpy as np import matplotlib.pyplot as plot tasks, datasets, transformers = dc.molnet.load_sampl() train_dataset, valid_dataset, test_dataset = datasets model = dc.models.MultitaskRegressor(len(tasks), 1024, uncertainty=True) model.fit(train_dataset, nb_epoch=200) y_pred, y_std = model.p...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session03/Day1/ReIntroToDatabasesSolutions.ipynb
mit
import matplotlib.pyplot as plt %matplotlib notebook """ Explanation: Re-Introduction to Databases: Selecting Sources from the Sloan Digital Sky Survey Version 0.1 By AA Miller 2017 Apr 19 During the first session of the DSFP we learned about the basics of database operation and writing queries/code in SQL. Here, we ...
kanhua/pypvcell
demos/Color_of_surface_tmm_2.ipynb
apache-2.0
from __future__ import division, print_function, absolute_import %load_ext autoreload %autoreload 2 from pypvcell.tmm_core import (coh_tmm, unpolarized_RT, ellips, absorp_in_each_layer, position_resolved, find_in_structure_with_inf) from numpy import pi, linspace, inf, array import numpy as n...
tien-le/uranus
05_model_evaluation.ipynb
mit
# read in the iris data from sklearn.datasets import load_iris iris = load_iris() # create X (features) and y (response) X = iris.data y = iris.target """ Explanation: Comparing machine learning models in scikit-learn From the video series: Introduction to machine learning with scikit-learn Agenda How do I choose wh...
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE
notebooks/03_02_TipsAndTricks.ipynb
mit
N_SQUARES = 10 # Don't do this!!! ugly_list = [] for i in range(N_SQUARES): ugly_list.append(i**2) print('ugly list = {}'.format(ugly_list)) # You can do the same in one line wonderful_list = [ i**2 for i in range(N_SQUARES) ] print('wonderful list = {}'.format(wonderful_list)) """ Explanation: Tips and tric...
mit-crpg/openmc
examples/jupyter/mdgxs-part-i.ipynb
mit
from IPython.display import Image Image(filename='images/mdgxs.png', width=350) """ Explanation: Multigroup (Delayed) Cross Section Generation Part I: Introduction This IPython Notebook introduces the use of the openmc.mgxs module to calculate multi-energy-group and multi-delayed-group cross sections for an infinite h...
telescopeuser/workshop_blog
wechat_tool_py3_local/terminal-script-py/lesson_1_terminal_py3.ipynb
mit
# from __future__ import unicode_literals, division # import time, datetime, requests import itchat from itchat.content import * """ Explanation: 如何使用和开发微信聊天机器人的系列教程 A workshop to develop & use an intelligent and interactive chat-bot in WeChat WeChat is a popular social media app, which has more than 800 million month...
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/notebooks/docs/dplyr_pandas.ipynb
bsd-3-clause
#%load_ext rpy2.ipython #%R install.packages("nycflights13", repos='http://cran.us.r-project.org') #%R library(nycflights13) #%R write.csv(flights, "flights.csv") """ Explanation: Tom Augspurger Dplyr/Pandas comparison (copy of 2016-01-01) See result there http://nbviewer.ipython.org/urls/gist.githubusercontent.com/To...
jskDr/jamespy_py3
poodle/01-001 Poodle Tutorial V02.ipynb
mit
from importlib import reload import sklearn.linear_model import pandas as pd import numpy as np """ Explanation: Poodle: Pandas + Sklearn, Tutorial V02 Sung-Jin Kim, Apr 11, 2016 Pandas is a wonderful framework for data management. Also, Sklearn is a powerful tool for machine learning. However, there is no one which m...
mdeff/ntds_2016
toolkit/01_ex_acquisition_exploration.ipynb
mit
# Number of posts / tweets to retrieve. # Small value for development, then increase to collect final data. n = 20 # 4000 """ Explanation: A Python Tour of Data Science: Data Acquisition & Exploration Michaël Defferrard, PhD student, EPFL LTS2 1 Exercise: problem definition Theme of the exercise: understand the impac...
Hash--/documents
notebooks/TP Master Fusion/LH-Hands-on-multijunction.ipynb
mit
%pylab %matplotlib inline from scipy.constants import c """ Explanation: Hands-on LH2: the multijunction launcher A tokamak a intrinsequally a pulsed machine. In order to perform long plasma discharges, it is necessary to drive a part of the plasma current, in order to limit (or ideally cancel) the magnetic flux consu...
wuafeing/Python3-Tutorial
01 data structures and algorithms/01.11 naming slice.ipynb
gpl-3.0
###### 0123456789012345678901234567890123456789012345678901234567890' record = '....................100 .......513.25 ..........' cost = int(record[20:23]) * float(record[31:37]) """ Explanation: Previous 1.11 命名切片 问题 你的程序已经出现一大堆已无法直视的硬编码切片下标,然后你想清理下代码。 解决方案 假定你有一段代码要从一个记录字符串中几个固定位置提取出特定的数据字段(比如文件或类似格式): End of explan...
probml/pyprobml
notebooks/misc/splines_numpyro.ipynb
mit
!pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro !pip install -q arviz import numpy as np np.set_printoptions(precision=3) import matplotlib.pyplot as plt import math import os import warnings import pandas as pd from scipy.interpolate import BSpline from scipy.stats import gaussian_kde import jax p...
AllenDowney/ModSimPy
soln/interest.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * from pandas import read_html """ Expl...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/n13_sensitivity_analysis.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 import pickle %matplotlib inline %pylab inli...
openclimatedata/pymagicc
notebooks/Example.ipynb
agpl-3.0
# NBVAL_IGNORE_OUTPUT from pprint import pprint import pymagicc from pymagicc import MAGICC6 from pymagicc.io import MAGICCData from pymagicc.scenarios import rcp26, rcp45, rcps %matplotlib inline from matplotlib import pyplot as plt plt.style.use("ggplot") plt.rcParams["figure.figsize"] = 16, 9 """ Explanation: Py...
rileyrustad/pdxapartmentfinder
analysis/Munge.ipynb
mit
with open('../pipeline/data/Day90ApartmentData.json') as f: my_dict1 = json.load(f) def listing_cleaner(entry): print entry listing_cleaner(my_dict['5465197037']) type(dframe['bath']['5399866740']) """ Explanation: Load the data from our JSON file. The data is stored as a dictionary of dictionaries in...
tpin3694/tpin3694.github.io
machine-learning/getting_the_diagonal_of_a_matrix.ipynb
mit
# Load library import numpy as np """ Explanation: Title: Getting The Diagonal Of A Matrix Slug: getting_the_diagonal_of_a_matrix Summary: How to get the diagonal of a matrix in Python. Date: 2017-09-02 12:00 Category: Machine Learning Tags: Vectors Matrices Arrays Authors: Chris Albon Preliminaries End of exp...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/automl/showcase_automl_image_object_detection_batch.ipynb
apache-2.0
import os import sys # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install -U google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex client library: AutoML image object detection model for batch prediction <table alig...