repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
biosustain/cameo-notebooks | Advanced-SynBio-for-Cell-Factories-Course/Flux Balance Analysis.ipynb | apache-2.0 | import pandas
pandas.options.display.max_rows = 12
import escher
from cameo import models, fba
from cameo.exceptions import Infeasible
"""
Explanation: Flux Balance Analysis
Load a few packages and functions.
End of explanation
"""
model = models.bigg.e_coli_core.copy()
print(model.objective)
"""
Explanation: Pred... |
tommyogden/maxwellbloch | docs/examples/mbs-two-sech-2pi.ipynb | mit | import numpy as np
SECH_FWHM_CONV = 1./2.6339157938
t_width = 1.0*SECH_FWHM_CONV # [τ]
print('t_width', t_width)
mb_solve_json = """
{
"atom": {
"fields": [
{
"coupled_levels": [[0, 1]],
"rabi_freq_t_args": {
"n_pi": 2.0,
"centre": 0.0,
"width": %f
},
... |
ThunderShiviah/code_guild | interactive-coding-challenges/arrays_strings/reverse_string/reverse_string_challenge-Copy1.ipynb | mit | def list_of_chars(list_chars):
# TODO: Implement me
if li
return list_chars[::-1]
"""
Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small>
Challenge Notebook
Problem: Implement a function to reverse a string (a list of characters), in-pla... |
ioam/scipy-2017-holoviews-tutorial | notebooks/01-introduction-to-elements.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import holoviews as hv
hv.extension('bokeh')
"""
Explanation: <a href='http://www.holoviews.org'><img src="assets/hv+bk.png" alt="HV+BK logos" width="40%;" align="left"/></a>
<div style="float:right;"><h2>01. Introduction to Elements</h2></div>
Preliminaries
If the hvtutorial e... |
mne-tools/mne-tools.github.io | 0.20/_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... |
tpin3694/tpin3694.github.io | machine-learning/logistic_regression_with_l1_regularization.ipynb | mit | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
"""
Explanation: Title: Logistic Regression With L1 Regularization
Slug: logistic_regression_with_l1_regularization
S... |
linan7788626/tutmom | intro.ipynb | bsd-3-clause | import numpy as np
objective = np.poly1d([1.3, 4.0, 0.6])
print objective
"""
Explanation: Introduction to optimization
The basic components
The objective function (also called the 'cost' function)
End of explanation
"""
import scipy.optimize as opt
x_ = opt.fmin(objective, [3])
print "solved: x={}".format(x_)
%ma... |
regardscitoyens/consultation_an | exploitation/analyse_quanti_theme1.ipynb | agpl-3.0 | def loadContributions(file, withsexe=False):
contributions = pd.read_json(path_or_buf=file, orient="columns")
rows = [];
rindex = [];
for i in range(0, contributions.shape[0]):
row = {};
row['id'] = contributions['id'][i]
rindex.append(contributions['id'][i])
if (withsexe... |
leriomaggio/code-coherence-analysis | Benchmark Data.ipynb | bsd-3-clause | %load preamble_directives.py
"""
Explanation: Benchmark Creation
Notebook to create the report file to export Benchmark data (to be released)
Note: : this notebook assumes the use of Python 3
Preamble: Settings Django Environment
End of explanation
"""
from source_code_analysis.models import SoftwareProject
project... |
QuantStack/quantstack-talks | 2019-07-10-CICM/src/notebooks/DrawControl.ipynb | bsd-3-clause | dc = DrawControl(marker={'shapeOptions': {'color': '#0000FF'}},
rectangle={'shapeOptions': {'color': '#0000FF'}},
circle={'shapeOptions': {'color': '#0000FF'}},
circlemarker={},
)
def handle_draw(self, action, geo_json):
print(action)
print(ge... |
450586509/DLNLP | src/notebooks/CNN/CNN_random_word.ipynb | apache-2.0 | import keras
from os.path import join
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout,Activation, Lambda,Input
from keras.layers import Embedding
from keras.layers import Convolution1D
from keras.datasets import imdb
from keras import backend as K
f... |
sandeep-n/incubator-systemml | projects/breast_cancer/Preprocessing.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import shutil
import matplotlib.pyplot as plt
import numpy as np
from breastcancer.preprocessing import preprocess, save, train_val_split
# Ship a fresh copy of the `breastcancer` package to the Spark workers.
# Note: The zip must include the `breastca... |
mdiaz236/DeepLearningFoundations | tensorboard/.ipynb_checkpoints/Anna KaRNNa-checkpoint.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... |
synthicity/activitysim | activitysim/examples/example_estimation/notebooks/03_work_location.ipynb | agpl-3.0 | import larch # !conda install larch #for estimation
import pandas as pd
import numpy as np
import yaml
import larch.util.excel
import os
"""
Explanation: Estimating Workplace Location Choice
This notebook illustrates how to re-estimate a single model component for ActivitySim. This process
includes running Activit... |
mne-tools/mne-tools.github.io | 0.23/_downloads/6965b7b1a563cc32b2b5388d95203d43/60_cluster_rmANOVA_spatiotemporal.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Denis Engemannn <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.random import randn
import matplotlib.pyplot as plt
import mne
from mne.stat... |
fmfn/BayesianOptimization | examples/domain_reduction.ipynb | mit | import numpy as np
from bayes_opt import BayesianOptimization
from bayes_opt import SequentialDomainReductionTransformer
import matplotlib.pyplot as plt
"""
Explanation: Sequential Domain Reduction
Background
Sequential domain reduction is a process where the bounds of the optimization problem are mutated (typically c... |
jamesfolberth/NGC_STEM_camp_AWS | notebooks/machineLearning_notebooks/Intro Regression.ipynb | bsd-3-clause | import csv
import numpy as np
import scipy as sp
import pandas as pd
import sklearn as sk
import matplotlib.pyplot as plt
from IPython.display import Image
print('csv: {}'.format(csv.__version__))
print('numpy: {}'.format(np.__version__))
print('scipy: {}'.format(sp.__version__))
print('pandas: {}'.format(pd.__version... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/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', 'awi', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: AWI
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Transport, Emissions, Concent... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_home/2021_tsp.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: Algo - Aparté sur le voyageur de commerce
Le voyageur de commerce ou Travelling Salesman Problem en anglais est le problème NP-complet emblématique : il n'existe pas d'algorithme capable de trouver la solution optimale... |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/tensorflow/optimize/06a_Train_Model_XLA_GPU.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow.python.client import timeline
import pylab
import numpy as np
import os
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
tf.logging.set_verbosity(tf.logging.INFO)
"""
Explanation: Train Model with XLA_GPU (and CPU*)
Some operations do not have XLA_GPU equivale... |
RNAer/Calour | doc/source/notebooks/microbiome_manipulation.ipynb | bsd-3-clause | import calour as ca
ca.set_log_level(11)
%matplotlib notebook
"""
Explanation: Microbiome data manipulation tutorial
This is a jupyter notebook example of how to sort, filter and handle sample metadata
Setup
End of explanation
"""
cfs=ca.read_amplicon('data/chronic-fatigue-syndrome.biom',
'data/... |
cornhundred/ipywidgets | docs/source/examples/Widget Custom.ipynb | bsd-3-clause | from __future__ import print_function
"""
Explanation: Index - Back
End of explanation
"""
import ipywidgets as widgets
from traitlets import Unicode, validate
class HelloWidget(widgets.DOMWidget):
_view_name = Unicode('HelloView').tag(sync=True)
_view_module = Unicode('hello').tag(sync=True)
"""
Explanat... |
jeffzhengye/pylearn | tensorflow_learning/tf2/notebooks/tf_keras_介绍_工程师版.ipynb | unlicense | import numpy as np
import tensorflow as tf
from tensorflow import keras
"""
Explanation: TensorFlow Keras 介绍-工程师版
Author: fchollet<br>
Date created: 2020/04/01<br>
Last modified: 2020/04/28<br>
Description: 使用TensorFlow keras高级api构建真实世界机器学习解决方案你所需要知道的 (Everything you need to know to use Keras to build real-world machi... |
rjdkmr/do_x3dna | docs/notebooks/calculate_elasticity_tutorial.ipynb | gpl-3.0 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import dnaMD
%matplotlib inline
"""
Explanation: Elastic Properties and Deformation Energy
This tutorial discuss the analyses that can be performed using the dnaMD Python module included in the do_x3dna package. The tutorial is prepared usi... |
marco-olimpio/ufrn | EEC2006/5_FinalProject_Regression_KNN/.ipynb_checkpoints/ForestFirePredictionVictor-checkpoint.ipynb | gpl-3.0 | Victor acho que poderíamos abordar isso no trabalho
https://machinelearningmastery.com/feature-selection-machine-learning-python/
mas podemos deixar para depois que terminar, seria a cereja do bolo
"""
Explanation: Forest Fire Span Prediction
Objectives:
This notebook aims to explore a dataset where you could apply ... |
kkhenriquez/python-for-data-science | Week-8-NLP-Databases/Natural Language Processing of Movie Reviews using nltk .ipynb | mit | import nltk
nltk.download("movie_reviews")
nltk.download()
"""
Explanation: Natural Language Processing with nltk
nltk is the most popular Python package for Natural Language processing, it provides algorithms for importing, cleaning, pre-processing text data in human language and then apply computational linguistic... |
PythonFreeCourse/Notebooks | week03/1_While_Loops.ipynb | mit | current_number = 2
while current_number <= 16:
twice_number = current_number + current_number
print(f"{current_number} and {current_number} are {twice_number}")
current_number = twice_number
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו... |
feststelltaste/software-analytics | courses/20190918_Uni_Leipzig/Data Science On Software Data (Presentation).ipynb | gpl-3.0 | pd.read_csv("../datasets/google_trends_datascience.csv", index_col=0).plot();
"""
Explanation: Data Science on <br/> Software Data
<b>Markus Harrer</b>, Software Development Analyst
@feststelltaste
<small>Visual Software Analytics Summer School, 18 September 2019</small>
<img src="../../demos/resources/innoq_logo.jpg"... |
tcstewar/testing_notebooks | Working memory overshoot.ipynb | gpl-2.0 | dimensions = 10
input_scale = 1
n_neurons_per_dim = 50
intercept_low = -0.5
intercept_high = 1.0
tau_input = 0.01
tau_recurrent = 0.1
tau_reset = 0.2
max_rate_high = 200
max_rate_low = 150
sensory_delay = 0.05
reset_scale = 0.3
model = nengo.Network()
with model:
vocab = spa.Vocabulary(dimensions)
value = voca... |
empet/PSCourse | Histograme.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
u=np.random.random()
print u
v=np.random.random(5)
print v
A=np.random.random((2,3))
print A
"""
Explanation: Generatori ai distributilor de probabilitate din Numpy. Histograme
Biblioteca numpy.random contine functii ce implementeaza algoritmi de... |
Rodolfobm/DLND-First-Project_First_Neural_Network | dlnd-your-first-neural-network.ipynb | gpl-3.0 | %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... |
yl565/statsmodels | examples/notebooks/statespace_varmax.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
dta = sm.datasets.webuse('lutkepohl2', 'http://www.stata-press.com/data/r12/')
dta.index = dta.qtr
endog = dta.ix['1960-04-01':'1978-10-01', ['dln_inv', 'dln_inc', 'dln_consump']]
"""
Explanation: V... |
jmschrei/pomegranate | tutorials/old/Tutorial_5_Bayes_Classifiers.ipynb | mit | X = numpy.concatenate((numpy.random.normal(3, 1, 200), numpy.random.normal(10, 2, 1000)))
y = numpy.concatenate((numpy.zeros(200), numpy.ones(1000)))
x1 = X[:200]
x2 = X[200:]
plt.figure(figsize=(16, 5))
plt.hist(x1, bins=25, color='m', edgecolor='m', label="Class A")
plt.hist(x2, bins=25, color='c', edgecolor='c', l... |
mlhhu2017/identifyDigit | bekcic/gaussian_multivar.ipynb | mit | training, test = load_sorted_data('data_notMNIST')
PRIORS = {'id': lambda data: [np.identity(len(data[0][0])) for _ in range(len(data))],
'var': lambda data: variance(data),
'var_1': lambda data: variance(data, axis=0),
'cov': lambda data: covariance(data)}
means = mean(training)
sigma = {}
f... |
wcmckee/ece-display | niktrans.ipynb | mit | import os
import json
os.system('python3 nikoladu.py')
os.chdir('/home/wcmckee/nik1/')
os.system('nikola build')
os.system('rsync -azP /home/wcmckee/nik1/* wcmckee@wcmckee.com:/home/wcmckee/github/wcmckee.com/output/minedujobs')
opccschho = open('/home/wcmckee/ccschool/cctru.json', 'r')
opcz = opccschho.read()
rssc... |
ethen8181/machine-learning | recsys/ann_benchmarks/ann_benchmarks.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(css_style='custom2.css', plot_style=False)
os.chdir(path)
# 1. magic for inline plot... |
wzxiong/DAVIS-Machine-Learning | labs/lab3-soln.ipynb | mit | # %load ../standard_import.txt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import scale
from sklearn.model_selection import LeaveOneOut
from sklearn.linear_model import LinearRegression, lars_path, Lasso, LassoCV
%matplotlib inline
n=100
p=1000
X = np.random.rand... |
ogaway/Econometrics | SimultaneousEquation.ipynb | gpl-3.0 | %matplotlib inline
# -*- coding:utf-8 -*-
from __future__ import print_function
import numpy as np
import pandas as pd
import statsmodels.api as sm
from statsmodels.sandbox.regression.gmm import IV2SLS
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
# データ読み込み
data = pd.read_csv('exam... |
eaton-lab/toytree | sandbox/quartet-funcs.ipynb | bsd-3-clause | import toytree
import itertools
import numpy as np
"""
Explanation: toytree quartet functions (in progress)
End of explanation
"""
t0 = toytree.rtree.unittree(10, seed=0)
t1 = toytree.rtree.unittree(10, seed=1)
toytree.mtree([t0, t1]).draw(ts='p', height=200);
"""
Explanation: get two random trees
End of explanati... |
sastels/Onboarding | 6.5 - Baby names.ipynb | mit | import sys
import re
"""
Explanation: Baby names
End of explanation
"""
def extract_names(filename):
"""
Given a file name for baby.html, returns a list starting with the year string
followed by the name-rank strings in alphabetical order.
['2006', 'Aaliyah 91', Aaron 57', 'Abagail 895', ' ...]
"... |
dhhagan/py-openaq | docs/tutorial/delhi.ipynb | mit | import pandas as pd
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
import openaq
import warnings
warnings.simplefilter('ignore')
%matplotlib inline
# Set major seaborn asthetics
sns.set("notebook", style='ticks', font_scale=1.0)
# Increase the quality of inline plots
mpl.rcParams['fi... |
QuantEcon/QuantEcon.notebooks | ddp_ex_career_py.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
from matplotlib import cm
import quantecon as qe
from quantecon.markov import DiscreteDP
# matplotlib settings
plt.rcParams['axes.xmargin'] = 0
plt.rcParams['axes.ymargin'] = 0
plt.rcParams['patch.forc... |
flowersteam/explauto | notebook/goal_babbling_direct_optimization.ipynb | gpl-3.0 | from explauto import Environment
environment = Environment.from_configuration('simple_arm', 'mid_dimensional')
environment.noise = 0.01
print "Motor bounds", environment.conf.m_bounds
print "Sensory bounds", environment.conf.s_bounds
"""
Explanation: Goal Babbling with direct optimization
In our previous implementati... |
uliang/First-steps-with-the-Python-language | Day 1 - Unit 2.3 Data Manipulations.ipynb | mit | import numpy as np
import pandas as pd
"""
Explanation: 2.3 Data Manipulations
Content:
- 2.3.1 Groupby: split-apply-combine
- 2.3.2 Merging dataframes
- 2.3.3 Melting dataframes (wide-form to long-form)
- 2.3.4 Exercises
Import libraries
End of explanation
"""
user = pd.read_csv('http://files.grouplens.org/data... |
AllenDowney/ModSimPy | soln/chap05soln.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 *
"""
Explanation: Modeling and Simulati... |
PMEAL/OpenPNM | examples/simulations/percolation/B_invasion_percolation.ipynb | mit | import sys
import openpnm as op
import numpy as np
np.random.seed(10)
import matplotlib.pyplot as plt
import porespy as ps
from ipywidgets import interact, IntSlider
from openpnm.topotools import trim
%matplotlib inline
ws = op.Workspace()
ws.settings["loglevel"] = 50
"""
Explanation: Invasion Percolation
The next per... |
ChristopherHogan/cython | docs/src/quickstart/cython_in_jupyter.ipynb | apache-2.0 | %load_ext cython
"""
Explanation: Installation
pip install cython
Using inside Jupyter notebook
Load th cythonmagic extension.
End of explanation
"""
%%cython
cdef int a = 0
for i in range(10):
a += i
print(a)
"""
Explanation: Then, simply use the magic function to start writing cython code.
End of explanation... |
wanderer2/pymc3 | docs/source/notebooks/lda-advi-aevb.ipynb | apache-2.0 | %matplotlib inline
import sys, os
import theano
theano.config.floatX = 'float64'
from collections import OrderedDict
from copy import deepcopy
import numpy as np
from time import time
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.datasets import fetch_20newsgroups
import ma... |
prk327/CoAca | Investment Case Group Project/1_Data_Cleaning.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# reading data files
# using encoding = "ISO-8859-1" to avoid pandas encoding error
rounds = pd.read_csv("rounds2.csv", encoding = "ISO-8859-1")
companies = pd.read_csv("companies.txt", sep="\t", encoding = "ISO-8859-1")
# ... |
graphistry/pygraphistry | demos/more_examples/graphistry_features/encodings-icons.ipynb | bsd-3-clause | # ! pip install --user graphistry
import graphistry
# To specify Graphistry account & server, use:
# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')
# For more options, see https://github.com/graphistry/pygraphistry#configure
graphistry.__version__
import dat... |
yuhao0531/dmc | notebooks/week-3/01-basic ann.ipynb | apache-2.0 | %matplotlib inline
import random
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set(style="ticks", color_codes=True)
from sklearn.preprocessing import OneHotEncoder
from sklearn.utils import shuffle
"""
Explanation: Lab 3 - Basic Artificial Neural Network
In this lab we will build a very... |
zerothi/sids | docs/tutorials/tutorial_es_2.ipynb | lgpl-3.0 | graphene = geom.graphene()
H = Hamiltonian(graphene)
H.construct([(0.1, 1.44), (0, -2.7)])
"""
Explanation: Berry phase calculation for graphene
This tutorial will describe a complete walk-through of how to calculate the Berry phase for graphene.
Creating the geometry to investigate
Our system of interest will be the ... |
MilweeScience/Turner | Erosion_Turner.ipynb | mit | #importing what we'll need to use our data.
import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt; plt.rcdefaults()
import matplotlib.pyplot as plt
"""
Explanation: Erosion: Here Today, Gone Tomorrow
This Juptyer Notebooks will allow for the graphing of erosion data. We will use th... |
csaladenes/blog | kendo romania/scripts/.ipynb_checkpoints/cleanerÜold-checkpoint.ipynb | mit | import pandas as pd, numpy as np, json
import members_loader, matches_loader, clubs_loader, point_utils, save_utils
"""
Explanation: Romania Kendo Stats
25 years of Kendo History in Romania, visualized
Data cleaning workbook
Created by Dénes Csala | 2019 | MIT License
For any improvement suggestions and spotted proce... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topics: Transport, Emission... |
abhay1/tf_rundown | notebooks/Introduction.ipynb | mit | import tensorflow as tf
# Create a tensorflow constant
hello = tf.constant("Hello World!")
# Print this variable as is
print(hello)
"""
Explanation: Introduction
Hello world!
tf.constant: A tensor flow constant! Can be a string, number or a tensor. Once the value for a constant is set, it can never change!
End of ex... |
hackthemarket/pystrat | DEN2_features.ipynb | gpl-3.0 | # imports
import collections
import pandas as pd
import numpy as np
from scipy import stats
import sklearn
from sklearn import preprocessing as pp
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import interactive
import sys
import tensorflow as tf
import time
import os
import os.path
import ... |
ES-DOC/esdoc-jupyterhub | notebooks/bnu/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: BNU
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
fevangelista/wicked | examples/numerical/spinorbital-CCSD.ipynb | mit | import time
import wicked as w
import numpy as np
from examples_helpers import *
"""
Explanation: CCSD theory for a closed-shell reference
In this notebook we will use wicked to generate and implement equations for the CCSD method.
To simplify this notebook some of the utility functions are imported from the file exam... |
GoogleCloudPlatform/tf-estimator-tutorials | 04_Times_Series/02.0 - TF ARRegressor - Experiment + CSV.ipynb | apache-2.0 | TIME_INDEX_FEATURE_NAME = 'time_index'
VALUE_FEATURE_NAMES = ['value']
"""
Explanation: Steps to use the ARRegressor + Experiment API
Define the metadata
Define a data (csv) input function
Define a create Estimator function
Run an Experiment with learn_runner to train, evaluate, and export the model
Predict using the... |
5hubh4m/CS231n | Assignment1/two_layer_net.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
%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-reloadi... |
ajhenrikson/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."""
t=(b-a)/N
p=np.linspace(a,b,N+1)
weight... |
tobiajo/hops-tensorflow | yarntf/examples/slim/slim_walkthrough.ipynb | apache-2.0 | import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
import math
import numpy as np
import tensorflow as tf
import time
from datasets import dataset_utils
# Main slim library
slim = tf.contrib.slim
"""
Explanation: TF-Slim Walkthrough
This notebook will walk you through the basics of using TF-Slim to... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/statespace_forecasting.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
macrodata = sm.datasets.macrodata.load_pandas().data
macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q')
"""
Explanation: Forecasting in statsmodels
This notebook describes forecasting u... |
tensorflow/examples | courses/udacity_deep_learning/3_regularization.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
"""
Explanation: Deep Learning
Assignment 3
Previously in 2_fullyconnected.ipynb, you tra... |
jeroarenas/MLBigData | 2_Classification/Classification III-student.ipynb | mit | %matplotlib inline
"""
Explanation: Classification III Lab: Working with classifiers
In this lab session we are going to continue working with classification algorithms, mainly, we are going to focus on decision trees and their use in ensembles.
During this lab we will cover:
* Part 1: Trees*
* Part 2: Random fores... |
utensil/julia-playground | py/profile_mv_dual.ipynb | mit | !pip install pyprof2calltree
!brew install qcachegrind
%%writefile test_41.py
from galgebra.ga import Ga
GA = Ga('e*1|2|3')
a = GA.mv('a', 'vector')
b = GA.mv('b', 'vector')
c = GA.mv('c', 'vector')
def cross(x, y):
return (x ^ y).dual()
xx = cross(a, cross(b, c))
!python -m cProfile -o test_41.cprof test_41.... |
morganics/bayesianpy | examples/notebook/titanic_classification.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import re
import sys
sys.path.append("../../../bayesianpy")
import bayesianpy
import bayesianpy.visual
import logging
import os
from sklearn.cross_validation import KFold
from sklearn.metrics import accuracy_score
pattern = re.compile("([A-Z]{1})([0-9]{1,3})... |
3upperm2n/notes-deeplearning | projects/tv_script_generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
mdastro/UV_ETGs | GAMAII/Coding/CatAnalysis_Part01.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
from __future__ import unicode_literals
from matplotlib.gridspec import GridSpec
# %matplotlib notebook
"""
Explanation: Libraries
End of... |
AllenDowney/ModSimPy | notebooks/chap21.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 *
"""
Explanation: Modeling and Simulati... |
robertoalotufo/ia898 | 2S2018/Ex09 Tecnicas de segmentacao.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
"""
Explanation: Ex09 - Técnicas de segmentação
End of explanation
"""
im2 = mpimg.imread('../data/astablet.tif')
plt.imshow(im2, cmap='gray')
"""
Explanation: Parte 1 - Segmentando múltiplos objetos por limiariz... |
aje/POT | notebooks/plot_optim_OTreg.ipynb | mit | import numpy as np
import matplotlib.pylab as pl
import ot
import ot.plot
"""
Explanation: Regularized OT with generic solver
Illustrates the use of the generic solver for regularized OT with
user-designed regularization term. It uses Conditional gradient as in [6] and
generalized Conditional Gradient as proposed in [... |
MPBA/pyHRV | tutorials/4-misc.ipynb | gpl-3.0 | # import libraries
from __future__ import division
import numpy as np
import os
import matplotlib.pyplot as plt
from pyphysio.tests import TestData
%matplotlib inline
# import all pyphysio classes and methods
import pyphysio as ph
# import data and creating a signal
ecg_data = TestData.ecg()
fsamp = 2048
ecg = ph.E... |
endangeredoxen/pywebify | pywebify/tests/webpages.ipynb | gpl-2.0 | %load_ext autoreload
%autoreload 2
import os, sys
path = os.path.abspath('../..'); sys.path.insert(0, path) if path not in sys.path else None
from IPython.display import HTML
from pywebify import webpage
Page = webpage.Webpage
"""
Explanation: webpages module
author: kevin.tetz
description: webpages module tests
End ... |
tpin3694/tpin3694.github.io | machine-learning/find_maximum_and_minimum.ipynb | mit | # Load library
import numpy as np
"""
Explanation: Title: Find The Maximum And Minimum
Slug: find_maximum_and_minimum
Summary: How to find the maximum, minimum, and average of the elements in an array.
Date: 2017-09-03 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
Preliminarie... |
dbouquin/IS_608 | 608_HW4/IS608_HW4.ipynb | mit | # Import modules for analysis and visualization
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats.mstats import gmean
import numpy as np
from numpy import genfromtxt
import os.path
from datetime import datetime
# Clean up and import (pandas)
data_url = "https://raw.githubuserco... |
alsam/Claw.jl | src/euler/Euler_approximate.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'svg'
import numpy as np
from exact_solvers import euler
from utils import riemann_tools as rt
from ipywidgets import interact
from ipywidgets import widgets
State = euler.Primitive_State
def roe_averages(q_l, q_r, gamma=1.4):
rho_sqrt_l = np.sqrt(q_l[0])
... |
LeonardoCastro/Servicio_social | Parte 2 - PyCUDA y aplicaciones/06 - Impresiones y tiempos en PyCUDA.ipynb | mit | %%writefile ./Programas/saludar.py
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
mod = SourceModule("""
#include <stdio.h>
__global__ void saluda()
{
printf("Mi indice x es %d, mi indice en y es %d\\n", threadIdx.x, threadIdx.y);
}
""")
func = ... |
jsjol/GaussianProcessRegressionForDiffusionMRI | notebooks/show_ODFs.ipynb | bsd-3-clause | dataset = 'SPARC'
if dataset == 'HCP':
subject_path = conf['HCP']['data_paths']['mgh_1007']
loader = get_HCP_loader(subject_path)
small_data_path = '{}/mri/small_data.npy'.format(subject_path)
loader.update_filename_data(small_data_path)
data = loader.data
gtab = loader.gtab
voxel_size = ... |
UWPreMAP/PreMAP2017 | lessons/06-plotting.ipynb | mit | #The following set of commands are needed if you're on a MacOS and not Linux, which is none of you in class, so don't worry about it!
#import matplotlib
#matplotlib.use('TkAgg')
# we use matplotlib and specifically pyplot
# the convention is to import it like this:
import matplotlib.pyplot as plt
# We'll also read s... |
luisdelatorre012/luisdelatorre012.github.io | Using usaddress.ipynb | mit | import usaddress
addr='123 Main St. Suite 100 Chicago, IL'
address_tag = usaddress.tag(addr)
address_tag
"""
Explanation: This notebook describes setting up and testing the usaddress package from datamade.
The first step was installation. I couldn't get usaddress to build with pip, so I added conda forge and installed... |
ES-DOC/esdoc-jupyterhub | notebooks/uhh/cmip6/models/sandbox-2/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'uhh', 'sandbox-2', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: UHH
Source ID: SANDBOX-2
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbulen... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160614화_15일차_분류의 기초 Basic Classification/2.분류(classification)의 기초.ipynb | mit | X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
y = np.array([1, 1, 1, 2, 2, 2])
plt.scatter(X.T[0], X.T[1], c=y, s=100, cmap=mpl.cm.brg)
plt.title("data")
plt.show()
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
model = QuadraticDiscriminantAnalysis().fit(X, y)
x = [[0,... |
bspalding/research_public | advanced_sample_analyses/drafts/Different definitions of momentum.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
k = 30
start = '2014-01-01'
end = '2015-01-01'
pricing = get_pricing('PEP', fields='price', start_date=start, end_date=end)
fundamentals = init_fundamentals()
num_shares = get_fundamentals(query(fundamentals.earnings_report.basic_average_shares,)
... |
CalPolyPat/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... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160524화_7일차_기초 확률론 3 - 확률 모형 Probability Models(단변수 분포)/4.Student-t 분포.ipynb | mit | import pandas.io.data as web
symbols = ['^GDAXI', '^GSPC', 'YHOO', 'MSFT']
data = pd.DataFrame()
for sym in symbols:
data[sym] = web.DataReader(sym, data_source='yahoo', start='1/1/2006', end='12/31/2016')['Adj Close']
data = data.dropna()
(data / data.ix[0] * 100).plot()
plt.show()
log_returns = np.log(data / dat... |
QuantScientist/Deep-Learning-Boot-Camp | day02-PyTORCH-and-PyCUDA/PyCUDA/01 PyCUDA verify CUDA 8.0.ipynb | mit | # Ignore numpy warnings
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
%matplotlib inline
# Some defaults:
plt.rcParams['figure.figsize'] = (12, 6) # Default plot size
"""
Explanation: Deep Learning Bootcamp November 2017, GPU Computing for Data Scientists
<img src="../images/bcamp.... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/official/workbench/subscriber_churn_prediction/telecom-subscriber-churn-prediction.ipynb | apache-2.0 | import os
# The Google Cloud Notebook product has specific requirements
IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version")
USER_FLAG = ""
# Google Cloud Notebook requires dependencies to be installed with '--user'
if IS_GOOGLE_CLOUD_NOTEBOOK:
USER_FLAG = "--user"
! pip install {U... |
brunoalano/hdbscan | notebooks/Benchmarking scalability of clustering implementations-v0.7.ipynb | bsd-3-clause | import hdbscan
import debacl
import fastcluster
import sklearn.cluster
import scipy.cluster
import sklearn.datasets
import numpy as np
import pandas as pd
import time
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
sns.set_context('poster')
sns.set_palette('Paired', 10)
sns.set_color_codes()
"... |
srcole/qwm | burrito/Burrito_Rankings.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Rankings
Scott Cole
21 May 2016
This notebook ranks each taco shop alo... |
vangj/py-bbn | jupyter/some-features.ipynb | apache-2.0 | import json
from pybbn.graph.variable import Variable
from pybbn.graph.node import BbnNode
from pybbn.graph.edge import Edge, EdgeType
from pybbn.graph.dag import Bbn
a = BbnNode(Variable(0, 'a', ['t', 'f']), [0.2, 0.8])
b = BbnNode(Variable(1, 'b', ['t', 'f']), [0.1, 0.9, 0.9, 0.1])
bbn = Bbn().add_node(a).add_node(... |
probml/pyprobml | notebooks/book1/09/naive_bayes_mnist_jax.ipynb | mit | import numpy as np
try:
import torchvision
except ModuleNotFoundError:
%pip install -qq torchvision
import torchvision
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
!mkdir figures # for saving plots
key = jax.random.PRNGKey(1)
# helper function to show images
def show_images(imgs, ... |
datascience-practice/data-quest | python_introduction/intermediate/indexing-and-more-functions.ipynb | mit | x = 3
# The loop body will execute three times. Once when x == 3, once when x == 4, and once when x == 5.
# Then x < 6 will evaluate to False, and it will stop.
# 3, 4, and 5 will be printed out.
while x < 6:
print(x)
# Using += is a shorter way of saying x = x + 1. It will add one to x.
x += 1
b = 10
"... |
AlJohri/DAT-DC-12 | notebooks/intro-numpy.ipynb | mit | %matplotlib inline
import traceback
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Introduction to NumPy
Forked from Lecture 2 of Scientific Python Lectures by J.R. Johansson
End of explanation
"""
%%time
total = 0
for i in range(100000):
total += i
%%time
total = np.arange(100000).sum(... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/building_production_ml_systems/labs/3_kubeflow_pipelines.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
pip freeze | grep kfp || pip install kfp
from os import path
import kfp
import kfp.compiler as compiler
import kfp.components as comp
import kfp.dsl as dsl
import kfp.gcp as gcp
import kfp.notebook
"""
Explanation: Kubeflow pipelines
Learning Object... |
genome-nexus/genome-nexus | notebooks/genome_nexus_python_example.ipynb | mit | from bravado.client import SwaggerClient
client = SwaggerClient.from_url('https://www.genomenexus.org/v2/api-docs',
config={"validate_requests":False,"validate_responses":False,"validate_swagger_spec":False})
print(client)
dir(client)
for a in dir(client):
client.__setattr__(a[:-le... |
austinjalexander/sandbox | python/py/NN.ipynb | mit | # activation function: rectified linear function
def g(a):
np.max(0,a)
"""
Explanation: $\textbf{w}$: connection weights
$b$: neuron bias
$g(\cdot)$: activation function
activation function examples:
linear: $g(a) = a$
sigmoid: $g(a) = \text{sigm}(a) = \frac{1}{1+\text{exp}(-a)} = \frac{1}{1+e^{-a}}$
hyperbolic ta... |
vadim-ivlev/STUDY | algorithms/.ipynb_checkpoints/tutorial_full-checkpoint.ipynb | mit | import networkx as nx
G = nx.Graph()
G
"""
Explanation: <!-- -*- coding: utf-8 -*- -->
Tutorial
This guide can help you start working with NetworkX.
Creating a graph
Create an empty graph with no nodes and no edges.
End of explanation
"""
G.add_node(1)
"""
Explanation: By definition, a Graph is a collection of node... |
google/lifetime_value | notebooks/kaggle_acquire_valued_shoppers_challenge/regression.ipynb | apache-2.0 | import os
import numpy as np
import pandas as pd
from scipy import stats
import seaborn as sns
from sklearn import model_selection
from sklearn import preprocessing
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
import tensorflow_probability as tfp
import tqdm
from typin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.