repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ocelot-collab/ocelot | demos/ipython_tutorials/6_coupler_kick.ipynb | gpl-3.0 | # the output of plotting commands is displayed inline within frontends,
# directly below the code cell that produced it
%matplotlib inline
from time import time
# this python library provides generic shallow (copy)
# and deep copy (deepcopy) operations
from copy import deepcopy
# import from Ocelot main modules... |
feststelltaste/software-analytics | notebooks/Read in semi-structured data with pandas.ipynb | gpl-3.0 | !cp ../../joa_spring-petclinic/git_log_numstat.log datasets/git_log_raw_stats_spring_petclinic.log
import pandas as pd
log = pd.read_csv(
"datasets/git_log_raw_stats_spring_petclinic.log",
sep="\n",
names=['raw'])
log.head()
"""
Explanation: Read in semi-structured data with pandas
When analyzing softwar... |
r-shekhar/NYC-transport | 06_repartition/repartition_all_spark.ipynb | bsd-3-clause | # standard imports
funcs = pyspark.sql.functions
types = pyspark.sql.types
sqlContext.sql("set spark.sql.shuffle.partitions=32")
bike = spark.read.parquet('/data/citibike.parquet')
bike.registerTempTable('bike')
spark.sql('select * from bike limit 5').toPandas()
bike = (bike
.withColumn('start_time',
... |
tensorflow/docs-l10n | site/zh-cn/hub/tutorials/cross_lingual_similarity_with_tf_hub_multilingual_universal_encoder.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. 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 required by app... |
2015fallhw/user9999 | content/notebook/.ipynb_checkpoints/Solving the TSP with GAs-checkpoint.ipynb | agpl-3.0 | import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
import random, operator
import time
import itertools
import numpy
import math
%matplotlib inline
random.seed(time.time()) # planting a random seed
"""
Explanation: <img src='http://www.puc-rio.br/sobrepuc/admin/vrd/brasa... |
reachtarunhere/aima-python | csp.ipynb | mit | from csp import *
"""
Explanation: Constraint Satisfaction Problems (CSPs)
This IPy notebook acts as supporting material for topics covered in Chapter 6 Constraint Satisfaction Problems of the book Artificial Intelligence: A Modern Approach. We make use of the implementations in csp.py module. Even though this noteboo... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection... |
JasonNK/udacity-dlnd | intro-to-rnns/Anna_KaRNNa.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... |
eford/rebound | ipython_examples/SaturnsRings.ipynb | gpl-3.0 | import rebound
import numpy as np
sim = rebound.Simulation()
"""
Explanation: Simulating Saturn's rings
In this example, we will simulate a small patch of Saturn's rings. The simulation is similar to the C example in examples/shearing_sheet.
We first import REBOUND and numpy, then create an instance of the Simulation ... |
jdamiani27/DataSciUF-Tutorial-Student | DataSciUF - Python II.ipynb | mit | # Function to sum up numbers in a dictionary
"""
Explanation: iPython Magics
iPython does a lot of neat things. The % and %% symbols are used to indicate a line that is not a Python statement but a command for iPython to interpret. These commands are called magics and can change the behavior of iPython, interact with... |
rafburzy/Statistics | 06_KNN.ipynb | mit | # importing all required modules
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import numpy as np
"""
Explanation: K Nearest Neighbors method used on Iris dataset
End of explanation
"""
# importing datasets
from sklearn import datasets
iris = datasets.load_iris()
"""
E... |
mari-linhares/tensorflow-workshop | code_samples/estimators-for-free/.ipynb_checkpoints/estimators_for_free-checkpoint.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# our model
import model as m
# tensorflow
import tensorflow as tf
print(tf.__version__) #tested with tf v1.2
from tensorflow.contrib import learn
from tensorflow.contrib.learn.python.learn import learn_run... |
thiank/Projects-with-Ning | T-Test vs Permutation Test, Sunday (Aug 27) .ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy import stats
from sklearn.model_selection import permutation_test_score, StratifiedKFold
from sklearn.linear_model import LogisticRegression
from random import shuffle
"""
Explanation: Today's topic: T-tests vs. Permutation Tests
<br />... |
a-slide/iPython-Notebook | Notebooks/2015_04_16_AL_Analyse_cross_conta_data_Pierre.ipynb | gpl-2.0 | with open('./jeter.tsv', 'r') as file:
for i in range (10):
print (next(file))
"""
Explanation: Calculate the percentage of incorrectly attributed reads in the following file for sample 1 and sample2
reads_sample1_supporting_sample2 vs all reads of sample1
reads_sample2_supporting_sample1 vs all reads of ... |
AllenDowney/ThinkStats2 | examples/auroc.ipynb | gpl-3.0 | # 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 numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_sty... |
joelagnel/lisa | ipynb/examples/energy_meter/EnergyMeter_AEP.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
"""
Explanation: Energy Meter Examples
ARM Energy Probe
NOTE: caiman is required to collect data from the probe. Instructions on how to install it can be found here https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#arm-energy-probe-aep.... |
idekerlab/sdcsb-advanced-tutorial | tutorials/Lesson_1_Introduction_to_cyREST.ipynb | mit | # HTTP Client for Python
import requests
# Standard JSON library
import json
# Basic Setup
PORT_NUMBER = 1234 # This is the default port number of CyREST
"""
Explanation: SDCSB Tutorial
Advanced Cytoscape: Cytoscape, IPython, Docker, and reproducible network data visualization workflows
Friday, 4/17/2015 at Sanford
... |
dkirkby/astroml-study | Chapter4/Chapter 4.5 - 4.9.ipynb | mit | %pylab inline
import scipy.stats
"""
Explanation: 4.5 Confidence Estimates: the Bootstrap and the Jackknife
End of explanation
"""
# Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published in the textbook
# "Statistics, Data Mining, and Machine Learning in Astronomy" (2013)
# For... |
samirma/deep-learning | gradient-descent/GradientDescent.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
#Some helper functions for plotting and drawing lines
def plot_points(X, y):
admitted = X[np.argwhere(y==1)]
rejected = X[np.argwhere(y==0)]
plt.scatter([s[0][0] for s in rejected], [s[0][1] for s in rejected], s = 25, color = 'blue', ... |
mne-tools/mne-tools.github.io | 0.24/_downloads/cf9b035ec9fdf9fb55b24e8c3a75ad55/psf_ctf_vertices.ipynb | bsd-3-clause | # Authors: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import mne
from mne.datasets import sample
from mne.minimum_norm import (make_inverse_resolution_matrix, get_cross_talk,
get_point_spread)
print(__doc_... |
akseshina/dl_course | seminar_3/classwork_1.ipynb | gpl-3.0 | print(tf.nn.softmax_cross_entropy_with_logits.__doc__)
"""
Explanation: Activation functions
Why do we need tf.nn.softmax_cross_entropy_with_logits ?
End of explanation
"""
import tensorflow as tf
from keras.layers.advanced_activations import LeakyReLU, PReLU
def LeakyRelu(x, alpha):
return tf.maximum(alpha*x, ... |
spacedrabbit/PythonBootcamp | Statements Assessment Test.ipynb | mit | st = 'Print only the words that start with s in this sentence'
#Code here
# to note: a for in for a string iterates through letters, not numbers
for word in st.split():
letter = word[0].lower()
if letter == 's':
print word
"""
Explanation: Statements Assessment Test
Lets test your knowledge!
Use fo... |
deehzee/cs231n | assignment2/BatchNormalization.ipynb | mit | # As usual, a bit of setup
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import \
... |
rashikaranpuria/Machine-Learning-Specialization | Regression/Assignmet_five/week-5-lasso-assignment-1-blank.ipynb | mit | import graphlab
"""
Explanation: Regression Week 5: Feature Selection and LASSO (Interpretation)
In this notebook, you will use LASSO to select features, building on a pre-implemented solver for LASSO (using GraphLab Create, though you can use other solvers). You will:
* Run LASSO with different L1 penalties.
* Choose... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Machine Learning Sections/Principal-Component-Analysis/Principal Component Analysis.ipynb | mit | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Principal Component Analysis
Let's discuss PCA! Since this isn't exactly a full machine learning algorithm, ... |
mattilyra/gensim | docs/notebooks/Corpora_and_Vector_Spaces.ipynb | lgpl-2.1 | import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
import os
import tempfile
TEMP_FOLDER = tempfile.gettempdir()
print('Folder "{}" will be used to save temporary dictionary and corpus.'.format(TEMP_FOLDER))
"""
Explanation: Tutorial 1: Corpora and Vector Spaces... |
RaoUmer/lightning-example-notebooks | plots/map.ipynb | mit | from lightning import Lightning
from numpy import random
"""
Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> Map plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a>
<hr> Setup
End of explanati... |
benbovy/cosmogenic_dating | GS_Wintrich_4params.ipynb | mit | import math
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import seaborn as sns
import yaml
%matplotlib inline
"""
Explanation: Grid Search - Wintrich - 4 free parameters
Wintrich site, MLE with 4 free parameters (grid search method).
For more info about th... |
tensorflow/docs-l10n | site/zh-cn/tutorials/keras/text_classification.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... |
phanrahan/magmathon | notebooks/tutorial/icestick/Add.ipynb | mit | import magma as m
m.set_mantle_target("ice40")
"""
Explanation: Add
In this tutorial, we will construct a n-bit adder from n full adders.
Magma has built in support for addition using the + operator,
so please don't think Magma is so low-level that you need to create
logical and arithmetic functions in order to use i... |
Smith42/neuralnet-mcg | CNNs/ECG-CNN-2D-VCG.ipynb | gpl-3.0 | import tensorflow as tf
#import tensorflow.contrib.learn.python.learn as learn
import tflearn
import scipy as sp
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from random import shuffle, randint
from sklearn.utils import shuffle as mutualShuf
import os
import pandas as pd
... |
amirziai/learning | deep-learning/Convolutional-model-application.ipynb | mit | import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
import tensorflow as tf
from tensorflow.python.framework import ops
from cnn_utils import *
%matplotlib inline
np.random.seed(1)
"""
Explanation: Convolutional Neural Networks: Appli... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_info.ipynb | bsd-3-clause | from __future__ import print_function
import mne
import os.path as op
"""
Explanation: .. _tut_info_objects:
The :class:Info <mne.Info> data structure
End of explanation
"""
# Read the info object from an example recording
info = mne.io.read_info(
op.join(mne.datasets.sample.data_path(), 'MEG', 'sample',
... |
robertoalotufo/ia898 | master/DemoPhaseCorrelation.ipynb | mit | import numpy as np
import sys,os
ia898path = os.path.abspath('../../')
if ia898path not in sys.path:
sys.path.append(ia898path)
import ia898.src as ia
%matplotlib inline
import matplotlib.image as mpimg
#f = ia.normalize(ia.gaussian((151,151), [[75],[75]], [[800,0],[0,800]]), [0,200]).astype(uint8)
f = mpimg.imr... |
openstreams/wflow | notebooks/wflow-reservoir.ipynb | gpl-3.0 | # First import the model. Here we use the HBV version
from wflow.wflow_sbm import *
import IPython
from IPython.display import display, clear_output
%pylab inline
#clear_output = IPython.core.display.clear_output
# Here we define a simple fictious reservoir
reservoirstorage = 15000
def simplereservoir(inputq,storage)... |
jjonte/udacity-deeplearning-nd | py3/project-1/dlnd-your-first-neural-network.ipynb | unlicense | %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... |
eaton-lab/toytree | sandbox/SVG-animation-ideas.ipynb | bsd-3-clause | import numpy as np
import toyplot
#import toytree
import toyplot.svg
from IPython.display import SVG
"""
Explanation: Curved edges
It doesn't appear that toyplot has the functionality to do radial curvature of edges. I need to dive into the actual SVG code that it writes to check...
https://developer.mozilla.org/en-US... |
kit-cel/wt | ccgbc/ch4_LDPC_Analysis/LDPC_Optimization_BEC.ipynb | gpl-2.0 | import cvxpy as cp
import numpy as np
import matplotlib.pyplot as plot
from ipywidgets import interactive
import ipywidgets as widgets
import math
%matplotlib inline
"""
Explanation: Optimization of Degree Distributions on the BEC
This code is provided as supplementary material of the lecture Channel Coding 2 - Adv... |
patrick-kidger/diffrax | examples/symbolic_regression.ipynb | apache-2.0 | import tempfile
from typing import List
import equinox as eqx # https://github.com/patrick-kidger/equinox
import jax
import jax.numpy as jnp
import optax # https://github.com/deepmind/optax
import pysr # https://github.com/MilesCranmer/PySR
import sympy
# Note that PySR, which we use for symbolic regression, uses... |
harmsm/pythonic-science | chapters/01_simulation/01_scipy-stats_key.ipynb | unlicense | x = np.arange(-10,10,0.2)
y = np.cos(x)
noisy_y = y + np.random.normal(0,0.3,len(y))
plt.plot(x,y)
plt.plot(x,noisy_y)
"""
Explanation: <cont style="margin:auto">
<img src="https://s-media-cache-ak0.pinimg.com/originals/33/07/24/330724abbfde900c94af94ed0fbc5f9f.jpg" height="85%" width="85%" />
</font>
<ul>
<li><... |
scikit-rf/examples | metrology/Measuring a Mutiport Device with a 2-Port Network Analyzer.ipynb | bsd-3-clause | import skrf as rf
from itertools import combinations
"""
Explanation: Measuring a Mutiport Device with a 2-Port Network Analyzer
Introduction
This notebook demonstrates a numerical test of the technique described in
"A Rigorous Technique for Measuring the Scattering Matrix of a Multiport Device with a 2-Port Network... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/.ipynb_checkpoints/n1_preparation-checkpoint.ipynb | mit | import yahoo_finance
import requests
import datetime
def print_unix_timestamp_date(timestamp):
print(
datetime.datetime.fromtimestamp(
int(timestamp)
).strftime('%Y-%m-%d %H:%M:%S')
)
print_unix_timestamp_date("1420077600")
print_unix_timestamp_date("1496113200")
EXAMPLE_QUERY = ... |
the-deep-learners/TensorFlow-LiveLessons | notebooks/first_tensorflow_graphs.ipynb | mit | import numpy as np
import tensorflow as tf
"""
Explanation: First TensorFlow Graphs
In this notebook, we execute elementary TensorFlow computational graphs.
Load dependencies
End of explanation
"""
x1 = tf.placeholder(tf.float32)
x2 = tf.placeholder(tf.float32)
sum_op = tf.add(x1, x2)
product_op = tf.multiply(x1, x... |
khaziev/sheath-models | docs/stangeby-sheath.ipynb | mit | plasma_params = {'T_e': 1., 'T_i': 1., 'm_i': 2e-3/const.N_A, 'gamma': 1, 'c': 1., 'alpha': np.pi/180*2}
def calc_stangeby_params(plasma_params):
'''
Calculate parameters of the plasma sheath for stangeby's model
----------------------------------------------
plasma_params - dictionary like
''... |
liuhanfei0615/liupengyuan.github.io | chapter2/homework/computer/5-10/201611680275.ipynb | mit | fh=open(r'd:\temp\秘密花园.txt')
text = fh.read()
words = text.split(' ')
fh.close()
"""
Explanation: 文件开始为:
the whispers in the morning of lovers sleeping tight are rolling by like thunder now as i look in your eyes i hold on to your body and feel each move you make your voice is warm and tender a love that i could not f... |
hvillanua/deep-learning | batch-norm/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Practice
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Winter2017_Homework1.ipynb | mit | # Question 1.1
# Question 1.2
"""
Explanation: Homework 1 (DUE: Tuesday January 24)
Instructions: Complete the instructions in this notebook. You may work together with other students in the class and you may take full advantage of any internet resources available. You must provide thorough comments in your code ... |
tuwien-musicir/rp_extract | RP_extract_Tutorial.v3.ipynb | gpl-3.0 | # to install iPython notebook on your computer, use this in Terminal
sudo pip install "ipython[notebook]"
"""
Explanation: <center><h1>Rhythm and Timbre Analysis from Music</h1></center>
<center><h2>Rhythm Pattern Music Features</h2></center>
<center><h2>Extraction and Application Tutorial</h2></center>
<br>
<center><... |
eds-uga/csci1360e-su17 | lectures/L17.ipynb | mit | book = None
try: # Good coding practices!
f = open("Lecture17/alice.txt", "r")
book = f.read()
except FileNotFoundError:
print("Could not find alice.txt.")
else:
f.close()
print(book[:71]) # Print the first 71 characters.
"""
Explanation: Lecture 17: Natural Language Processing I
CSCI 1360E: Foun... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/td2a_cenonce_session_5.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.i - Modèle relationnel, analyse d'incidents dans le transport aérien
Base de données relationnelles, logique SQL.
End of explanation
"""
import pyensae.datasource
pyensae.datasource.download_data("tp_2a_5_compagnies.zip")
import os
... |
balarsen/pymc_learning | Foil Open Area/Open Area.ipynb | bsd-3-clause | import itertools
from pprint import pprint
from operator import getitem
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import numpy as np
import spacepy.plot as spp
import pymc as mc
import tqdm
from MCA_file_viewer_v001 import GetMCAfile
def plot_box(x, y, c='r', lw=0.6, ax=None):
if ax i... |
intel-analytics/BigDL | python/chronos/use-case/network_traffic/network_traffic_autots_forecasting.ipynb | apache-2.0 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
raw_df = pd.read_csv("data/data.csv")
"""
Explanation: Network Traffic Forecasting with AutoTSEstimator
In telco, accurate forecast of KPIs (e.g. network traffic, utilizations, user experience, etc.) for communication... |
INGEOTEC/CursoCategorizacionTexto | 06_conclusiones.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import gzip
import json
import numpy as np
def read_data(fname):
with gzip.open(fname) as fpt:
d = json.loads(str(fpt.read(), encoding='utf-8'))
return d
%matplotlib inline
plt.figure(figsize=(20, 10))
mx_pos = read_data('spanish/polarity_by_countr... |
exowanderer/SpitzerDeepLearningNetwork | Notebooks/tensorflow_DNNRegressor_Spitzer - RandomForests - relu.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline
from matplotlib import pyplot as plt
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler, Mi... |
maartenbreddels/vaex | docs/source/example_io.ipynb | mit | import vaex
# Reading a HDF5 file
df_names = vaex.open('./data/io/sample_names_1.hdf5')
df_names
# Reading an arrow file
df_fruits = vaex.open('./data/io/sample_fruits.arrow')
df_fruits
"""
Explanation: <style>
pre {
white-space: pre-wrap !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-c... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage3/get_started_with_machine_management.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
riddhishb/ipython-notebooks | Poisson Editing/SeamlessCloning_Sample/SeamlessImageCloningGeometric.ipynb | gpl-3.0 | import PIL
import PIL.Image
import scipy
import scipy.misc
ref = PIL.Image.open("sky.jpg")
ref = numpy.array(ref)
ref = scipy.misc.imresize(ref, 0.25, interp="bicubic")
target = PIL.Image.open("bird.jpg")
target = numpy.array(target)
target = scipy.... |
scikit-optimize/scikit-optimize.github.io | 0.7/notebooks/auto_examples/hyperparameter-optimization.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
"""
Explanation: ============================================
Tuning a scikit-learn estimator with skopt
============================================
Gilles Louppe, July 2016
Katie Malone, August 2016
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
If you are looking fo... |
maxentile/equilibrium-sampling-tinker | Annealed importance sampling.ipynb | mit | import numpy as np
import numpy.random as npr
npr.seed(0)
import matplotlib.pyplot as plt
plt.rc('font', family='serif')
%matplotlib inline
def annealed_importance_sampling(draw_exact_initial_sample,
transition_kernels,
annealing_distributions,
... |
metpy/MetPy | v0.8/_downloads/Station_Plot_with_Layout.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import pandas as pd
from metpy.calc import get_wind_components
from metpy.cbook import get_test_data
from metpy.plots import (add_metpy_logo, simple_layout, StationPlot,
StationPlotLayout, wx_code_map... |
google-research/google-research | aptamers_mlpd/figures/Figure_3_Machine_learning_guided_aptamer_discovery_(submission).ipynb | apache-2.0 | import numpy as np
import pandas as pd
import plotnine as p9
"""
Explanation: Copyright 2021 Google LLC
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.... |
kubeflow/code-intelligence | Issue_Embeddings/notebooks/05_EvaluateEmbeddings.ipynb | mit | import pandas as pd
import numpy as np
from random import randint
from matplotlib import pyplot as plt
import re
pd.set_option('max_colwidth', 1000)
df = pd.read_csv('https://storage.googleapis.com/issue_label_bot/k8s_issues/000000000000.csv')
df.labels = df.labels.apply(lambda x: eval(x))
df.head()
#remove target le... |
jsnajder/StrojnoUcenje | notebooks/SU-2015-0-SciPy.ipynb | cc0-1.0 | 10
_
?
%quickref
"""
Explanation: Sveučilište u Zagrebu<br>
Fakultet elektrotehnike i računarstva
Strojno učenje
<a href="http://www.fer.unizg.hr/predmet/su">http://www.fer.unizg.hr/predmet/su</a>
Ak. god. 2015./2016.
Bilježnica 0: Uvod u SciPy
(c) 2015 Jan Šnajder
<i>Verzija: 0.5 (2015-10-15) </i>
<p style="color:... |
alvason/probability-insighter | code/mutation-drift-selection.ipynb | gpl-2.0 | import numpy as np
import itertools
"""
Explanation: Wright-Fisher model of mutation, selection and random genetic drift
A Wright-Fisher model has a fixed population size N and discrete non-overlapping generations. Each generation, each individual has a random number of offspring whose mean is proportional to the indi... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Gla... |
abhipr1/DATA_SCIENCE_INTENSIVE | Week_2/statistics project 2/sliderule_dsi_inferential_statistics_exercise_2.ipynb | apache-2.0 | import pandas as pd
import numpy as np
from scipy import stats
data = pd.io.stata.read_stata('data/us_job_market_discrimination.dta')
# number of callbacks for balck-sounding names
sum(data[data.race=='b'].call)
"""
Explanation: Examining racial discrimination in the US job market
Background
Racial discrimination co... |
HubLot/PBxplore | doc/source/notebooks/Deformability.ipynb | mit | from pprint import pprint
from IPython.display import Image, display
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
import urllib.request
import os
import numpy as np
# print date & versions
import datetime
print("Date & time:",datetime.datetime.now())
import sys
print("Python version:", sys.vers... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 1 Mathematics and Python/Lectures notebooks/1 introduction to ipython/introduction_to_ipython.ipynb | mit | ! echo 'hello, world!'
!echo $t
%%bash
mkdir test_directory
cd test_directory/
ls -a
#удаление директории, если она не нужна
! rm -r test_directory
"""
Explanation: text
Header
для редактирования формулы ниже использует синтаксис tex
$$ c = \sqrt{a^2 + b^2}$$
End of explanation
"""
%%cmd
mkdir test_directory
cd ... |
GoogleCloudPlatform/cloudml-samples | notebooks/scikit-learn/OnlinePredictionWithScikitLearnInCMLE.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... |
davidgutierrez/HeartRatePatterns | Jupyter/LoadDataMimic-III.ipynb | gpl-3.0 | import sys
sys.version_info
"""
Explanation: Cargue de datos s SciDB
1) Verificar Prerequisitos
Python
SciDB-Py requires Python 2.6-2.7 or 3.3
End of explanation
"""
import numpy as np
np.__version__
"""
Explanation: NumPy
tested with version 1.9 (1.13.1)
End of explanation
"""
import requests
requests.__version_... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session06/Day1/BuildingBetterModels.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import mosfit
import time
# Disable "retina" line below if your monitor doesn't support it.
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
"""
Explanation: Building Better Models for Inference:
How to construct practical models for existing tools
I... |
ocefpaf/secoora | notebooks/timeSeries/sst/00-fetch_data.ipynb | mit | import time
start_time = time.time()
"""
Explanation: <img style='float: left' width="150px" src="http://secoora.org/sites/default/files/secoora_logo.png">
<br><br>
SECOORA Notebook 1
Fetch Sea Surface Temperature time-series data
This notebook fetches weekly time-series of all the SECOORA observations and
models ava... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/Video_PR/Motion_Blur_Filter.ipynb | bsd-3-clause | from pynq.drivers.video import HDMI
from pynq import Bitstream_Part
from pynq.board import Register
from pynq import Overlay
Overlay("demo.bit").download()
"""
Explanation: Don't forget to delete the hdmi_out and hdmi_in when finished
Motion Blur Filter Example
In this notebook, we will demonstrate how to use the mot... |
ClaudioVZ/Metodos_numericos_I | 01_Raices_de_ecuaciones_de_una_variable/01_Biseccion.ipynb | gpl-2.0 | def raiz(x_l, x_u):
x_r = (x_l + x_u)/2
return x_r
def intervalo_de_raiz(f, x_l, x_u):
x_r = raiz(x_l, x_u)
if f(x_l)*f(x_r) < 0:
x_u = x_r
if f(x_l)*f(x_r) > 0:
x_l = x_r
return x_l, x_u
"""
Explanation: Método de la bisección
El método de bisección, conocido también como de c... |
NuGrid/NuPyCEE | NSM_test_suite.ipynb | bsd-3-clause | # Do a SYGMA run for each NuGrid metallicity
s_02 = s.sygma(iniZ=0.02, imf_type='salpeter')
s_01 = s.sygma(iniZ=0.01, imf_type='salpeter')
s_006 = s.sygma(iniZ=0.006, imf_type='salpeter')
s_001 = s.sygma(iniZ=0.001, imf_type='salpeter')
s_0001 = s.sygma(iniZ=0.0001, imf_type='salpeter')
# Show the number of neutron s... |
huongttlan/statsmodels | examples/notebooks/statespace_sarimax_stata.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
from datetime import datetime
import requests
from io import BytesIO
"""
Explanation: SARIMAX: Introduction
This notebook replicates examples from the Stata ARIMA time se... |
PLN-FaMAF/DeepLearningEAIA | deep_learning_tutorial_2.ipynb | bsd-3-clause | import numpy
import keras
from keras import backend as K
from keras import losses, optimizers, regularizers
from keras.datasets import mnist
from keras.layers import Activation, ActivityRegularization, Conv2D, Dense, Dropout, Flatten, MaxPooling2D
from keras.models import Sequential
from keras.utils.np_utils import to... |
totalgood/twip | docs/notebooks/08 Features -- TFIDF with Gensim.ipynb | mit | dates = pd.read_csv(os.path.join(DATA_PATH, 'datetimes.csv.gz'), engine='python')
nums = pd.read_csv(os.path.join(DATA_PATH, 'numbers.csv.gz'), engine='python')
df = pd.read_csv(os.path.join(DATA_PATH, 'text.csv.gz'))
df.tokens
d = Dictionary.from_documents(([str(s) for s in row]for row in df.tokens))
df.tokens.iloc[... |
AllenDowney/ThinkBayes2 | examples/elephants_soln.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 numpy as np
import pandas as pd
# import classes from thinkbayes2
from thinkbayes2 import Pmf, Cd... |
daniel-severo/dask-ml | docs/source/examples/predict.ipynb | bsd-3-clause | import numpy as np
import dask.array as da
from sklearn.datasets import make_classification
X_train, y_train = make_classification(
n_features=2, n_redundant=0, n_informative=2,
random_state=1, n_clusters_per_class=1, n_samples=1000)
N = 100
X = da.concatenate([da.from_array(X_train, chunks=X_train.shape)
... |
Tsiems/machine-learning-projects | Lab1/.ipynb_checkpoints/Lab1-Travis-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
df = pd.read_csv('data/data.csv') # read in the csv file
"""
Explanation: Lab 1: Exploring NFL Play-By-Play Data
Data Loading and Preprocessing
To begin, we load the data into a Pandas data frame from a csv file.
End of explanation
"""
df.head()
"""
Explanation: Let's take a ... |
BinRoot/TensorFlow-Book | ch04_classification/Concept04_softmax.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
"""
Explanation: Ch 04: Concept 04
Softmax classification
Import the usual libraries:
End of explanation
"""
learning_rate = 0.01
training_epochs = 1000
num_labels = 3
batch_size = 100
x1_label0 = np.random.normal(1, 1, (1... |
jdhp-docs/python-notebooks | python_geopandas_cities_near_paris_saclay_en.ipynb | mit | !wget http://osm13.openstreetmap.fr/~cquest/openfla/export/communes-20180101-shp.zip
!unzip -u communes-20180101-shp.zip
import geopandas
"""
Explanation: Cities near Paris Saclay
http://geopandas.org/gallery/plotting_basemap_background.html#adding-a-background-map-to-plots
https://www.data.gouv.fr/fr/datasets/conto... |
satishgoda/learning | web/jquery_ipywidgets.ipynb | mit | from IPython.display import HTML, Javascript
from ipywidgets import interact
"""
Explanation: Back to jQuery
Mixing ipywidgets and jQuery
End of explanation
"""
HTML("""<h1 class='juh' id='juhh1'>Hello World</h1>""")
"""
Explanation: Create a HTML element with a class and a tag
End of explanation
"""
Javascript("... |
dariox2/CADL | session-1/.ipynb_checkpoints/session-1-checkpoint.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n' \
'You should consider updating to Python 3.4.0 or ' \
'higher as the libraries built for this course ' \
'have only been tested in Python 3.4 and higher.\n'... |
y2ee201/Deep-Learning-Nanodegree | first-neural-network/.ipynb_checkpoints/DLND Your first neural network-checkpoint.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
analog-rl/Easy21 | Joe #2 Monte-Carlo Control in Easy21/easy21 tests.ipynb | mit | import matplotlib.pyplot as plt
%matplotlib notebook
plt.figure(1)
values = []
for i in xrange(0,100000):
values.append(Card().absolute_value)
# values.append(random.randint(1,10))
plt.title('Test; Each draw from the deck results in a value between 1 and 10 (uniformly distributed)')
plt.hist(values)
... |
lisitsyn/shogun | doc/ipython-notebooks/distributions/KernelDensity.ipynb | bsd-3-clause | import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
# generates samples from the distribution
def generate_samples(n_samples,mu1,sigma1,mu2,sigma2):
samples1 = np.random.normal(mu1,sigma1,(1,int(n_... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_object_raw.ipynb | bsd-3-clause | from __future__ import print_function
import mne
import os.path as op
from matplotlib import pyplot as plt
"""
Explanation: The :class:Raw <mne.io.Raw> data structure: continuous data
End of explanation
"""
# Load an example dataset, the preload flag loads the data into memory now
data_path = op.join(mne.data... |
syednasar/datascience | deeplearning/language-translation/translation with rnn.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation with RNN using Tensorflow
In ... |
atulsingh0/MachineLearning | Sklearn_MLPython/cross_validation.ipynb | gpl-3.0 | # import
from sklearn.datasets import load_iris
from sklearn.cross_validation import cross_val_score, KFold, train_test_split, cross_val_predict, LeaveOneOut, LeavePOut
from sklearn.cross_validation import ShuffleSplit, StratifiedKFold, StratifiedShuffleSplit
from sklearn.metrics import accuracy_score
from sklearn.svm ... |
mne-tools/mne-tools.github.io | 0.21/_downloads/063df3a44a4ac9d23978d7b307e69a4e/plot_read_evoked.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
from mne import read_evokeds
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
# Reading
condition = 'Left Auditory'
evoked = read_evokeds(fname... |
mqvist/CarND-Behavioral-Cloning | Experiment_1.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_csv('data/driving_log.csv')
print(df.describe())
df['steering'].hist(bins=100)
plt.title('Histogram of steering angle (100 bins)')
"""
Explanation: Introduction
In this notebook, I want to experiment with the pro... |
phoebe-project/phoebe2-docs | 2.1/tutorials/beaming_boosting.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Beaming and Boosting
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplotlib inline
... |
Hvass-Labs/TensorFlow-Tutorials | 08_Transfer_Learning.ipynb | mit | from IPython.display import Image, display
Image('images/08_transfer_learning_flowchart.png')
"""
Explanation: TensorFlow Tutorial #08
Transfer Learning
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
WARNING!
This tutorial does not work with TensorFlow v. 1.9 due to the PrettyTensor builder API apparently ... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/metaanalysis1.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy import stats, optimize
from statsmodels.regression.linear_model import WLS
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.stats.meta_analysis import (
effectsize_smd,
effectsize_2proportions,
combine_effect... |
mne-tools/mne-tools.github.io | 0.17/_downloads/2aba6a5c9f79fe16cdce1a232bc5e327/plot_brainstorm_phantom_elekta.ipynb | bsd-3-clause | # sphinx_gallery_thumbnail_number = 9
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import find_events, fit_dipole
from mne.datasets.brainstorm import bst_phantom_elekta
from mne.io import read_... |
sprax/python | ds/umich-ds-wk1.ipynb | lgpl-3.0 | def add_numbers(x, y):
return x + y
add_numbers(1, 2)
"""
Explanation: You are currently looking at version 1.1 of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the Jupyter Notebook FAQ course resource.
The Python Programming Language... |
opengeostat/pygslib | pygslib/Ipython_templates/deprecated/probplt_raw.ipynb | mit | #general imports
import matplotlib.pyplot as plt
import pygslib
import numpy as np
#make the plots inline
%matplotlib inline
"""
Explanation: PyGSLIB
Probplot
End of explanation
"""
#get the data in gslib format into a pandas Dataframe
mydata= pygslib.gslib.read_gslib_file('../datasets/cluster.dat')
true= py... |
tschinz/iPython_Workspace | 01_Mine/MachineLearning/NeuroEvolution-Flappy-Bird-master/Jupyter Notebook/Flappy.ipynb | gpl-2.0 | import pygame
from pygame.locals import * # noqa
import sys
import random
class FlappyBird_Human:
def __init__(self):
self.screen = pygame.display.set_mode((400, 700))
self.bird = pygame.Rect(65, 50, 50, 50)
self.background = pygame.image.load("assets/background.png").convert()
se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.