repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Mdround/fastai-deeplearning1 | deeplearning1/nbs/lesson1.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Using Convolutional Neural Networks
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning.
Introduction to this week's task: 'Do... |
nproctor/phys202-2015-work | assignments/assignment10/ODEsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
"""
Explanation: Ordinary Differential Equations Exercise 1
Imports
End of explanation
"""
def lorentz_derivs(yvec, t, sigma, rho, beta):
"""Compute the the de... |
bMzi/ML_in_Finance | 0211_SVM.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo('3liCbRZPrZA')
"""
Explanation: Support Vector Machines
Motivating Support Vector Machines
Developing the Intuition
Support vector machines (SVM) are a powerful and flexible class of supervised algorithms. Developed in the 1990s, SVM have shown to perform well in a... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_custom_inverse_solver.ipynb | bsd-3-clause | import numpy as np
from scipy import linalg
import mne
from mne.datasets import sample
from mne.viz import plot_sparse_source_estimates
data_path = sample.data_path()
fwd_fname = data_path + '/MEG/sample/sample_audvis-meg-eeg-oct-6-fwd.fif'
ave_fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
cov_fname = data_... |
lisitsyn/shogun | doc/ipython-notebooks/multiclass/Tree/TreeEnsemble.ipynb | bsd-3-clause | import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../../data')
from shogun import CSVFile,features,MulticlassLabels
def load_file(feat_file,label_file):
feats=features(CSVFile(feat_file))
labels=MulticlassLabels(CSVFile(label_file))
return (feats, labels)
trainfeat_file=os.path.join(SHOGUN_DAT... |
Xilinx/BNN-PYNQ | notebooks/CNV-QNN_Cifar10_Testset.ipynb | bsd-3-clause | import bnn
"""
Explanation: Cifar-10 testset classification on Pynq
This notebook covers how to use low quantized neural networks on Pynq.
It shows an example how CIFAR-10 testset can be inferred utilizing different precision neural networks inspired at VGG-16, featuring 6 convolutional layers, 3 max pool layers and ... |
tvaught/compintro | 11_camera_intro.ipynb | bsd-3-clause | import os
from picamera import PiCamera
from picamera.color import Color
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(3)
camera.stop_preview()
"""
Explanation: Raspberry Pi Camera Test
First we import the libraries we need and initialize a camera 'object.'
End of explanation
"""
camera.h... |
pligor/predicting-future-product-prices | 04_time_series_prediction/.ipynb_checkpoints/15_price_history_seq2seq-native-with-last-input-as-decoder-input-checkpoint.ipynb | agpl-3.0 | from __future__ import division
import tensorflow as tf
from os import path
import numpy as np
import pandas as pd
import csv
from sklearn.model_selection import StratifiedShuffleSplit
from time import time
from matplotlib import pyplot as plt
import seaborn as sns
from mylibs.jupyter_notebook_helper import show_graph
... |
phoebe-project/phoebe2-docs | 2.0/tutorials/plotting.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.0,<2.1"
"""
Explanation: Plotting
This tutorial explains the high-level interface to plotting provided by the Bundle. You are of course always welcome to access arrays and plot manually.
The default plotting backend in PHOEBE is matplotlib, and this tutorial will focus solely on matplotlib ... |
w4zir/ml17s | assignments/.ipynb_checkpoints/assignment01-regression-checkpoint.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn import linear_model
import matplotlib.pyplot as plt
import matplotlib as mpl
# read house_train.csv data in pandas dataframe df_train using pandas read_csv function
df_train = pd.read_csv('datasets/house_price/train.csv', enco... |
steinam/teacher | jup_notebooks/datenbanken/Subselects_11FI3.ipynb | mit | %load_ext sql
%sql mysql://steinam:steinam@localhost/versicherung_complete
"""
Explanation: Subselect / Unterabfragen)
Zur Durchführung einer Abfrage werden Informationen benötigt, die erst durch eine eigene Abfrage geholt werden müssen.
Sie können stehen
als Vertreter für einen Wert
als Vertreter für eine Liste
als... |
dataewan/deep-learning | face_generation/dlnd_face_generation.ipynb | mit | data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
"""
Explanation: Face Generation
In this project, you'll use generative adve... |
borja876/Thinkful-DataScience-Borja | Capstone+Narrative+analytics+and+experimentation.ipynb | mit | import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind
from scipy import stats
import itertools
import seaborn as sns
%matplotlib inline
w = pd.read_csv('https://raw.githubusercontent.com/borja876/Thinkful-DataScience-Borja/master/Electricity%20Consumption... |
hannorein/reboundx | ipython_examples/GettingStartedParameters.ipynb | gpl-3.0 | import rebound
import reboundx
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(a=1.)
ps = sim.particles
rebx = reboundx.Extras(sim)
gr = rebx.load_force('gr')
rebx.add_force(gr)
"""
Explanation: Adding Parameters With REBOUNDx
We start by creating a simulation, attaching REBOUNDx, and adding the effects of general ... |
kayzhou22/DSBiz_Project_LendingClub | Data_Preprocessing/Collaboration-appLoan_DataProcessing.ipynb | mit | import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.feature_selection import RFE
from sklearn.svm import SVR
from sklearn.svm import LinearSVC
from sklearn.svm import LinearSVR
... |
relf/smt | tutorial/SMT_EGO_application.ipynb | bsd-3-clause |
import numpy as np
%matplotlib notebook
import matplotlib.pyplot as plt
plt.ion()
def fun(point):
return np.atleast_2d((point-3.5)*np.sin((point-3.5)/(np.pi)))
X_plot = np.atleast_2d(np.linspace(0, 25, 10000)).T
Y_plot = fun(X_plot)
lines = []
fig = plt.figure(figsize=[5,5])
ax = fig.add_subplot(111)
true_fu... |
larroy/mxnet | example/autoencoder/variational_autoencoder/VAE_example.ipynb | apache-2.0 | mnist = mx.test_utils.get_mnist()
image = np.reshape(mnist['train_data'],(60000,28*28))
label = image
image_test = np.reshape(mnist['test_data'],(10000,28*28))
label_test = image_test
[N,features] = np.shape(image) #number of examples and features
print(N,features)
nsamples = 5
idx = np.random.choice(len(mnis... |
catalyst-cooperative/pudl | notebooks/work-in-progress/ferc714-output.ipynb | mit | sns.set()
%matplotlib inline
mpl.rcParams['figure.figsize'] = (10,4)
mpl.rcParams['figure.dpi'] = 150
pd.options.display.max_columns = 100
pd.options.display.max_rows = 100
"""
Explanation: Configure Display Parameters
End of explanation
"""
logger=logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.... |
helgako/cms-dqm | notebooks/soft_pretraining.ipynb | mit | %env THEANO_FLAGS="device=gpu0", "gpuarray.preallocate=0.9", "floatX=float32"
import theano
import theano.tensor as T
from lasagne import *
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import numpy as np
import pandas as pd
import cPickle as pickle
import os
import re
DATA_PATH = 'me... |
janusnic/21v-python | unit_20/parallel_ml/notebooks/05 - Model Selection and Assessment.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
# Some nice default configuration for plots
plt.rcParams['figure.figsize'] = 10, 7.5
plt.rcParams['axes.grid'] = True
plt.gray()
"""
Explanation: Model Selection and Assessment
Outline of the session:
Model performance evaluation and detection of ... |
mne-tools/mne-tools.github.io | 0.19/_downloads/374e7fb88f562b8ceb7b99b07e106d9b/plot_10_raw_overview.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
import mne
"""
Explanation: The Raw data structure: continuous data
This tutorial covers the basics of working with raw EEG/MEG data in Python. It
introduces the :class:~mne.io.Raw data structure in detail, including how to
load, query, subselect, export, an... |
mjbommar/cscs-530-w2016 | notebooks/basic-random/003-random-seeds.ipynb | bsd-2-clause | %matplotlib inline
# Imports
import numpy
import numpy.random
import matplotlib.pyplot as plt
"""
Explanation: CSCS530 Winter 2015
Complex Systems 530 - Computer Modeling of Complex Systems (Winter 2015)
Course ID: CMPLXSYS 530
Course Title: Computer Modeling of Complex Systems
Term: Winter 2015
Schedule: Wednesdays ... |
robertoalotufo/ia898 | 2S2018/11 Teorema da Convolucao.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from numpy.fft import *
import sys,os
ia898path = os.path.abspath('../../')
if ia898path not in sys.path:
sys.path.append(ia898path)
import ia898.src as ia
f = np.array([[1,0,0,0,0,0,0,0,0],
[0,0,0,0... |
4DGenome/Chromosomal-Conformation-Course | Participants/JCarlos/02_Parsing.ipynb | gpl-3.0 | from pytadbit.parsers.genome_parser import parse_fasta
genome_seq = parse_fasta('/media/storage/db/reference_genome/Homo_sapiens/hg38/hg38.fa')
maps1 = [
'results/HindIII/01_mapping/mapHindIII_r1/K562_HindIII_1_full_1-end.map',
'results/HindIII/01_mapping/mapHindIII_r1/K562_HindIII_1_frag_1-end.map']
maps2 =... |
amillner/pyiat | example/pyiat_example.ipynb | gpl-3.0 | d=pd.read_csv('iat_data.csv',index_col=0)
d.head()
#Number of trials per subject
#Note that Subject 1 has too few trials
d.groupby('subjnum').subjnum.count().head()
#Number of subjects in this data set
d.subjnum.unique()
#Conditions
d.condition.unique()
#Blocks
d.block.unique()
#Correct coded as 1, errors coded a... |
Tjorriemorrie/trading | 21_gae_kelly/bulkloader/Analysis.ipynb | mit | import numpy as np
import pandas as pd
%matplotlib inline
from matplotlib import pyplot as plt
"""
Explanation: H1
Download data
Run:
appcfg.py download_data --url=http://binary-trading.appspot.com/remoteapi --filename=runs.csv --kind="Run" --config_file=config.yaml
Import dependencies
End of explanation
"""
df = pd... |
sahilm89/lhsmdu | lhsmdu/benchmark/Comparing LHSMDU and MC sampling.ipynb | mit | import numpy as np
import lhsmdu
import matplotlib.pyplot as plt
def simpleaxis(axes, every=False):
if not isinstance(axes, (list, np.ndarray)):
axes = [axes]
for ax in axes:
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
if every:
ax.spine... |
freedomtan/tensorflow | tensorflow/lite/g3doc/tutorials/model_maker_question_answer.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... |
gcallah/Indra | notebooks/flocking.ipynb | gpl-3.0 | from models.flocking import set_up
"""
Explanation: How to run the /home/test/indras_net/models/flocking model.
First we import all necessary files.
End of explanation
"""
from indra.agent import Agent, X, Y
from indra.composite import Composite
from indra.display_methods import BLUE, TREE
from indra.env import Env
... |
AcidLeroy/VideoSegment | python/notebooks/unsupervised_clustering.ipynb | gpl-2.0 | from read_video import *
import numpy as np
import matplotlib.pyplot as plt
import cv2
"""
Explanation: Unsupervised Clustering Experiment
Author: Cody W. Eilar cody.eilar@gmail.com
Course: ECE 633
Professor: Dr. Marios Pat... |
haraldschilly/nltk-sentiment-analysis-demo | sentiment.ipynb | apache-2.0 | import yaml
from codecs import open
import nltk
"""
Explanation: Sentiment analysis of free-text comments using NLTK
2015-07-04 -- by Harald Schilly -- License: Apache 2.0
The following NLTK demo works for German free-text comments.
It tokenizes the text, cleans it up, does word stemming and then trains a naive bayesi... |
synthicity/activitysim | activitysim/examples/example_estimation/notebooks/21_stop_frequency.ipynb | agpl-3.0 | import os
import larch # !conda install larch -c conda-forge # for estimation
import pandas as pd
"""
Explanation: Estimating Stop Frequency
This notebook illustrates how to re-estimate a single model component for ActivitySim. This process
includes running ActivitySim in estimation mode to read household travel su... |
AllenDowney/ProbablyOverthinkingIt | bear.ipynb | mit | from __future__ import print_function, division
import thinkbayes2
import thinkplot
import numpy as np
from scipy import stats
%matplotlib inline
"""
Explanation: When will I win the Great Bear Run?
This notebook presents an application of Bayesian inference to predicting the outcome of a road race.
Copyright 2015 ... |
LorenzoBi/courses | UQ/assignment_2/Untitled.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from sympy import *
%matplotlib inline
init_printing()
"""
Explanation: Assignment 2
Lorenzo Biasi and Michael Aichmüller
End of explanation
"""
def f(x):
return np.exp(np.sin(x))
def df(x):
return f(x) * np.cos(x)
def absolute_err(f, df, h):
g = (f(... |
choderalab/assaytools | examples/direct-fluorescence-assay/Emcee example with two compenent binding.ipynb | lgpl-2.1 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from time import time
from assaytools.bindingmodels import TwoComponentBindingModel
from assaytools import pymcmodels
"""
Explanation: Bayesian fit for two component binding - simulated data
Comparing sampling with emcee and PyMC
In this notebook ... |
mzwiessele/mzparam | tutorial/ParamzSimpleRosen.ipynb | bsd-3-clause | import paramz, numpy as np
from scipy.optimize import rosen_der, rosen
"""
Explanation: Paramz Tutorial
A simple introduction into Paramz based gradient based optimization of parameterized models.
Paramz is a python based parameterized modelling framework, that handles parameterization, printing, randomizing and many ... |
deepmind/xmanager | codelab.ipynb | apache-2.0 | !git clone https://github.com/deepmind/xmanager.git ~/xmanager
!pip install ~/xmanager
"""
Explanation: XManager codelab notebook
This notebook will take you through running an XManager experiment on Google Cloud Platform (GCP).
A stand-alone Jupyter Notebook can be created via GCP's Vertex AI Notebooks
JupyterLab can... |
martinjrobins/hobo | examples/stats/log-priors.ipynb | bsd-3-clause | import pints
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Inference: Log priors
This example notebook illustrates some of the functionality that is available for LogPrior objects that are currently available within PINTS.
End of explanation
"""
uniform_log_prior = pints.UniformLogPrior(-10, 15... |
mnnit-workspace/Logical-Rhythm-17 | Class-4/Introduction to Pandas and Exploring Iris Dataset.ipynb | mit | # importing pandas package with alias pd
import pandas as pd
#create a data frame - dictionary is used here where keys get converted to column names and values to row values.
data = pd.DataFrame({'Country': ['Russia','Colombia','Chile','Equador','Nigeria'],
'Rank':[121,40,100,130,11]})
data
# desc... |
ece579/ece579_f17 | recitation4/problems/sparkSQL.ipynb | mit | from pyspark.sql import SQLContext
sqlContext = SQLContext(sc)
from pyspark.sql import Row
csv_data = raw.map(lambda l: l.split(","))
row_data = csv_data.map(lambda p: Row(
duration=int(p[0]),
protocol_type=p[1],
service=p[2],
flag=p[3],
src_bytes=int(p[4]),
dst_bytes=int(p[5])
)
)
"""
Ex... |
microsoft/dowhy | docs/source/example_notebooks/dowhy_causal_discovery_example.ipynb | mit | import dowhy
from dowhy import CausalModel
from rpy2.robjects import r as R
%load_ext rpy2.ipython
import numpy as np
import pandas as pd
import graphviz
import networkx as nx
np.set_printoptions(precision=3, suppress=True)
np.random.seed(0)
"""
Explanation: Causal Discovery example
The goal of this notebook is to... |
jbocharov-mids/W207-Machine-Learning | Regression.ipynb | apache-2.0 | # This tells matplotlib not to try opening a new window for each plot.
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import time
from numpy.linalg import inv
from sklearn.datasets import load_boston
from sklearn.linear_model import LinearRegression
from sklearn import prep... |
diging/methods | 0. Metadata/0.0. Visualizing Metadata.ipynb | gpl-3.0 | import rdflib
import networkx as nx
import os
rdf_path = 'data/example.rdf'
"""
Explanation: 0.0. Visualizing Metadata
RDF (Resource Description Framework) is a data model for information on the internet. It can be used to describe just about anything, but is usually applied to bibliographic collections: representing... |
LimeeZ/phys292-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."""
N = N+1
a = a
b = b
h = (b-a)/... |
ajkavanagh/pyne-sqlalchemy-2015-04 | notebook/ORM Examples.ipynb | gpl-3.0 | from sqlalchemy import create_engine
engine = create_engine('sqlite:///:memory:')
"""
Explanation: SQL Alchemy ORM Examples
So, these are the same as the CORE expression language, but using the ORM toolkit
Create an in memory SQLite database engine
End of explanation
"""
from sqlalchemy.ext.declarative import declar... |
scoaste/showcase | movie-lens/MovielensRecommendations.ipynb | mit | from hdfs import InsecureClient
from pyspark import SparkContext, SparkConf
import urllib
import zipfile
# the all important Spark context
conf = (SparkConf()
.setMaster('yarn-client')
.setAppName('Movielens Prediction Model')
)
sc = SparkContext(conf=conf)
# set to True to redownload the data ... |
geilerloui/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
Yu-Group/scikit-learn-sandbox | jupyter/29_iRF_demo_sklearn.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from sklearn.datasets import load_breast_cancer
import numpy as np
from functools import reduce
# Needed for the scikit-learn wrapper function
from sklearn.tree import irf_utils
from sklearn.ensemble import RandomForestClassifier
from math import ceil
# Import our c... |
ioggstream/python-course | ansible-101/notebooks/06_bastion_and_ssh.ipynb | agpl-3.0 | cd /notebooks/exercise-06/
"""
Explanation: Bastion hosts
There are many reasons for using bastion hosts:
security access eg in cloud environment
vpn eg via windows hosts
The latter case is quite boring as ansible doesn't support windows as a client platform.
A standard approach is:
have a ssh server or a proxy ins... |
hektor-monteiro/python-notebooks | aula-6_graficos.ipynb | gpl-2.0 | # essa instrução faz com que os gráficos apareçam no notebook
%matplotlib inline
import matplotlib.pyplot as plt
y = [ 1.0, 2.4, 1.7, 0.3, 0.6, 1.8 ]
plt.plot(y)
plt.show()
# em geral teremos dados em x e y
import matplotlib.pyplot as plt
import numpy as np
x = [ 0.5, 1.0, 2.0, 4.0, 7.0, 10.0 ]
y = [ 1.0, 2.4... |
angelmtenor/data-science-keras | enron_scandal.ipynb | mit | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import helper
import keras
helper.info_gpu()
#sns.set_palette("Reds")
helper.reproducible(seed=0) # setup reproducible results from run to run using Keras
%matplotlib inline
%load_ext autoreload
%autoreload
"""
Ex... |
yugangzhang/CHX_Pipelines | 2019_1/CameraTalk/XPCS_SiO2_500nm_For_CameraTalk.ipynb | bsd-3-clause | from pyCHX.chx_packages import *
%matplotlib notebook
plt.rcParams.update({'figure.max_open_warning': 0})
plt.rcParams.update({ 'image.origin': 'lower' })
plt.rcParams.update({ 'image.interpolation': 'none' })
import pickle as cpk
from pyCHX.chx_xpcs_xsvs_jupyter_V1 import *
import itertools
#from pyCHX.XPCS_SAXS i... |
NGSchool2016/ngschool2016-materials | jupyter/fbrazdovic/.ipynb_checkpoints/NGSchool_python_USERS-checkpoint.ipynb | gpl-3.0 | %pylab inline
"""
Explanation: Set the matplotlib magic to notebook enable inline plots.
End of explanation
"""
import subprocess
import matplotlib.pyplot as plt
import random
import numpy as np
"""
Explanation: Calculate the Nonredundant Read Fraction (NRF)
SAM format example:
SRR585264.8766235 0 1 ... |
mtury/scapy | doc/notebooks/Scapy in 15 minutes.ipynb | gpl-2.0 | send(IP(dst="1.2.3.4")/TCP(dport=502, options=[("MSS", 0)]))
"""
Explanation: Scapy in 15 minutes (or longer)
Guillaume Valadon & Pierre Lalet
Scapy is a powerful Python-based interactive packet manipulation program and library. It can be used to forge or decode packets for a wide number of protocols, send them on the... |
radical-cybertools/supercomputing2015-tutorial | 01_hadoop/Spark.ipynb | apache-2.0 | %matplotlib inline
%run ../env.py
%run ../util/init_spark.py
from pilot_hadoop import PilotComputeService as PilotSparkComputeService
pilotcompute_description = {
"service_url": "yarn-client://yarn-aws.radical-cybertools.org",
"number_of_processes": 2
}
print "SPARK HOME: %s"%os.environ["SPARK_HOME"]
print "... |
UWPreMAP/PreMAP2015 | Lessons/PythonIntro.ipynb | mit | print "hello, world!"
%%bash
echo "print 'hello, world!'" > hello.py # write our .py file
cat hello.py # print the contents of this file to the screen
python hello.py # run the python script
"""
Explanation: much of this material is based on notebook's from Jake Vanderplas' Intro to Scientific Computing in Python c... |
pdh21/XID_plus | docs/notebooks/examples/SED_emulator/JAX_greybody_emulator.ipynb | mit | import fitIR
import fitIR.models as models
import fitIR.analyse as analyse
from astropy.cosmology import WMAP9 as cosmo
import jax
import numpy as onp
import pylab as plt
import astropy.units as u
import scipy.integrate as integrate
%matplotlib inline
import jax.numpy as np
from jax import grad, jit, vmap, value_and_g... |
rishuatgithub/MLPy | Topic_Modelling_LDA.ipynb | apache-2.0 | ## required installation for LDA visualization
!pip install pyLDAvis
## imports
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import LatentDirichletAllocation
import matplotlib.... |
p0licat/university | Experiments/Crawling/Jupyter Notebooks/Camelia Chira.ipynb | mit | class HelperMethods:
@staticmethod
def IsDate(text):
# print("text")
# print(text)
for c in text.lstrip():
if c not in "1234567890 ":
return False
return True
import pandas
import requests
page = requests.get('http://www.cs.ubbcluj.ro/~cchira/publica... |
csiu/100daysofcode | datamining/2017-03-03-day07.ipynb | mit | def readability_ease(num_sentences, num_words, num_syllables):
asl = num_words / num_sentences
asw = num_syllables / num_words
return(206.835 - (1.015 * asl) - (84.6 * asw))
"""
Explanation: layout: post
author: csiu
date: 2017-03-03
title: "Day07:"
categories: update
tags:
- 100daysofcode
- text-... |
dmlc/web-data | gluonnlp/logs/embedding_results/results.ipynb | apache-2.0 | from __future__ import print_function
import pandas as pd
pd.options.display.max_rows = 999
pd.set_option('display.width', 1000)
import glob
header = ["evaluation_type", "dataset", "kwargs", "evaluation", "value", "num_skipped"]
similarity_dfs = []
similarity_names = []
similarity_glob = './results/similarity*'
for s... |
liufuyang/deep_learning_tutorial | jizhi-pytorch-2/02_sentiment_analysis/homework.ipynb | mit | import glob
all_filenames = glob.glob('./data/names/*.txt')
print(all_filenames)
"""
Explanation: 火炬上的深度学习(下)第二节:机器也懂感情?
课后练习:使用 LSTM 来判断人名属于哪个国家
我们要使用 PyTorch 搭建一个 LSTM 模型。
模型的输入是用ASCII字符表示的姓氏,输出是模型对这个姓氏所属语言的判断。
模型的训练数据是来自18种语言的2万条左右的姓氏文本。
训练完毕的理想模型可以预测出一个姓氏是属于哪种语言的。并且,我们还可以通过模型的预测结果分析各语言姓氏的相似性。
最终训练好的模型可以像下面那样使用。
`... |
lgautier/mashing-pumpkins | doc/notebooks/MinHash, design and performance.ipynb | mit | # we take a DNA sequence as an example, but this is arbitrary and not necessary.
alphabet = b'ATGC'
# create a lookup structure to go from byte to 4-mer
# (a arbitrary byte is a bitpacked 4-mer)
quad = [None, ]*(len(alphabet)**4)
i = 0
for b1 in alphabet:
for b2 in alphabet:
for b3 in alphabet:
... |
tkurfurst/deep-learning | first-neural-network/dlnd-your-first-neural-network (revised).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... |
dinrker/PredictiveModeling | Session 6 - Features_III_RandomProjections .ipynb | mit | from IPython.display import Image
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import time
%matplotlib inline
"""
Explanation: Goals of this Lesson
Random Projections for Dimensionality Reduction
References
Random Projections in Dimensionality Reduction
*Dropout: A Simple Way to Prevent NN... |
fabriziocosta/GraphFinder | Functions_Fasta_Input_to_Structure_and_Graph_modifing...-submit.ipynb | gpl-2.0 | %matplotlib inline
import os, sys
import subprocess as sp
from itertools import cycle
import networkx as nx
import re
from eden.util import display
# read a fasta file separate the head and the sequence
def _readFastaFile(file_path=None):
head_start = '>'
head = []
seq = []
seq_temps = []
string_se... |
jgarciab/wwd2017 | class2/hw_2.ipynb | gpl-3.0 | sns.jointplot?
##Some code to run at the beginning of the file, to be able to show images in the notebook
##Don't worry about this cell but run it
#Print the plots in this screen
%matplotlib inline
#Be able to plot images saved in the hard drive
from IPython.display import Image,display
#Make the notebook wider
fr... |
pycam/python-basic | live/python_basic_1_2_live.ipynb | unlicense | # how to print?
# but first thing, first. This is comment in my code using # (hash symbol) at the beginning of the line!
# don't forget to comment your code, it is important!
print('hello! my name is Anne.')
# how to use variable?
# if I want to print multiple time something for example
my_name = 'Anne'
print('hi', my... |
tensorflow/workshops | extras/amld/notebooks/exercises/2_keras.ipynb | apache-2.0 | # In Jupyter, you would need to install TF 2.0 via !pip.
%tensorflow_version 2.x
import tensorflow as tf
import json, os
# Tested with TensorFlow 2.1.0
print('version={}, CUDA={}, GPU={}, TPU={}'.format(
tf.__version__, tf.test.is_built_with_cuda(),
# GPU attached?
len(tf.config.list_physical_devices('GPU... |
fadeetch/Mastering-ML-Python | Chapters/Two/Simple Linear Regression.ipynb | mit | import matplotlib.pyplot as plt
%matplotlib inline
X = [[6], [8], [10], [14], [18]]
Y = [[7], [9], [13], [17.5], [18]]
plt.figure()
plt.title("Pizza price plotted against diameter")
plt.xlabel("Diameter in inches")
plt.ylabel("Price in dollars")
plt.plot(X,Y,"k.")
plt.axis([0,25,0,25])
plt.grid(True)
plt.show()
#M... |
jacobdein/alpine-soundscapes | utilities/Pull data from OpenStreetMap.ipynb | mit | bounding_box_file = ""
result_shapefile_filepath = ""
"""
Explanation: Pull highway data from OpenStreetMap as shapefile
This notebook pulls highway line data from the OpenStreetMap database and creates a shapefile containing the query results.
Required packages
<a href="https://github.com/DinoTools/python-overpy">ov... |
NORCatUofC/rain | n-year/notebooks/Examining the 100-year event.ipynb | mit | from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from datetime import datetime, timedelta
import pandas as pd
import matplotlib.pyplot as plt
import operator
import seaborn as sns
%matplotlib inline
n_year_storms = pd.read_csv('data/n_year_storms_ohare_noaa.csv')
n_... |
NORCatUofC/rain | flooding/Basement vs Street Flooding.ipynb | mit | wib_comm_df = pd.read_csv('311_data/wib_calls_311_comm.csv')
wos_comm_df = pd.read_csv('311_data/wos_calls_311_comm.csv')
wib_comm_df.head()
wib_comm_stack = wib_comm_df[wib_comm_df.columns.values[1:]].stack().reset_index()
wos_comm_stack = wos_comm_df[wos_comm_df.columns.values[1:]].stack().reset_index()
wib_comm_sta... |
enchantner/python-zero | lesson_6/Slides.ipynb | mit | import yaml
import random
with open("answers.yaml", "r") as conf:
config = yaml.load(conf)
def get_answer(message):
lower_msg = message.lower()
for key in config['answers']:
if key in lower_msg:
return random.choice(config['answers'][key])
"""
Explanation: Вопросы по прошлому заня... |
deculler/DataScienceTableDemos | HealthSample.ipynb | bsd-2-clause | health_map = Table(["raw label", "label", "encoding", "Description"]).with_rows(
[["hhidpn", "id", None, "identifier"],
["r8agey_m", "age", None, "age in years in wave 8"],
["ragender", "gender", ['male','female'], "1 = male, 2 = female)"],
["raracem", "race", ['white','black','other... |
CalPolyPat/phys202-2015-work | assignments/assignment04/MatplotlibEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo... |
visualfabriq/bquery | bquery/benchmarks/taxi/Taxi Set.ipynb | bsd-3-clause | import os
import urllib
import glob
import pandas as pd
from bquery import ctable
import bquery
import bcolz
from multiprocessing import Pool, cpu_count
from collections import OrderedDict
import contextlib
import time
# do not forget to install numexpr
# os.environ["BLOSC_NOLOCK"] = "1"
bcolz.set_nthreads(1)
workdir ... |
brookehus/msmbuilder | examples/Coarse-graining-with-MVCA.ipynb | lgpl-2.1 | from msmbuilder.example_datasets import QuadWell
from msmbuilder.msm import MarkovStateModel
from msmbuilder.lumping import MVCA
import numpy as np
import scipy.cluster.hierarchy
import matplotlib.pyplot as plt
% matplotlib inline
"""
Explanation: Minimum Variance Cluster Analysis
We are going to use a minimum varianc... |
tuanavu/python-cookbook-3rd | notebooks/ch01/10_removing_duplicates_from_a_sequence_while_maintaining_order.ipynb | mit | def dedupe(items):
seen = set()
for item in items:
if item not in seen:
yield item
seen.add(item)
a = [1, 5, 2, 1, 9, 1, 5, 10]
list(dedupe(a))
"""
Explanation: Removing Duplicates from a Sequence while Maintaining Order
Problem
You want to eliminate the duplicate values in ... |
eds-uga/csci1360-fa16 | assignments/A7/A7_Q3.ipynb | mit | try:
count_datasets
except:
assert False
else:
assert True
c = count_datasets("submission_partial.json")
assert c == 4
c = count_datasets("submission_full.json")
assert c == 9
try:
c = count_datasets("submission_nonexistent.json")
except:
assert False
else:
assert c == -1
"""
Explanation: Q3... |
josdaza/deep-toolbox | TensorFlow/02_Linear_Regression.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
# Regresa 101 numeros igualmmente espaciados en el intervalo[-1,1]
x_train = np.linspace(-1, 1, 101)
# Genera numeros pseudo-aleatorios multiplicando la matriz x_train * 2 y
# sumando a cada elemento un ruido (una matriz del mismo tamanio con puros numeros random)
... |
hvillanua/deep-learning | reinforcement/Q-learning-cart.ipynb | mit | import gym
import tensorflow as tf
import numpy as np
"""
Explanation: Deep Q-learning
In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p... |
martinjrobins/hobo | examples/toy/distribution-annulus.ipynb | bsd-3-clause | import pints
import pints.toy
import numpy as np
import matplotlib.pyplot as plt
# Create log pdf (default is 2-dimensional with r0=10 and sigma=1)
log_pdf = pints.toy.AnnulusLogPDF()
# Contour plot of pdf
num_points = 100
x = np.linspace(-15, 15, num_points)
y = np.linspace(-15, 15, num_points)
X, Y = np.meshgrid(x,... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_01/Final/Object Creation.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
"""
Explanation: Rapid Overview
build intuition about pandas
details later
documentation: http://pandas.pydata.org/pandas-docs/stable/10min.html
End of explanation
"""
my_series = pd.Series([1,3,5,np.nan,6,8])
my_series
"""
Explanation: Basic series; default integer index
do... |
tensorflow/tensorrt | tftrt/examples/presentations/GTC-April2021-Dynamic-shape-ResNetV2.ipynb | apache-2.0 | # Verbose output
# import os
# os.environ["TF_CPP_VMODULE"]="trt_engine_utils=2,trt_engine_op=2,convert_nodes=2,convert_graph=2,segment=2,trt_shape_optimization_profiles=2,trt_engine_resource_ops=2"
!pip install pillow matplotlib
import tensorflow as tf
from tensorflow.python.compiler.tensorrt import trt_convert as t... |
jegibbs/phys202-2015-work | assignments/assignment06/InteractEx05.ipynb | mit | %matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
from IPython.html.widgets import interact, interactive, fixed
from IPython.html import widgets
from IPython.display import SVG
from IPython.display import display
"""
Explanation: Interact Exercise 5
Imports
Put the standard imports for Matplo... |
mne-tools/mne-tools.github.io | 0.22/_downloads/6684371ec2bc8e72513b3bdbec0d3a9f/plot_20_events_from_raw.ipynb | bsd-3-clause | import os
import numpy as np
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
raw.crop(tmax=60).load_data()
"""
Explanati... |
fluffy-hamster/A-Beginners-Guide-to-Python | A Beginners Guide to Python/21. The joy of fast cars.ipynb | mit | # Attempt 1
def is_prime(num):
"""Returns True if number is prime, False otherwise"""
if num <= 1: return False # negetive numbers are not prime
# check for factors
for i in range(2,num): # for loop that iterates 2-to-num. Each number in the iteration is called "i"
if (num % i) == ... |
tensorflow/docs-l10n | site/ja/agents/tutorials/8_networks_tutorial.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
paninski-lab/yass | examples/evaluate/christmas-plots.ipynb | apache-2.0 | plot = ChristmasPlot('Fake', n_dataset=3, methods=['yass', 'kilosort', 'spyking circus'], logit_y=True, eval_type="Accuracy")
for method in plot.methods:
for i in range(plot.n_dataset):
x = (np.random.rand(30) - 0.5) * 10
y = 1 / (1 + np.exp(-x + np.random.rand()))
plot.add_metric(x, y, dat... |
google/eng-edu | ml/cc/prework/fr/intro_to_pandas.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
Daniel-M/IntroPythonBiologos | doc/notes/IntroPythonBiologos.ipynb | gpl-3.0 | print("Hola mundo!")
print("1+1=",2)
print("Hola, otra vez","1+1=",2)
print("Hola, otra vez.","Sabias que 1+1 =",2,"?")
numero=3
print(numero)
numero=3.1415
print(numero)
"""
Explanation: Introducción a Python para Ciencias Biólogicas
Curso de Biofísica - Universidad de Antioquia
Daniel Mejía Raigosa (email: da... |
lneuhaus/pyrpl | docs/old_files/tutorial.ipynb | mit | import pyrpl
print pyrpl.__file__
"""
Explanation: Introduction to pyrpl
1) Introduction
The RedPitaya is an affordable FPGA board with fast analog inputs and outputs. This makes it interesting also for quantum optics experiments. The software package PyRPL (Python RedPitaya Lockbox) is an implementation of many devic... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-1/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-1', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: TEST-INSTITUTE-1
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Tra... |
shikhar413/openmc | examples/jupyter/search.ipynb | mit | # Initialize third-party libraries and the OpenMC Python API
import matplotlib.pyplot as plt
import numpy as np
import openmc
import openmc.model
%matplotlib inline
"""
Explanation: Criticality Search
This notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebo... |
landlab/landlab | notebooks/tutorials/terrain_analysis/steepness_finder/steepness_finder.ipynb | mit | import copy
import numpy as np
import matplotlib as mpl
from landlab import RasterModelGrid, imshow_grid
from landlab.io import read_esri_ascii
from landlab.components import FlowAccumulator, SteepnessFinder
"""
Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../../landlab_header.png">... |
eggie5/UCSD-MAS-DSE230 | hmwk4/HW4 - Linear Regression-Redacted.ipynb | mit | import pickle
import pandas as pd
!ls *.pickle # check
!curl -o "stations_projections.pickle" "http://mas-dse-open.s3.amazonaws.com/Weather/stations_projections.pickle"
data = pickle.load(open("stations_projections.pickle",'r'))
data.shape
data.head(1)
# break up the lists of coefficients separate columns
for col... |
vasco-da-gama/ros_hadoop | doc/Tutorial.ipynb | apache-2.0 | %%bash
echo -e "Current working directory: $(pwd)\n\n"
tree -d -L 2 /opt/ros_hadoop/
%%bash
# assuming you start the notebook in the doc/ folder of master (default Dockerfile build)
java -jar ../lib/rosbaginputformat.jar -f /opt/ros_hadoop/master/dist/HMB_4.bag
"""
Explanation: RosbagInputFormat
RosbagInputFormat is... |
kubeflow/examples | house-prices-kaggle-competition/house-prices-kale.ipynb | apache-2.0 | !pip install --user -r requirements.txt
"""
Explanation: Kaggle Getting Started Competition : House Prices - Advanced Regression Techniques
The notebook is based on the notebook provided for House prices Kaggle competition. The notebook is a buildup of hands-on-exercises presented in Kaggle Learn courses of Intermedia... |
cathalmccabe/PYNQ | docs/source/getting_started/python_environment.ipynb | bsd-3-clause | """Factors-and-primes functions.
Find factors or primes of integers, int ranges and int lists
and sets of integers with most factors in a given integer interval
"""
def factorize(n):
"""Calculate all factors of integer n.
"""
factors = []
if isinstance(n, int) and n > 0:
if n == 1:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.