repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
facaiy/book_notes | Mining_of_Massive_Datasets/MapReduce_and_the_New_Software_Stack/note.ipynb | cc0-1.0 | plt.imshow(plt.imread('./res/fig2_1.png'))
"""
Explanation: 2 MapReduce and the New Software Stack
"big-data" analysis:
manage immense amounts of data quickly.
data is extremely regular $\to$ exploit parallelism.
new software stack:
"distributed file system" $\to$ MapReduce
When designing MapReduce algorithms... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_decoding_csp_space.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <romain.trachel@inria.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
"""
... |
keras-team/keras-io | examples/vision/ipynb/mlp_image_classification.ipynb | apache-2.0 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow_addons as tfa
"""
Explanation: Image classification with modern MLP models
Author: Khalid Salama<br>
Date created: 2021/05/30<br>
Last modified: 2021/05/30<br>
Description: Implementing the MLP... |
kdungs/teaching-SMD2-2016 | solutions/3.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.stats import norm
plt.style.use('ggplot')
"""
Explanation: Übungsblatt 3: sWeights
Aufgabe 1
Aufgabe 2
End of explanation
"""
def generate_sx(size):
xs = -0.2 * np.log(np.random.uniform(size=2 ... |
physion/ovation-python | examples/download-demographics.ipynb | gpl-3.0 | import csv
import dateutil.parser
import ovation.session as session
import ovation.lab.workflows as workflows
from tqdm import tqdm_notebook as tqdm
"""
Explanation: Download Batch demographics
This notebook demonstrates using the Ovation API to download patient demographics and sample metadata for all samples in a w... |
JAmarel/Phys202 | Algorithms/AlgorithmsEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np
"""
Explanation: Algorithms Exercise 2
Imports
End of explanation
"""
def find_peaks(a):
"""Find the indices of the local maxima in a sequence."""
peaks = np.array([],np.dtype('int'))
search = np.array([entry... |
Leguark/pynoddy | docs/notebooks/8-Sensitivity-Analysis.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
%matplotlib inline
"""
Explanation: Sensitivity Analysis
Test here: (local) sensitivity analysis of kinematic parameters with respect to a defined objective function. Aim: test how sensitivity the resulting model is to unc... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/05_artandscience/b_hyperparam.ipynb | apache-2.0 | import os
PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID
BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME
REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1
# for bash
os.environ['PROJECT'] = PROJECT
os.environ['BUCKET'] = BUCKET
os.environ['REGION'] = REGION
o... |
LorenzoBi/courses | TSAADS/tutorial 4/.ipynb_checkpoints/Untitled-checkpoint.ipynb | mit | np.random.seed(19)
T = 1000
a = np.array([.2, -.1, .1])
mu0 = .5
c, mu = simARPoisson(T, a, mu0)
plt.plot(c,'.', label='Countings')
plt.plot(mu, label='Mean')
plt.legend()
plt.xlabel('time')
plt.ylabel('countings')
"""
Explanation: Task 1. AR Poisson process.
1.1
We simulate our poisson process with the given paramete... |
GoogleCloudPlatform/professional-services | examples/bigquery-table-access-pattern-analysis/pipeline.ipynb | apache-2.0 | import sys
!{sys.executable} -m pip install -r requirements.txt
!jupyter nbextension enable --py widgetsnbextension
!jupyter serverextension enable voila --sys-prefix
"""
Explanation: License
Copyright 2021 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c... |
irazhur/StatisticalMethods | examples/XrayImage/Inference.ipynb | gpl-2.0 | # import cluster_pgm
# cluster_pgm.inverse()
from IPython.display import Image
Image(filename="cluster_pgm_inverse.png")
"""
Explanation: Inferring Cluster Model Parameters from an X-ray Image
Forward modeling is always instructive: we got a good sense of the parameters of our cluster + background model simply by g... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session03/Day1/SoftwareRepositories.ipynb | mit | ! #complete
! #complete
"""
Explanation: Code Repositories
Version 0.1
The notebook contains problems oriented around building a basic Python code repository and making it public via Github. Of course there are other places to put code repositories, with complexity ranging from services comparable to github to simple... |
phoebe-project/phoebe2-docs | 2.3/examples/requiv_max_limit.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
import phoebe
b = phoebe.default_binary()
b.add_dataset('lc', compute_phases=phoebe.linspace(0,1,101))
"""
Explanation: jktebop: requiv_max_limit
Here we'll examine how well jktebop agrees with PHOEBE with increased distortion.
Setup
Let's first make sure we have the latest versi... |
BinRoot/TensorFlow-Book | ch06_hmm/Concept01_forward.ipynb | mit | import numpy as np
import tensorflow as tf
"""
Explanation: Ch 06: Concept 01
Hidden Markov model forward algorithm
Oof this code's a bit complicated if you don't already know how HMMs work. Please see the book chapter for step-by-step explanations. I'll try to improve the documentation, or feel free to send a pull re... |
aasensio/SolarnetGranada | notebooks/Profiles and classification.ipynb | mit | sn.set_style("dark")
f, ax = pl.subplots(figsize=(9,9))
ax.imshow(stI[:,:,0], aspect='auto', cmap=pl.cm.gray)
"""
Explanation: Index
Contrast and velocity fields
Classification
Contrast and velocity fields
<a id='contrast'></a>
End of explanation
"""
contrastFull = np.std(stI[:,:,0]) / np.mean(stI[:,:,0])
contrastQu... |
weleen/mxnet | example/notebooks/moved-from-mxnet/composite_symbol.ipynb | apache-2.0 | import mxnet as mx
"""
Explanation: Composite symbols into component
In this example we will show how to make an Inception network by forming single symbol into component.
Inception is currently best model. Compared to other models, it has much less parameters, and with best performance. However, it is much more compl... |
dualphase90/Learning-Neural-Networks | .ipynb_checkpoints/Training-Neural-Networks-Theano-checkpoint.ipynb | mit | import theano
import theano.tensor as T
import numpy as np
"""
Explanation: Training Neural Networks with Theano
Training neural networks involves quite a few tricky bits. We try to make everything clear and easy to understand, to get you training your neural networks as quickly as possible.
Theano allows us to write... |
spulido99/Programacion | Alex/Taller1_term.ipynb | mit | import platform
platform.python_version()
"""
Explanation: Taller 1: Básico de Python
Funciones
Listas
Diccionarios
Este taller es para resolver problemas básicos de python. Manejo de listas, diccionarios, etc.
El taller debe ser realizado en un Notebook de Jupyter en la carpeta de cada uno. Debe haber commits con e... |
jdhp-docs/python_notebooks | nb_sci_maths/maths_mandelbrot_set_fr.ipynb | mit | %matplotlib inline
import matplotlib
matplotlib.rcParams['figure.figsize'] = (10, 10)
"""
Explanation: L'ensemble de Mandelbrot
TODO
* dans la definition, ajouter le developpement sur une dizaine d'itérations de 2 ou 3 points comme exemple illustratif du calcul (ecrire z_i ou |z_i| ou les 2 ?)
* dans la definition, a... |
Gezort/YSDA_deeplearning17 | Seminar2/Homework2.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import random
from IPython import display
from sklearn import datasets, preprocessing
(X, y) = datasets.make_circles(n_samples=1024, shuffle=True, noise=0.2, factor=0.4)
ind = np.logical_or(y==1, X[:,1] > X[:,0] - 0.5)
X = X[ind,:]
X = preprocessing... |
obulpathi/datascience | scikit/Chapter 1/Introduction.ipynb | apache-2.0 | from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import train_test_split
X, y = make_classification(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
lr = LogisticRegression().fit(X_train, y_train... |
5agado/data-science-learning | statistics/Probability - Intro.ipynb | apache-2.0 | import numpy as np
import seaborn as sns
import pandas as pd
from matplotlib import pyplot as plt, animation
%matplotlib notebook
#%matplotlib inline
sns.set_context("paper")
# interactive imports
import plotly
import cufflinks as cf
cf.go_offline(connected=True)
plotly.offline.init_notebook_mode(connected=True)
cl... |
Naereen/notebooks | Solving_an_equation_and_the_Lambert_W_function.ipynb | mit | %load_ext watermark
%watermark -a "Lilian Besson (Naereen)" -i -v -p numpy,matplotlib,scipy,seaborn
import numpy as np
from scipy import optimize as opt
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = (15, 8)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(context="notebook", style="darkgrid",... |
pysal/spaghetti | notebooks/transportation-problem.ipynb | bsd-3-clause | %config InlineBackend.figure_format = "retina"
%load_ext watermark
%watermark
import geopandas
from libpysal import examples
import matplotlib
import mip
import numpy
import os
import spaghetti
import matplotlib_scalebar
from matplotlib_scalebar.scalebar import ScaleBar
%matplotlib inline
%watermark -w
%watermark -i... |
paulluo/work_note | stock_RT,Colaboratory.ipynb | unlicense | import tensorflow as tf
input1 = tf.ones((2, 3))
input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3))
output = input1 + input2
with tf.Session():
result = output.eval()
result
"""
Explanation: <a href="https://colab.research.google.com/github/paulluo/work_note/blob/master/stock_RT%EF%BC%8CColaboratory.i... |
mitchshack/data_analysis_with_python_and_pandas | 2- IPython Notebooks and Raw Python Data Analysis/2-4 Raw Python - Lambda Functions.ipynb | apache-2.0 | x = range(10)
x
[item**2 for item in x]
def square(num):
return num**2
list(map(square, x))
square_lamb = lambda num: num**2
list(map(square_lamb, x))
"""
Explanation: Raw Python - Lambda Functions
End of explanation
"""
list(map(lambda num: num**2, x))
"""
Explanation: Lambda functions are just anonymous... |
atulsingh0/MachineLearning | ML_UoW/Course01_Regression/Week04_Ridge_Regression_Assignment02.ipynb | gpl-3.0 | import graphlab as gl
"""
Explanation: Regression Week 4: Ridge Regression (gradient descent)
In this notebook, you will implement ridge regression via gradient descent. You will:
* Convert an SFrame into a Numpy array
* Write a Numpy function to compute the derivative of the regression weights with respect to a singl... |
deepcharles/ruptures | docs/getting-started/basic-usage.ipynb | bsd-2-clause | import matplotlib.pyplot as plt # for display purposes
import ruptures as rpt # our package
"""
Explanation: Basic usage
<!-- {{ add_binder_block(page) }} -->
Let us start with a simple example to illustrate the use of ruptures: generate a 3-dimensional piecewise constant signal with noise and estimate the change ... |
mne-tools/mne-tools.github.io | dev/_downloads/272b39eb7cbe2bfe1e8c768341ec7c56/time_frequency_simulated.ipynb | bsd-3-clause | # Authors: Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Chris Holdgraf <choldgraf@berkeley.edu>
#
# License: BSD-3-Clause
import numpy as np
from matplotlib import pyplot as plt
from mne import create_info, EpochsArray
from mne.baseline import rescale
from ... |
google/prog-edu-assistant | autograder/extract/submission.ipynb | apache-2.0 | print("hello")
print("bye bye")
print("hey", "you")
print("one")
print("two")
"""
Explanation: Hello world
In this unit you will learn how to use Python to implement the first ever program
that every programmer starts with.
Introduction
Here is the traditional first programming exercise, called "Hello world".
The t... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties:... |
tpin3694/tpin3694.github.io | python/if_and_if_else_statements.ipynb | mit | conflict_active = 1
"""
Explanation: Title: if and if else
Slug: if_and_if_else_statements
Summary: if and if else
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Create a variable with the status of the conflict.
1 if the conflict is active
0 if the conflict is not active
unknown if the s... |
google/applied-machine-learning-intensive | content/05_deep_learning/02_natural_language_processing/colab.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... |
tensorflow/docs | site/en/tutorials/distribute/dtensor_keras_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... |
4dsolutions/Python5 | Remembering1.ipynb | mit | from pprint import pprint
# I, Python am built from types, such as builtin types:
the_builtins = dir(__builtins__) # always here
pprint(the_builtins[-10:]) # no need to import
"""
Explanation: <div align="center"><h3>Remembering Python...</h3></div>
Python boots up with builtins already in the namespace and checke... |
kmunve/APS | aps/notebooks/freezing_level.ipynb | mit | %matplotlib inline
import sys
import os
aps_path = os.path.dirname(os.path.abspath("."))
if aps_path not in sys.path:
sys.path.append(aps_path)
print(aps_path, sys.path)
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set(style="dark")
import aps_io.get_arome as ga
from load_region im... |
cdawei/digbeta | dchen/music/nsr_baseline.ipynb | gpl-3.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
import os, sys, time, gzip
import pickle as pkl
import numpy as np
import pandas as pd
from scipy.sparse import lil_matrix, issparse, hstack, vstack
import matplotlib.pyplot as plt
import seaborn as sns
from models import MTC
from sklearn.linear_model import Logi... |
tensorflow/docs-l10n | site/ja/guide/intro_to_modules.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... |
quoniammm/happy-machine-learning | Udacity-ML/boston_housing-master_4/boston_housing.ipynb | mit | # Import libraries necessary for this project
# 载入此项目所需要的库
import numpy as np
import pandas as pd
import visuals as vs # Supplementary code
from sklearn.model_selection import ShuffleSplit
# Pretty display for notebooks
# 让结果在notebook中显示
%matplotlib inline
# Load the Boston housing dataset
# 载入波士顿房屋的数据集
data = pd.rea... |
kiteena/Fall16-Team15 | Assignment1/KristinaMilkovich-EarthquakeStats.ipynb | apache-2.0 | import requests, StringIO, pandas as pd, json, re
# function provided by example notebook "Analyze Precipitation Data" as a way to access your data with your credentials
def get_file_content(credentials):
"""For given credentials, this functions returns a StringIO object containing the file content."""
u... |
ramseylab/networkscompbio | class27_booleannetwork_python3_template.ipynb | apache-2.0 | import numpy
nodes = ['Cell Size',
'Cln3',
'MBF',
'Clb5,6',
'Mcm1/SFF',
'Swi5',
'Sic1',
'Clb1,2',
'Cdc20&Cdc14',
'Cdh1',
'Cln1,2',
'SBF']
N = len(nodes)
# define the transition matrix
a = numpy.zeros([N, N]... |
mari-linhares/tensorflow-workshop | code_samples/RNN/sinusoids/model.ipynb | apache-2.0 | #!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
bgroveben/python3_machine_learning_projects | learn_kaggle/pandas/creating_reading_writing_workbook.ipynb | mit | import pandas as pd
pd.set_option('max_rows', 5)
from learntools.advanced_pandas.creating_reading_writing import *
"""
Explanation: Creating, reading, and writing workbook
Introduction and relevant resources
This is the first notebook in the Learn Pandas track.
These exercises assume some prior experience with Pandas.... |
swara-salih/Portfolio | Web Scraping and Predicting Data Science Salaries/Web Scraping and Predicting Data Science Salaries.ipynb | mit | #Using a random forest regressor, with one other classifier.
url = "http://www.indeed.com/jobs?q=data+scientist+%2420%2C000&l=New+York&start=10"
import requests
import bs4
from bs4 import BeautifulSoup
import urllib
html = urllib.urlopen(url).read()
b = BeautifulSoup(html, 'html.parser', from_encoding="utf-8")
#h... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/explainable_ai/SDK_Custom_Container_XAI.ipynb | apache-2.0 | %%writefile requirements.txt
joblib~=1.0
numpy~=1.20
scikit-learn~=0.24
google-cloud-storage>=1.26.0,<2.0.0dev
# Required in Docker serving container
%pip install -U --user -r requirements.txt
# For local FastAPI development and running
%pip install -U --user "uvicorn[standard]>=0.12.0,<0.14.0" fastapi~=0.63
# Verte... |
rahulkgup/deep-learning-foundation | intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
swirlingsand/deep-learning-foundations | p3-tv-script-generation/dlnd_tv_script_generation.ipynb | mit | 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 scripts using RNNs. You'll be using part of the... |
xdze2/thermique_appart | BlackBoxModel02.ipynb | mit | df_full = pd.read_pickle( 'weatherdata.pck' )
df = df_full[['T_int', 'temperature', 'flux_tot', 'windSpeed']].copy()
"""
Explanation: Modèle boite noire 02
L'idée est d'estimer les paramètres du modèle à partir de la mesure expérimentale de la température intérieure ($T$) et des données météo. On n'obtient pas force... |
ebellm/ztf_summerschool_2015 | notebooks/Making_a_Lightcurve.ipynb | bsd-3-clause | reference_catalog = '../data/PTF_Refims_Files/PTF_d022683_f02_c06_u000114210_p12_sexcat.ctlg'
# select R-band data (f02)
"""
Explanation: Hands-On Exercise 2: Making a Lightcurve from PTF catalog data
Version 0.2
This "hands-on" session will proceed differently from those that are going to follow. Below, we have incl... |
prody/ProDy-website | _static/ipynb/workshop2021/prody_evol_and_signdy.ipynb | mit | from prody import *
from pylab import *
%matplotlib inline
confProDy(auto_show=False)
"""
Explanation: Evolution of sequence, structure and dynamics with Evol and SignDy
This tutorial has two parts, focusing on two related parts of ProDy for studying evolution:
The sequence sub-package Evol is for fetching, parsing... |
weikang9009/pysal | notebooks/explore/pointpats/distance_statistics.ipynb | bsd-3-clause | import scipy.spatial
import pysal.lib as ps
import numpy as np
from pysal.explore.pointpats import PointPattern, PoissonPointProcess, as_window, G, F, J, K, L, Genv, Fenv, Jenv, Kenv, Lenv
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Distance Based Statistical Method for Planar Point Patterns
Au... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160530월_9일차_추정 및 검정 Estimation and Test/6.MLE 모수 추정의 예.ipynb | mit | theta0 = 0.6
x = sp.stats.bernoulli(theta0).rvs(1000)
N0, N1 = np.bincount(x, minlength=2)
N = N0 + N1
theta = N1 / N
theta
"""
Explanation: MLE 모수 추정의 예
베르누이 분포의 모수 추정
이 과정을 스스로 쓸 줄 알아야 돼
각각의 시도 $x_i$에 대한 확률은 베르누이 분포
$$ P(x | \theta ) = \text{Bern}(x | \theta ) = \theta^x (1 - \theta)^{1-x}$$
샘플이 $N$개 있는 경우, Like... |
HazyResearch/snorkel | tutorials/workshop/Workshop_3_Generative_Model_Training.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import os
import re
import numpy as np
# Connect to the database backend and initalize a Snorkel session
from lib.init import *
from snorkel.models import candidate_subclass
from snorkel.annotations import load_gold_labels
from snorkel.lf_helpers import (
get_... |
idisblueflash/skills_map_searcher | skill map search.ipynb | mit | import numpy as np
import tensorflow as tf
from openpyxl import load_workbook
from collections import namedtuple
import time
"""
Explanation: Skills map searcher
Search related chapter base on text entered.
Data loading
End of explanation
"""
# Load data from xlsx file
wb = load_workbook('skill_map_data.xlsx')
## p... |
Kaggle/learntools | notebooks/feature_engineering_new/raw/tut4.ipynb | apache-2.0 | #$HIDE_INPUT$
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sklearn.cluster import KMeans
plt.style.use("seaborn-whitegrid")
plt.rc("figure", autolayout=True)
plt.rc(
"axes",
labelweight="bold",
labelsize="large",
titleweight="bold",
titlesize=14,
titlepad=10,
)... |
henry-ngo/VIP | docs/source/tutorials/06_fm_disk.ipynb | mit | %matplotlib inline
from hciplot import plot_frames, plot_cubes
from matplotlib.pyplot import *
from matplotlib import pyplot as plt
import numpy as np
from packaging import version
"""
Explanation: 6. Forward modeling of disks
Author: Julien Milli
Last update: 23/03/2022
Suitable for VIP v1.0.0 onwards.
Table of con... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course4-cnn/week1-cnn/Convolution+model+-+Step+by+Step+-+v2.ipynb | mit | import numpy as np
import h5py
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
%load_ext autoreload
%autoreload 2
np.random.seed(1)
"""
Explanation: Convolut... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
Propertie... |
plipp/informatica-pfr-2017 | nbs/2/3-OPTIONAL-More-Pandas-Exercises.ipynb | mit | import pandas as pd
import numpy as np
def top15_countries():
pass # TODO
Top15 = top15_countries()
Top15
"""
Explanation: [Optional] More Pandas Exercises
Original Source: Coursera Introduction to Data Science in Python: Assignment 3
Additional Requirements
bash
pip install xlrd
Exercise 1
Load the energy data ... |
yingchi/fastai-notes | deeplearning1/nbs/lesson5_yingchi.ipynb | apache-2.0 | from keras.datasets import imdb
idx = imdb.get_word_index()
type(idx)
# Let's look at the word list
"""
sorted(iterable, *, key=None, reverse=False):
built-in function; Return a new sorted list from the items in iterable.
"""
idx_list = sorted(idx, key=idx.get)
print(idx_list[:5])
from itertools import islice
de... |
jorisvandenbossche/DS-python-data-analysis | notebooks/pandas_09_combining_datasets.ipynb | bsd-3-clause | import pandas as pd
"""
Explanation: <p><font size="6"><b>Pandas: Combining datasets Part I - concat</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbossche@gmail.c&... |
marvinoeben/transactional-analysis | Loan_payment_feature_engineering.ipynb | mit | import pandas as pd
import numpy as np
"""
Explanation: Loan payment feature engineering.
In this notebook, we will engineer the futures to predict whether an account will be unable to pay its loan in the future. We will use the following charasteristics:
- Loan characteristics (size, count, payments etc.)
- Account c... |
massimo-nocentini/simulation-methods | notes/matrices-functions/matricial-characterization-of-Hermite-interpolating-polynomials.ipynb | mit | from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, t, alpha
from matrix_functions import *
from sequences import *
init_printing()
d = IndexedBase('d')
g = Function('g')
m_sym = symbols('m')
"""
Explanation: <p>
<img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jp... |
JonasHarnau/apc | apc/vignettes/vignette_misspecification.ipynb | gpl-3.0 | import apc
# Turn off future warnings
import warnings
warnings.simplefilter('ignore', FutureWarning)
"""
Explanation: Misspecification Tests for Log-Normal and Over-Dispersed Poisson Chain-Ladder Models
We replicate the empirical applications in Harnau (2018) in Section 5.
The work on this vignette was supported by t... |
ML4DS/ML4all | C_lab2_NNs/Hand_Digit_with_NN_student.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
size=18
params = {'legend.fontsize': 'Large',
'axes.labelsize': size,
'axes.titlesize': size,
'xtick.labelsize': size*0.75,
'ytick.labelsize': size*0.75}
plt.rcParams.update(params)
"""
Explanation: <h1>Tabl... |
codez266/codez266.github.io | markdown_generator/talks.ipynb | mit | import pandas as pd
import os
"""
Explanation: Talks markdown generator for academicpages
Takes a TSV of talks with metadata and converts them for use with academicpages.github.io. This is an interactive Jupyter notebook (see more info here). The core python code is also in talks.py. Run either from the markdown_gener... |
gjtorikian/Algorithms-Notebooks | Long-Tails.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
sns.set_context('talk')
sns.set_style('darkgrid')
inventory = 100.0
volume = 5000.0
rr = np.linspace(1,inventory,100)
ns = [0.25, 0.75, 1.25, 1.75]
fig, ax = plt.subplots(figsize=(10, 6))
for nn in ns:
norm = (nn-1)*vol... |
tensorflow/examples | courses/udacity_intro_to_tensorflow_for_deep_learning/l06c02_exercise_flowers_with_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... |
honjy/foundations-homework | 5/.ipynb_checkpoints/nyt-homework-hon-june6-checkpoint.ipynb | mit | #Mother's Day in 2009 was May 10, 2009
response = requests.get("http://api.nytimes.com/svc/books/v2/lists/2009-05-10/hardcover-fiction.json?api-key=2ca9e983dcfd4b1ba330521af1c9c2b2")
mom_09_data = response.json()
#print(mom_09_data)
#mom_09_data.keys()
#print(mom_09_data['results'])
for item in mom_09_data['results']:... |
PyDataMallorca/WS_Introduction_to_data_science | anscombes_quartet-in_depth.ipynb | gpl-3.0 | #!conda install -y numpy pandas matplotlib seaborn statsmodels ipywidgets
%matplotlib inline
import seaborn as sns
import pandas as pd
sns.set(style="ticks")
"""
Explanation: 1. Anscombe's quartet
In this introductory course to data science we will start by introducing the basics of the discipline. In this first par... |
ajhenrikson/phys202-2015-work | assignments/assignment03/NumpyEx01.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 1
Imports
End of explanation
"""
def checkerboard(size):
"""Return a 2d checkboard of 0.0 and 1.0 as a NumPy array"""
c=n... |
Quadrocube/rep | howto/Neurolab-rep.ipynb | apache-2.0 | import neurolab as nl
f2 = nl.trans.SoftMax()
f = nl.trans.LogSig()
from rep.estimators import NeurolabClassifier
clf = NeurolabClassifier(show=1, layers=[300], transf=[f, f], epochs=10, trainf=nl.train.train_rprop, features=variables)
%time _ = clf.fit(X_train, y_train)
predict_labels = clf.predict(X_test)
predict_p... |
bosscha/alma-calibrator | notebooks/selecting_source/select_source_non_almacal.ipynb | gpl-2.0 | import sys
sys.path.append('../src/')
from ALMAQueryCal import *
q = queryCal()
"""
Explanation: Selecting source and uid based on some criteria
End of explanation
"""
fileCal = "alma_sourcecat_searchresults.csv"
listCal = q.readCal(fileCal, fluxrange=[0.1, 9999999999])
print "Number of selected sources: ", len(l... |
feststelltaste/software-analytics | courses/20190918_Uni_Leipzig/Analyzing Java Dependencies with jdeps (Demo Notebook).ipynb | gpl-3.0 | from ozapfdis import jdeps
deps = jdeps.read_jdeps_file(
"../datasets/jdeps_dropover.txt",
filter_regex="at.dropover")
deps.head()
"""
Explanation: Questions
Which types / classes have unwanted dependencies in our code?
Which group of types / classes is highly cohesive but lowly coupled?
Idea
Using JDK's jd... |
kimkipyo/dss_git_kkp | Python 복습/15일차.목_serialize, SQL실습/15일차_2T_데이터 분석을 위한 SQL 실습 (1) - WHERE IN, LIKE, JOIN.ipynb | mit | import pymysql
db = pymysql.connect(
"db.fastcamp.us",
"root",
"dkstncks",
"sakila",
charset='utf8',
)
film_df = pd.read_sql("SELECT * FROM film;", db)
film_df.head(1)
SQL_QUERY = """
SELECT *
FROM film
WHERE
(release_year = 2006 OR release_year = 2007)
AND (rating = "... |
probml/pyprobml | notebooks/book1/20/word_analogies_torch.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
np.random.seed(seed=1)
import math
import requests
import zipfile
import hashlib
import os
import random
try:
import torch
except ModuleNotFoundError:
%pip install -qq torch
import torch
from torch import nn
from torch.nn import functional as F
!mkdir ... |
Neuroglycerin/neukrill-net-work | notebooks/troubleshooting_and_sysadmin/Iterators with Multiprocessing.ipynb | mit | import multiprocessing
import numpy as np
p = multiprocessing.Pool(4)
x = range(3)
f = lambda x: x*2
def f(x):
return x**2
print(x)
"""
Explanation: We're wasting a bunch of time waiting for our iterators to produce minibatches when we're running epochs. Seems like we should probably precompute them while the... |
letsgoexploring/sargentPhillipsCurve | sargentPhillipsCurve.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from fredpy import series,window_equalize
%matplotlib inline
"""
Explanation: Python program for replicating Figure 1.5 from The Conquest of American Inflation by Thomas Sargent.
In Figure 1.5, Sargent compares the business cycle componenets of monthly inflation and u... |
ccwang002/2015Talk-Python35News | code/PEP-465.ipynb | mit | import numpy as np
"""
Explanation: PEP 465 - @ operator
A dedicated infix operator for matrix multiplication
$$
\begin{bmatrix}
1 & 2 \
3 & 4
\end{bmatrix} \times
\begin{bmatrix}
11 & 12 \
13 & 14
\end{bmatrix} = \text{?}
$$
In Numpy (or many numerical computation cases), there are two ways to handle multiplication:
... |
simpeg/simpegpf | simpegPF/notebooks/tutorials/Tutorial_1_Mag forward modeling.ipynb | mit | cs = 12.5
ncx, ncy, ncz, npad = 41, 41, 40, 5
hx = [(cs,npad,-1.4), (cs,ncx), (cs,npad,1.4)]
hy = [(cs,npad,-1.4), (cs,ncy), (cs,npad,1.4)]
hz = [(cs,npad,-1.4), (cs,ncz), (cs,npad,1.4)]
mesh = Mesh.TensorMesh([hx, hy, hz], 'CCC')
fig, ax = plt.subplots(1,2, figsize=(12, 5))
dat0 = mesh.plotSlice(np.zeros(mesh.nC), gri... |
mne-tools/mne-tools.github.io | 0.24/_downloads/13f9133d0e7c13dded3c5dd2cf828dd3/gamma_map_inverse.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne.datasets import sample
from mne.inverse_sparse import gamma_map, make_stc_from_dipoles
from mne.viz import (plot_sparse_source_estimates,... |
tyler-abbot/PyShop | session1/PyShop_session1_notes.ipynb | agpl-3.0 | print('Hello World!')
"""
Explanation: PyShop Session 1
This session introduces Python as an open source, high level programming language, as well as a community. By the end of the session, you should be familiar with the following necessary (or at least useful) components for being a participating member of the Pyt... |
uber/pyro | tutorial/source/modules.ipynb | apache-2.0 | import os
import torch
import torch.nn as nn
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from torch.distributions import constraints
from pyro.nn import PyroModule, PyroParam, PyroSample
from pyro.nn.module import to_pyro_module_
from pyro.infer import SVI, Trace_ELBO
from pyro.infer.au... |
GoogleCloudPlatform/ml-design-patterns | 04_hacking_training_loop/distribution_strategies.ipynb | apache-2.0 | import datetime
import os
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow import feature_column as fc
# Determine CSV, label, and key columns
# Create list of string column headers, make sure order matches.
CSV_COLUMNS = ["weigh... |
tensorflow/lucid | notebooks/activation-atlas/activation-atlas-simple.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... |
metpy/MetPy | v1.0/_downloads/0c4dbfdebeb6fcd2f5364a69f0c6d4a8/Skew-T_Layout.ipynb | bsd-3-clause | import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, Hodograph, SkewT
from metpy.units import units
"""
Explanation: Skew-T with Complex Layout
Combine a Skew-T and a hodogra... |
transcranial/keras-js | notebooks/layers/convolutional/Conv2DTranspose.ipynb | mit | data_in_shape = (4, 4, 2)
conv = Conv2DTranspose(4, (3,3), strides=(1,1),
padding='valid', data_format='channels_last',
activation='linear', use_bias=False)
layer_0 = Input(shape=data_in_shape)
layer_1 = conv(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set ... |
tylere/docker-tmpnb-ee | notebooks/1 - IPython Notebook Examples/IPython Project Examples/IPython Kernel/Custom Display Logic.ipynb | apache-2.0 | from IPython.display import (
display, display_html, display_png, display_svg
)
"""
Explanation: Custom Display Logic
Overview
As described in the Rich Output tutorial, the IPython display system can display rich representations of objects in the following formats:
JavaScript
HTML
PNG
JPEG
SVG
LaTeX
PDF
This Not... |
Hyperparticle/deep-learning-foundation | lessons/dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
phobson/statsmodels | examples/notebooks/statespace_local_linear_trend.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
"""
Explanation: State space modeling: Local Linear Trends
This notebook describes how to extend the Statsmodels statespace classes to create and estimate a custom model.... |
Kaggle/learntools | notebooks/ml_explainability/raw/tut3_partial_plots.ipynb | apache-2.0 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
data = pd.read_csv('../input/fifa-2018-match-statistics/FIFA 2018 Statistics.csv')
y = (data['Man of the Match'] == "Yes") # C... |
probml/pyprobml | notebooks/book2/27/gplvm_mocap.ipynb | mit | import matplotlib.pyplot as plt
plt.style.use("seaborn-pastel")
%%capture
%pip install -qq --upgrade git+https://github.com/lawrennd/ods
%pip install -qq --upgrade git+https://github.com/SheffieldML/GPy.git
try:
import GPy, pods
except ModuleNotFoundError:
%pip install -qq GPy,
import GPy, pods
import n... |
ML4DS/ML4all | R_lab1_ML_Bay_Regresion/Pract_regression_professor.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 matplotlib.cm as cm
import numpy as np
import scipy.io # To read matlab files
from scipy import spatial
imp... |
tensorflow/docs-l10n | site/zh-cn/tutorials/load_data/pandas_dataframe.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... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/homework/HW2/Homework_2_SOLUTIONS.ipynb | agpl-3.0 | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
'''
count_times = the time since the start of data-taking when the data was
taken (in seconds)
count_rates = the number of counts since the last time data was taken, at
the time in count_times
'''
count_times = np.lo... |
Britefury/deep-learning-tutorial-pydata2016 | SUPPLEMENTARY - Convolutions with sliding windows.ipynb | mit | %matplotlib inline
"""
Explanation: Convolutions and sliding windows
Plots inline:
End of explanation
"""
import os
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import convolve
from skimage.filters import gabor_kernel
from skimage.color import rgb2grey
from skimage.util.montage impo... |
deeplook/alerta_tutorial | tutorial.ipynb | gpl-3.0 | from IPython.display import HTML
HTML('<iframe src="http://alerta.io" width="100%" height="500"></iframe>')
"""
Explanation: Alerta Tutorial
A tutorial from scratch to writing your own alerts using alerta.io.
End of explanation
"""
from IPython.display import HTML
HTML('<iframe src="http://localhost:8090" width="100... |
riceda195/kernel_gateway_demos | swagger-notebook-service/swagger-petstore-service/SwaggerPetstoreApi.ipynb | bsd-3-clause | !pip install dicttoxml
import json
from dicttoxml import dicttoxml
PETS = {}
PET_STATUS_INDEX = {}
TAG_INDEX = {}
ORDERS = {}
ORDER_STATUS_INDEX = {}
JSON = 'application/json'
XML = 'application/xml'
content_type = JSON
class MissingField(Exception):
def __init__(self, type_name, field):
self.msg = '{} ... |
scoyote/RHealthDataImport | ImportAppleHealthXML.ipynb | mit | import xml.etree.ElementTree as et
import pandas as pd
import numpy as np
from datetime import *
import matplotlib.pyplot as plt
import re
import os.path
import zipfile
import pytz
%matplotlib inline
plt.rcParams['figure.figsize'] = 16, 8
"""
Explanation: Download, Parse and Interrogate Apple Health Export Data
Th... |
gibiansky/blog | posts/coding-intro-to-nns/post.ipynb | gpl-2.0 | import numpy as np
"""
Explanation: In this tutorial, we'll use Python with the Numpy and Theano to get a feel for writing machine learning algorithms. We'll start with a brief intro those libraries, and then implement a logistic regression and a neural network, looking at some properties of the implementations as we ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.