repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
martinjrobins/hobo | examples/optimisation/maximum-likelihood.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
import pints
import pints.toy as toy
# Create a model
model = toy.LogisticModel()
# Set some parameters
real_parameters = [0.1, 50]
# Create fake data
times = model.suggested_times()
values = model.simulate(real_parameters, times)
sigma = 3
noisy_values = values + ... |
batfish/pybatfish | jupyter_notebooks/Introduction to BGP Analysis.ipynb | apache-2.0 | # Import packages
%run startup.py
bf = Session(host="localhost")
"""
Explanation: Introduction to BGP Analysis using Batfish
Network engineers routinely need to validate BGP configuration and session status in the network. They often do that by connecting to multiple network devices and executing a series of show ip ... |
srcole/qwm | yelp/.ipynb_checkpoints/Analyze - food by cities-checkpoint.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import glob
import os
import scipy as sp
from scipy import stats
from tools.plt import color2d #from the 'srcole/tools' repo
from matplotlib import cm
"""
Explanation: Data: 1000 restaurants for each city
Cuisines: most popular... |
hvillanua/deep-learning | 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... |
danielfather7/teach_Python | lecture/04.Procedural_Python.ipynb | gpl-3.0 | my_tuple = ('I', 'like', 'cake')
my_tuple
"""
Explanation: Procedural programming in python
Topics
Tuples, lists and dictionaries
Flow control, part 1
If
For
range() function
Some hacky hack time
Flow control, part 2
Functions
<hr>
Tuples
Let's begin by creating a tuple called my_tuple that contains three elements.... |
TwistedHardware/mltutorial | notebooks/tf/3. Variables.ipynb | gpl-2.0 | import tensorflow as tf
import sys
print("Python Version:",sys.version.split(" ")[0])
print("TensorFlow Version:",tf.VERSION)
"""
Explanation: <table>
<tr>
<td style="text-align:left;"><div style="font-family: monospace; font-size: 2em; display: inline-block; width:60%">3. Variables</div><img src="images/... |
siva82kb/siva82kb.github.io | .old/notebooks/2018-09-15-Least-Square-Estimation-of-AR-Models-And-Whitening-Part-I.ipynb | gpl-2.0 | _ = genEstARProc(p=1, N=1000)
"""
Explanation: Least Square Estimation of AR Models and Whitening - Part I
Estimation of a AR process of order 1 using the entire dataset
End of explanation
"""
param, fig = genRunEstARProc(p=1, N=2000, L=100, dL=1, eparam=(0, 1.0))
fig.savefig("../figs/ar1.png", format="png", dpi=30... |
Diyago/Machine-Learning-scripts | statistics/Критерии согласия Пирсона (хи-квадрат) stat.hi2_test.ipynb | apache-2.0 | import numpy as np
import pandas as pd
from scipy import stats
%pylab inline
"""
Explanation: Критерий согласия Пирсона ( $\chi^2$)
End of explanation
"""
fin = open('fertility.txt', 'r')
data = map(lambda x: int(x.strip()), fin.readlines())
data[:20]
pylab.bar(range(12), np.bincount(data), color = 'b', label = ... |
OSGeo-live/CesiumWidget | GSOC/notebooks/Projects/GRASS/Introduction to GRASS GIS/igrass/Command_parsing.ipynb | apache-2.0 | !g.gisenv
"""
Explanation: Well use an utility script with few lines of code to parse the output of GRASS commands and make new functions that use the parsed output.
The script use ipython specific syntax like !system_command which allows to run any command available in the user $PATH. The code is saved in a file with... |
cmshobe/landlab | notebooks/tutorials/reading_dem_into_landlab/reading_dem_into_landlab.ipynb | mit | from landlab.io import read_esri_ascii
"""
Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../landlab_header.png"></a>
How to read a DEM as a Landlab grid
This tutorial demonstrates how to create and initialize a Landlab grid using a Digital Elevation Model (DEM). The DEM is in ESRI's ... |
CSchoel/learn-wavelets | wavelet-introduction.ipynb | mit | %matplotlib inline
# we will use numpy and matplotlib for all the following examples
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def mexican_hat(x, mu, sigma):
return 2 / (np.sqrt(3 * sigma) * np.pi**0.25) * (1 - x**2 / sigma**2) * np.exp(-x**2 / (2 * sigma**2) )
xvals = np.arange(-10,10,... |
jmschrei/pomegranate | examples/hmm_tied_states.ipynb | mit | from pomegranate import *
import random
import numpy as np
random.seed(0)
"""
Explanation: Tied States Hidden Markov Model
authors:<br>
Jacob Schreiber [<a href="sendto:jmchreiber91@gmail.com">jmchreiber91@gmail.com</a>],<br>
Nicholas Farn [<a href="sendto:nicholasfarn@gmail.com">nicholasfarn@gmail.com</a>]
An exampl... |
AllenDowney/ModSim | python/soln/chap16.ipynb | gpl-2.0 | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
shikhar413/openmc | examples/jupyter/nuclear-data.ipynb | mit | %matplotlib inline
import os
from pprint import pprint
import shutil
import subprocess
import urllib.request
import h5py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm
from matplotlib.patches import Rectangle
import openmc.data
"""
Explanation: Nuclear Data
In this notebook, we will go throu... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/cmip6/models/sandbox-2/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cams', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
quantumlib/Cirq | docs/qcvv/parallel_xeb.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... |
christophmark/bayesloop | docs/source/examples/anomalousdiffusion.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
D = np.linspace(0.0, 15., 500)
x = np.arange(500)
plt.figure(figsize=(8,2))
plt.fill_between(x, D, 0)
plt.xlabel('x position [a.u.]')
plt.ylabel('D [a.u.]');
"""
Explanation: Anomalous diffusion
Diffusion processes are mostly... |
Jydago/PortoDriverPrediction | old_examples/Titanic_Knattra.ipynb | gpl-3.0 | # pandas
import pandas as pd
from pandas import Series,DataFrame
# Used for pretty print DataFrames
from IPython.display import display
import math
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.mlab as mlab
from scipy import stats
from scipy.stats import norm
%matplotlib ... |
darcamo/pyphysim | notebooks/Transmission_with_AWGN_channel.ipynb | gpl-2.0 | %matplotlib inline
import math
import numpy as np
from matplotlib import pyplot as plt
from pyphysim.modulators.fundamental import BPSK, QAM, QPSK, Modulator
from pyphysim.simulations import Result, SimulationResults, SimulationRunner
from pyphysim.util.conversion import dB2Linear
from pyphysim.util.misc import pret... |
mjbrodzik/ipython_notebooks | charis/Display_scag_with_basin_outline.ipynb | apache-2.0 | import cartopy.io.shapereader as shpreader
import shapely.geometry as sgeom
bfile = '/Users/brodzik/Desktop/GIS_data/basins/IN_Hunza_at_DainyorBridge.shp'
reader = shpreader.Reader(bfile)
record = next(reader.records())
record
record.attributes
record.bounds
record.geometry
help(record)
"""
Explanation: Using c... |
mne-tools/mne-tools.github.io | 0.24/_downloads/1242d47b65d952f9f80cf19fb9e5d76e/35_eeg_no_mri.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import mne
from mne.datasets import eegbci
from mne.datasets import fetch_fsaverage
# Download fsaverage files
fs_dir = fetch_fsaverage(verbose=True)
subjects_dir = op.dirname(fs_dir)
# The files live in:
subject = 'fsaverage'
trans = 'fsaverage' # MNE has a built-in fsaverag... |
statsmodels/statsmodels.github.io | v0.13.0/examples/notebooks/generated/discrete_choice_overview.ipynb | bsd-3-clause | import numpy as np
import statsmodels.api as sm
"""
Explanation: Discrete Choice Models Overview
End of explanation
"""
spector_data = sm.datasets.spector.load()
spector_data.exog = sm.add_constant(spector_data.exog, prepend=False)
"""
Explanation: Data
Load data from Spector and Mazzeo (1980). Examples follow Gree... |
tarashor/vibrations | py/notebooks/.ipynb_checkpoints/MatricesForOrthogonalCoordinatesLameCoeffFromCurvature-checkpoint.ipynb | mit | from sympy import *
from geom_util import *
from sympy.vector import CoordSys3D
N = CoordSys3D('N')
alpha1, alpha2, alpha3 = symbols("alpha_1 alpha_2 alpha_3", real = True, positive=True)
init_printing()
%matplotlib inline
%reload_ext autoreload
%autoreload 2
%aimport geom_util
"""
Explanation: Matrix generation
Ini... |
mldbai/mldb | container_files/tutorials/Loading Data From An HTTP Server Tutorial.ipynb | apache-2.0 | from pymldb import Connection
mldb = Connection()
"""
Explanation: Loading Data From An HTTP Server Tutorial
MLDB gives users full control over where and how data is persisted. MLDB handles multiple protocol for URLs (see Files and URLs). In this tutorial, we provide examples to load files via <code> http:// </code> o... |
tensorflow/docs-l10n | site/ko/tutorials/generative/cyclegan.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... |
tritemio/multispot_paper | realtime kinetics/8-spot bubble-bubble kinetics - Template.ipynb | mit | import time
from pathlib import Path
import pandas as pd
from scipy.stats import linregress
from IPython.display import display
from fretbursts import *
sns = init_notebook(fs=14)
import lmfit; lmfit.__version__
import phconvert; phconvert.__version__
"""
Explanation: Notebook arguments
measurement_id (int): Sele... |
nicococo/tilitools | notebooks/high_dimensional_outlier_detection.ipynb | mit | %matplotlib inline
import numpy as np
import scipy.spatial.distance as dist
import matplotlib.pyplot as plt
"""
Explanation: High-dimensional Outlier Detection - Introduction
This notebook is all about the paper by Beyer et al. [1] and, i.e. their Theorem 1 that
formalized the problem of nearest neighbor based outlier... |
dcavar/python-tutorial-for-ipython | notebooks/Flair Tutorial on Document Classification.ipynb | apache-2.0 | from flair.data_fetcher import NLPTaskDataFetcher
from flair.data import TaggedCorpus
from pathlib import Path
"""
Explanation: Flair Tutorial on Document Classification
(C) 2019 by Damir Cavar
Version: 0.2, September 2019
Download: This and various other Jupyter notebooks are available from my GitHub repo.
This mater... |
sraejones/phys202-2015-work | assignments/assignment03/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
LSSTDESC/Twinkles | doc/SNSimDocumentation/Kraken_vistsSelection.ipynb | mit | full_survey = ds.cadence_plot(fieldID=1427, mjd_center=61404, mjd_range=[-1825, 1825],
observedOnly=False, colorbar=True);
plt.close()
full_survey[0]
half_survey = ds.cadence_plot(fieldID=1427, mjd_center=61404, mjd_range=[-1825, 1],
observedOnly=False, co... |
tpin3694/tpin3694.github.io | machine-learning/create_a_sparse_matrix.ipynb | mit | # Load libraries
import numpy as np
from scipy import sparse
"""
Explanation: Title: Create A Sparse Matrix
Slug: create_a_sparse_matrix
Summary: How to create a sparse matrix in Python.
Date: 2017-09-03 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
Preliminaries
End of exp... |
ctralie/TUMTopoTimeSeries2016 | Approximate Sparse Filtrations.ipynb | apache-2.0 | from ripser import ripser
from persim import plot_diagrams, wasserstein, wasserstein_matching
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics.pairwise import pairwise_distances
from scipy import sparse
import time
"""
Explanation: Approximate Sparse Filtrations
In this module, we will explore a... |
kratzert/RRMPG | examples/speed_comparision.ipynb | mit | # Notebook setups
import numpy as np
from numba import njit, float64
from timeit import timeit
"""
Explanation: Numba Speed-Test
In this notebook I'll test the speed of a simple hydrological model (the ABC-Model [1]) implemented in pure Python, Numba and Fortran. This should only been seen as an example of the power ... |
dato-code/tutorials | strata-nyc-2015/feature_engineering/Feature Engineering for Text Data.ipynb | apache-2.0 | reviews = gl.SFrame.read_csv('../data/yelp/yelp_training_set_review.json', header=False)
reviews
reviews[0]
"""
Explanation: SFrame -- Scalable Dataframe
Powerful unstructured data processing: read straight up json
End of explanation
"""
reviews=reviews.unpack('X1','')
reviews
"""
Explanation: Unpack to extract st... |
google-research/ott | docs/notebooks/introduction_grid.ipynb | apache-2.0 | import jax
import jax.numpy as jnp
import numpy as np
from ott.core import sinkhorn
from ott.geometry import costs
from ott.geometry import grid
from ott.geometry import pointcloud
"""
Explanation: Grid geometry
In this tutorial, we cover how to instantiate and use Grid.
Grid is a geometry that is useful when the pr... |
GuillaumeDec/machine-learning | deep-lstm-rnn-anomaly-detector/deep-lstm-time-series-ndim.ipynb | gpl-3.0 | from __future__ import print_function
import mxnet as mx
from mxnet import nd, autograd
import numpy as np
from collections import defaultdict
mx.random.seed(1)
# ctx = mx.gpu(0)
ctx = mx.cpu(0)
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from datetime... |
dafrie/lstm-load-forecasting | notebooks/3_weather_only.ipynb | mit | # Model category name used throughout the subsequent analysis
model_cat_id = "03"
# Which features from the dataset should be loaded:
# ['all', 'actual', 'entsoe', 'weather_t', 'weather_i', 'holiday', 'weekday', 'hour', 'month']
features = ['actual', 'weather']
# LSTM Layer configuration
# ========================
# ... |
jseabold/statsmodels | examples/notebooks/plots_boxplots.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
"""
Explanation: Box Plots
The following illustrates some options for the boxplot in statsmodels. These include violin_plot and bean_plot.
End of explanation
"""
data = sm.datasets.anes96.load_pandas()
party_ID = np.a... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lm/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lm', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LM
Topic: Aerosol
Sub-Topics: Transport, Emissions, Conce... |
rnwatanabe/projectPR | ExampleNotebooks/ImpedanceAnkle.ipynb | gpl-3.0 | import sys
sys.path.insert(0, '..')
import time
import matplotlib.pyplot as plt
%matplotlib notebook
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'png')
plt.rcParams['savefig.dpi'] = 75
plt.rcParams['figure.autolayout'] = False
plt.rcParams['figure.figsize'] = 10, 6
plt.rcParams['a... |
eds-uga/csci1360e-su16 | lectures/L6.ipynb | mit | x = [51, 65, 56, 19, 11, 49, 81, 59, 45, 73]
"""
Explanation: Lecture 6: Conditionals and Error Handling
CSCI 1360E: Foundations for Informatics and Analytics
Overview and Objectives
In this lecture, we'll go over how to make "decisions" over the course of your code depending on the values certain variables take. We'l... |
mne-tools/mne-tools.github.io | stable/_downloads/da444a4db06576d438b46fdb32d045cd/topo_compare_conditions.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD-3-Clause
import matplotlib.pyplot as plt
import mne
from mne.viz import plot_evoked_topo
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Co... |
xiaoli-chen/Godel | Youcheng/EntryClassForScraping_TopCharities.ipynb | apache-2.0 | from bs4 import BeautifulSoup
import urllib.request
import urllib.parse
import requests
# urllib.request
import re
import json
import json2html
import pandas as pd
!pip install json2html
#
url_list ="https://www.charitywatch.org/top-rated-charities"
url_c1 = "https://www.charitywatch.org/ratings-and-metrics/naacp-le... |
aktse/udacity-mlnd | projects/customer_segments/customer_segments.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from IPython.display import display # Allows the use of display() for DataFrames
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the wholesale custo... |
kkhenriquez/python-for-data-science | Week-8-NLP-Databases/Working with Databases.ipynb | mit | import os
data_iris_folder_content = os.listdir("data/iris")
error_message = "Error: sqlite file not available, check instructions above to download it"
assert "database.sqlite" in data_iris_folder_content, error_message
"""
Explanation: Access a Database with Python - Iris Dataset
The Iris dataset is a popular datas... |
jonathansick/androcmd | notebooks/Brick 23 IR.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format='retina'
# %config InlineBackend.figure_format='svg'
import os
import time
from glob import glob
import numpy as np
brick = 23
STARFISH = os.getenv("STARFISH")
isoc_dir = "b23ir_isoc"
lib_dir = "b23ir_lib"
synth_dir = "b23ir_synth"
fit_dir = "b23ir_fit"
wfc3_band... |
sfegan/calin | examples/simulation/mst psf calculation using vsoptics.ipynb | gpl-2.0 | %pylab inline
import calin.math.geometry
import calin.math.hex_array
import calin.simulation.vs_optics
import calin.simulation.ray_processor
"""
Explanation: Calculate point-spread function for MST
calin/examples/simulation/mst psf calculation using vsoptics.ipynb - Stephen Fegan - 2017-01-25
Copyright 2017, Stephen F... |
matousc89/Python-Adaptive-Signal-Processing-Handbook | notebooks/padasip_adaptive_filters_basics.ipynb | mit | from __future__ import print_function
import numpy as np
import matplotlib.pylab as plt
import padasip as pa
%matplotlib inline
plt.style.use('ggplot') # nicer plots
np.random.seed(52102) # always use the same random seed to make results comparable
%config InlineBackend.print_figure_kwargs = {}
"""
Explanation: Pad... |
michaelaye/iuvs | notebooks/dark_analysis.ipynb | isc | from iuvs import io
%autocall 1
files = !ls ~/data/iuvs/level1b/*.gz
files
l1b = io.L1BReader(files[1])
"""
Explanation: Loading data
End of explanation
"""
l1b.darks_interpolated.shape
"""
Explanation: The darks_interpolated data-cube consists of the interpolated darks that have been subtracted from the raw imag... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/NLP/LSTM RNN/imdb sentiment analysis + language modelling fastai .ipynb | apache-2.0 | PATH='data/aclImdb/'
TRN_PATH = 'train/all/'
VAL_PATH = 'test/all/'
TRN = f'{PATH}{TRN_PATH}'
VAL = f'{PATH}{VAL_PATH}'
%ls {PATH}
"""
Explanation: Language modeling
Data
The large movie view dataset contains a collection of 50,000 reviews from IMDB. The dataset contains an even number of positive and negative revie... |
salman-jpg/maya | preprocessor/Phase [1.a.2] Location Analysis.ipynb | mit | from database import Database
database = Database(
'<host name>',
'<database name>',
'<user name>',
'<password>',
'utf8mb4'
)
connection = database.connect_with_pymysql()
"""
Explanation: Location Analysis
We dont have IP linked with our Users. So we will link UserID with IP and then analyse the I... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-construct-ipcoal.ipynb | gpl-3.0 | # conda install ipyrad ipcoal -c conda-forge -c bioconda
import ipyrad.analysis as ipa
import toytree
import ipcoal
print('ipyrad', ipa.__version__)
print('toytree', toytree.__version__)
print('ipcoal', ipcoal.__version__)
"""
Explanation: <h1><span style="color:gray">ipyrad-analysis toolkit:</span> construct </h1>
... |
bmcinnes/VCU-VIP-Nanoinformatics | NERD/DecisionTreeRandomForestEnsemble/Random Forest Ensemble NER Model Results.ipynb | gpl-3.0 | import subprocess
""" Creates models for each fold and runs evaluation with results """
featureset = "o"
entity_name = "adversereaction"
for fold in range(1,1): #training has already been done
training_data = "../ARFF_Files/%s_ARFF/_%s/_train/%s_train-%i.arff" % (entity_name, featureset, entity_name, fold)
os... |
graphistry/pygraphistry | demos/demos_databases_apis/tigergraph/tigergraph_pygraphistry_bindings.ipynb | bsd-3-clause | import graphistry
# !pip install graphistry -q
# 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
g = graphistry.tigergraph(
protoco... |
happycube/kaggle2017 | instacart/sql-fe.ipynb | apache-2.0 | import pickle
import numpy as np
import odo
import pandas as pd
# Not included in Kaggle Docker image - with docker-compose it only actually installs the package once anyway.
import os
os.system('pip install psycopg2')
import psycopg2
# note: database must be created by psql command line
conn_string = "host='db... |
IsacLira/data-science-cookbook | 2017/06-linear-regression/resp_rlm_otacilio_bezerra.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
def RMSE(errors):
return np.sqrt(1/errors.shape[1] * np.sum(errors**2))
def predict(X, coef, addOnes=False):
if(addOnes): X = np.append(np.ones([X.shape[0], 1]), X, axis=1)
return np.dot(X... |
ankurankan/pgmpy | examples/Inference in Discrete Bayesian Networks.ipynb | mit | # Fetch the asia model from the bnlearn repository
from pgmpy.utils import get_example_model
asia_model = get_example_model("asia")
print("Nodes: ", asia_model.nodes())
print("Edges: ", asia_model.edges())
asia_model.get_cpds()
"""
Explanation: Inference in Discrete Bayesian Network
In this notebook, we show a simp... |
tsarouch/python_minutes | regression/logistic_regression_X_categorical_Y_categorical.ipynb | gpl-2.0 | # !!! Relevant reading
# http://blog.yhat.com/posts/logistic-regression-and-python.html
# http://stats.stackexchange.com/questions/224051/one-hot-vs-dummy-encoding-in-scikit-learn
# http://blog.yhat.com/posts/logistic-regression-python-rodeo.html
import pandas as pd
import numpy as np
"""
Explanation: Problem Des... |
GoogleCloudPlatform/tensorflow-gcp-tools | examples/ai_platform_optimizer_tuner.ipynb | apache-2.0 | ! pip install google-cloud
! pip install google-cloud-storage
! pip install requests
! pip install tensorflow_datasets
"""
Explanation: <table align="left">
<td>
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/ai-platform-samples/blob/master/notebooks/samples/optimizer/ai_platform_opt... |
gsorianob/fiuba-python | Clase 04 - Excepciones, funciones lambda, búsquedas.ipynb | apache-2.0 | lista_de_numeros = [1, 6, 3, 9, 5, 2]
lista_ordenada = sorted(lista_de_numeros)
print lista_ordenada
print lista_de_numeros
"""
Explanation: <!--
27/10
Ordenamientos y búsquedas.
Excepciones. Funciones anónimas.(Pablo o Andres)
-->
Ordenamiento de listas
Las listas se pueden ordenar fácilmente usando la función sorte... |
pysg/pyther | Modelo de impregnacion/modelo2/Activité 10_Viernes.ipynb | mit | import numpy as np
from scipy import integrate
from matplotlib.pylab import *
"""
Explanation: Evaluation des modèles pour l'extraction supercritique
L'extraction supercritique est de plus en plus utilisée afin de retirer des matières organiques de différents liquides ou matrices solides. Cela est dû au fait que les f... |
google/starthinker | colabs/url.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: URL
Pull URL list from a table, fetch them, and write the results to another table.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License... |
joonasfo/python | Assignment_02.ipynb | mit | def exercise2():
eps = 1.0
while eps + 1.0 > 1.0:
eps = eps/2.0
eps = 2.0 * eps
print("Final value for eps is {}".format(eps))
def exercise3(start):
x = start
while x != 0.0:
if x / 2 == 0.0:
break
x = x / 2
... |
tensorflow/docs-l10n | site/en-snapshot/guide/keras/transfer_learning.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... |
rubensfernando/mba-analytics-big-data | Python/lista-exercicios/Lista de Exercicios - Rubens Fernando Alencar.ipynb | mit | def soma_tres_num(x,y,z=10):
return x + y + z
"""
Explanation: Lista de Exercicios - Rubens Fernando Alencar
Os exercícios valem 30% da nota final.
Data Entrega: 18/08/2016
Formato da Entrega: .ipynb - Clique em File -> Download as -> IPython Notebook (.ipynb)
Enviar por email até a data de entrega, onde o a... |
4dsolutions/Python5 | Shapes with Vpython.ipynb | mit | from vpython import *
class Vector:
def __init__(self, x, y, z):
self.v = vector(x, y, z)
def __add__(self, other):
v_sum = self.v + other.v
return Vector(*v_sum.value)
def __neg__(self):
return Vector(*((-self.v).value))
def __sub__(self, other):... |
mne-tools/mne-tools.github.io | dev/_downloads/f1d68aba13226287585e777005a39f0a/15_handling_bad_channels.ipynb | bsd-3-clause | import os
from copy import deepcopy
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, verbose=False)
""... |
milancurcic/lunch-bytes | Spring_2019/LB29/xarray_DASKTUT.ipynb | cc0-1.0 | %matplotlib inline
from dask.distributed import Client
import xarray as xr
"""
Explanation: Xarray with Dask Arrays
<img src="images/dataset-diagram-logo.png"
align="right"
width="66%"
alt="Xarray Dataset">
Xarray is an open source project and Python package that extends the labeled data functionality... |
tensorflow/docs-l10n | site/ko/probability/examples/Probabilistic_Layers_VAE.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: SANDBOX-2
Topic: Landice
Sub-Topic... |
mykespb/jupyters | mp-nettemp3-fru-procwords.ipynb | mit | import datetime
now = datetime.datetime.now()
import time
import sqlite3
"""
Explanation: Mikhail Kolodin. Project: Internet temperature. 2015-12-15 1.4.1
IPython research for internet temperature. We use now only fontanka.ru website, later other sites and methods will be added.
Version with database recording. Now f... |
google/eng-edu | ml/cc/prework/zh-CN/hello_world.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... |
Wahlque/Wahlque-Complete | zh-cn/questions/10001-energy-drift-of-rk-method.ipynb | cc0-1.0 | import numpy as np
import wq.core.physics.unit.au as au
from math import sqrt
from wq.core.math.ode import rk4 as solver
from wq.core.physics.nbody.body3p import derivativeOf
deriv = derivativeOf(au, 5.0, 3.0, 4.0)
step = solver(deriv)
time = 0
phase = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 0.0, 0.0, 3.0, 0.0, 0.0,... |
hktxt/MachineLearning | ML/week1.ipynb | gpl-3.0 | # PACKAGE: DO NOT EDIT
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
from sklearn.datasets import fetch_lfw_people, fetch_mldata, fetch_olivetti_faces
import time
import timeit
%matplotlib inline
from ipywidgets import interact
"""
Explanat... |
luiscruz/udacity_data_analyst | P00/Project0_Data_Analyst_ND.ipynb | mit | import pandas as pd
# pandas is a software library for data manipulation and analysis
# We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd.
# hit shift + enter to run this cell or block of code
path = r'./chopstick-effectiveness.csv'
# Change the path to the location where the c... |
kubeflow/pytorch-operator | sdk/python/examples/kubeflow-pytorchjob-sdk.ipynb | apache-2.0 | from kubernetes.client import V1PodTemplateSpec
from kubernetes.client import V1ObjectMeta
from kubernetes.client import V1PodSpec
from kubernetes.client import V1Container
from kubernetes.client import V1ResourceRequirements
from kubeflow.pytorchjob import constants
from kubeflow.pytorchjob import utils
from kubeflow... |
OceanPARCELS/parcels | parcels/examples/documentation_homepage_animation.ipynb | mit | filename = 'medusarun.nc'
pfile = xr.open_dataset(str(filename), decode_cf=True)
lon = np.ma.filled(pfile.variables['lon'], np.nan)
lat = np.ma.filled(pfile.variables['lat'], np.nan)
time = np.ma.filled(pfile.variables['time'], np.nan)
pfile.close()
plottimes = np.arange(time[0,0], np.nanmax(time), np.timedelta64(10,... |
llscm0202/BIGDATA2017 | ATIVIDADE4/Lab4b_classificacao.ipynb | gpl-3.0 | # Data for manual OHE
# Note: the first data point does not include any value for the optional third feature
#from pyspark import SparkContext
#sc =SparkContext()
sampleOne = [(0, 'mouse'), (1, 'black')]
sampleTwo = [(0, 'cat'), (1, 'tabby'), (2, 'mouse')]
sampleThree = [(0, 'bear'), (1, 'black'), (2, 'salmon')]
sampl... |
mne-tools/mne-tools.github.io | dev/_downloads/9bd293f49554a21d68d4f2a842cc6cc2/59_head_positions.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# Richard Höchenberger <richard.hoechenberger@gmail.com>
# Daniel McCloy <dan@mccloy.info>
#
# License: BSD-3-Clause
from os import path as op
import mne
data_path = op.join(mne.datasets.testing.data_path(verbose=True), 'SSS')
fname_raw = op.join(data... |
pydicom/sendit | logs/GDLL/sendit-alpha-metrics.ipynb | mit | import pandas
from glob import glob
glob('*.tsv')
files = glob('*.tsv')
df = pandas.read_csv(files[0],sep="\t",index_col=0)
done = df[df.status=="DONE"]
print("Folders that are done: %s" %done.shape[0])
"""
Explanation: Sendit Google Deep Learning Lungren Metrics
This is the second round of sendit, and we want to loo... |
isb-cgc/examples-Python | notebooks/ISB_CGC_Query_of_the_Month_November_2018.ipynb | apache-2.0 | from google.colab import auth
auth.authenticate_user()
print('Authenticated')
"""
Explanation: <a href="https://colab.research.google.com/github/isb-cgc/examples-Python/blob/master/ISB_CGC_Query_of_the_Month_November_2018.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="... |
nickmckay/LiPD-utilities | Examples/MD02-2515.McClymont.2012.Spectral.ipynb | gpl-2.0 | # Import the LiPD package and locate your files
from lipd.start import *
# Load the LiPD file
loadLipds()
"""
Explanation: <img src="http://www.organicdatacuration.org/linkedearth/images/5/51/EarthLinked_Banner_blue_NoShadow.jpg">
A jupyter Notebook for spectral analysis of time-uncertain marine data
Table of Content... |
datahac/jup | test/Learning/MN - text mining test.ipynb | apache-2.0 | import nltk
"""
Explanation: NLTK Test
http://textminingonline.com/dive-into-nltk-part-i-getting-started-with-nltk
End of explanation
"""
from nltk.corpus import brown
brown.words()[0:10]
brown.tagged_words()[0:10]
len(brown.words())
dir(brown)
"""
Explanation: 1. Test Brown Corpus
End of explanation
"""
from ... |
xR86/ml-stuff | data-engineering/labs-concurrent-distributed-programming/Analysis.ipynb | mit | import os
import pandas as pd
import utils
import plotly.graph_objs as go
import plotly.figure_factory as ff
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
"""
Explanation: Analysis <a class="tocSkip">
For homework: profs.info.uaic.ro/~adria/teach/cou... |
harrisonpim/bookworm | 02 - Character Building.ipynb | mit | from bookworm import *
import pandas as pd
import networkx as nx
import spacy
import nltk
import string
"""
Explanation: < 01 - Intro to Bookworm | Home | 03 - Visualising and Analysing Networks >
Character Building
We want to be able to automate the entirity of the bookworm process, and manually inputting a list ... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/solutions/3c_bqml_dnn_babyweight.ipynb | apache-2.0 | %%bigquery
-- LIMIT 0 is a free query; this allows us to check that the table exists.
SELECT * FROM babyweight.babyweight_data_train
LIMIT 0
%%bigquery
-- LIMIT 0 is a free query; this allows us to check that the table exists.
SELECT * FROM babyweight.babyweight_data_eval
LIMIT 0
"""
Explanation: LAB 3c: BigQuery ML... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_decoding_csp_timefreq.ipynb | bsd-3-clause | # Authors: Laura Gwilliams <laura.gwilliams@nyu.edu>
# Jean-Remi King <jeanremi.king@gmail.com>
# Alex Barachant <alexandre.barachant@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from... |
ML4DS/ML4all | R3.Least_Squares/.ipynb_checkpoints/regresion_LS-checkpoint.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.io # To read matlab files
import pylab
# For the student tests (only for python 2)... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-esm2-hr5/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-esm2-hr5', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-ESM2-HR5
Topic: Ocean
Sub-Topics: Timestepping Framework, A... |
ClaudiaEsp/inet | Analysis/Distance-dependent model for inhibitory synaptic connections.ipynb | gpl-2.0 | %pylab inline
# loading python modules
from __future__ import division
import numpy as np
from matplotlib.pyplot import figure
from terminaltables import AsciiTable
# loading custom writen modules
from inet import DataLoader
from inet.plots import barplot
from simulations import IISigmoidModel # simulation is a lo... |
rayjustinhuang/DataAnalysisandMachineLearning | Predicting Survival on the Titanic.ipynb | mit | # Import necessary libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import GaussianNB
fro... |
tensorflow/docs-l10n | site/ja/tutorials/text/nmt_with_attention.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... |
yandexdataschool/manchester-cp-asymmetry-tutorial | ManchesterTutorial.ipynb | cc0-1.0 | %pylab inline
import numpy
import pandas
import root_numpy
folder = '/moosefs/notebook/datasets/Manchester_tutorial/'
"""
Explanation: Example of physical analysis with IPython
End of explanation
"""
def load_data(filenames, preselection=None):
# not setting treename, it's detected automatically
data = root... |
antoniomezzacapo/qiskit-tutorial | community/hello_world/quantum_emoticon.ipynb | apache-2.0 | from qiskit import ClassicalRegister, QuantumRegister
from qiskit import QuantumCircuit, execute
from qiskit.tools.visualization import plot_histogram
from qiskit import IBMQ, available_backends, get_backend
from qiskit.wrapper.jupyter import *
import matplotlib.pyplot as plt
%matplotlib inline
# set up registers and ... |
hypergravity/astrostatistics | python/slides2.ipynb | mit | import numpy as np
print(dir(np.random))
"""
Explanation: ## <p style="text-align: center; font-size: 4em;"> Python tutorial 2 </p>
1. random number generators: numpy.random
https://docs.scipy.org/doc/numpy/reference/routines.random.html
End of explanation
"""
%pylab inline
import matplotlib.pyplot as plt
from mat... |
SSQ/Coursera-UW-Machine-Learning-Classification | Programming Assignment 2/module-3-linear-classifier-learning-assignment-blank.ipynb | mit | import graphlab
"""
Explanation: Implementing logistic regression from scratch
The goal of this notebook is to implement your own logistic regression classifier. You will:
Extract features from Amazon product reviews.
Convert an SFrame into a NumPy array.
Implement the link function for logistic regression.
Write a f... |
codeunsolved/NGS-Dashboard | ipynb/BRCA_LargeDel_Analysis.ipynb | mit | py.iplot(fig_3d(norm_data(data, 'by_s'), 'BRCA161116_norm_sample'), filename='BRCA161116_norm_sample')
py.iplot(fig_3d(norm_data(data, 'double'), 'BRCA161116_norm_double'), filename='BRCA161116_norm_double')
norm_data(data, 'double')['NGS161111-6-2'].plot()
norm_data(data, 'double')['NGS161111-7-2'].plot()
"""
Expl... |
AllenDowney/ThinkBayes2 | notebooks/chap20.ipynb | mit | # If we're running on Colab, install libraries
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):
from urllib.request import urlretri... |
xnomagichash/hacklab-ml | Supervised and Unsupervised ML.ipynb | mit | import random
"""
Explanation: Machine Learning - Clustering and Classification
Machine learning is often divided into three broad categories, supervised, unsupervised and reinforcement learning. We'll be skipping reinforcement learning today, so we can focus on supervised and unsupervised algorithms.
Supervised Learn... |
robertoalotufo/ia898 | src/ramp.ipynb | mit | import numpy as np
def ramp(s, n, range=[0,255]):
aux = np.array(n)
s_orig = s
if len(aux.shape) == 0:
s = [1,s[0],s[1]]
n = [0,0,n]
range = [0,0,0,0,range[0],range[1]]
slices,rows, cols = s[0], s[1], s[2]
z,y,x = np.indices((slices,rows,cols))
gz = z*n[0]//slices * (r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.