repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
k326xh/SingleCellRNA-seq
Notebook/Smushing.ipynb
mit
# Import required modules # Python plotting library import matplotlib.pyplot as plt # Numerical python library import numpy as np # Dataframes in Python import pandas as pd # Statistical plotting library we'll use import seaborn as sns # Import packages for dimension reduction from sklearn.decomposition import PCA, Fas...
SKA-ScienceDataProcessor/algorithm-reference-library
deprecated_code/workflows/mpi/imaging_mpi.ipynb
apache-2.0
%lsmagic from mpi4py import MPI print(MPI.COMM_WORLD.size) %matplotlib inline import os import sys sys.path.append(os.path.join('..', '..')) from data_models.parameters import arl_path results_dir = arl_path('test_results') from matplotlib import pylab pylab.rcParams['figure.figsize'] = (8.0, 8.0) pylab.rc...
MehtapIsik/assaytools
examples/direct-fluorescence-assay/1 Simulating Experimental Fluorescence Binding Data.ipynb
lgpl-2.1
import matplotlib.pyplot as plt import numpy as np import seaborn as sns from IPython.display import display, Math, Latex #Do we even need this anymore? %pylab inline """ Explanation: In this notebook we will explore plotting complex concentration as a function of Kd. We will simulate expected fluorescence results for...
Hash--/documents
notebooks/pywed_xray/PyWED dataframe and xray.ipynb
mit
%pylab inline import xray """ Explanation: This notebook explores the possibility to use the Python package xray in order to ease the data processing from the TS/WEST database. xray is an open source project and Python package that aims to bring the labeled data power of pandas to the physical sciences, by providing N...
maxis42/ML-DA-Coursera-Yandex-MIPT
4 Stats for data analysis/Lectures notebooks/7 student tests/stat.student_tests.ipynb
mit
import numpy as np import pandas as pd import scipy from statsmodels.stats.weightstats import * %pylab inline """ Explanation: Критерии Стьюдента End of explanation """ data = pd.read_csv('ADHD.txt', sep = ' ', header = 0) data.columns = ['Placebo', 'Methylphenidate'] data.plot.scatter('Placebo', 'Methylphenidate...
nonabelian/tda_dionysus
TADA_Dionysus.ipynb
gpl-3.0
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # Local companion package from topology.data import coffee_mug from topology.data import pail from topology.plotting import plot_mug_3D from topology.plotting import plot_pail_3D from topology.plotting import plot_circle_2D %matplotlib notebook ...
arnoldlu/lisa
ipynb/examples/energy_meter/EnergyMeter_ACME.ipynb
apache-2.0
import logging from conf import LisaLogging LisaLogging.setup() """ Explanation: Energy Meter Examples BayLibre's ACME Cape and IIOCapture More information can be found at https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#iiocapture---baylibre-acme-cape. End of explanation """ # Generate plots inl...
keras-team/keras-io
examples/structured_data/ipynb/classification_with_tfdf.ipynb
apache-2.0
import math import urllib import numpy as np import pandas as pd import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import tensorflow_decision_forests as tfdf """ Explanation: Classification with TensorFlow Decision Forests Author: Khalid Salama<br> Date created: 2022/01/25<br> La...
andalexo/cryoblm
jupyter-notebooks/CryoBLM_BLEDP.ipynb
mit
import numpy as np import logging from time import time from datetime import datetime from os.path import join from os import walk %matplotlib notebook import matplotlib.pyplot as plt import matplotlib.dates as mdates from itertools import cycle """ Explanation: CryoBLM BLEDP 2017-03-26 Display, extraction and analys...
ysh329/Homework
Python for Genomic Data Science/Lecture 7 Quiz.ipynb
mit
f = open('b.py', 'r') """ Explanation: Lecture 7 Quiz Question 1 A student wants to write into a file called myfile, without deleting its existing content. Which one of the following functions should he or she use? * f = open('myfile', 'w') * f = open('myfile', 'a') * f = open('myfile', 'r') * f = open('myfile', 'w+b'...
ernestyalumni/MLgrabbag
coursera_Ng/KNN.ipynb
mit
%matplotlib inline # sanity check for python setup import sys print(sys.executable) print(sys.path) import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.cluster import KMeans from sklearn import datasets np.random.seed(5) centers=[[1,1],[-1,-1],[1,-1]] iris...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/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', 'ncc', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
mrcslws/nupic.research
projects/meta_cl/compute_sparsity_stats_per_layer.ipynb
agpl-3.0
BATCH_SIZE = 16 PROJECT_DIR = os.path.expanduser("~/nta/nupic.research/projects/gsc") EXPERIMENT_NAME = "default_sparse_cnn" CHECKPOINT_FILE = "/home/ec2-user/nta/results/experiments/gsc/default_sparse_cnn/RemoteProcessTrainable_0_2021-01-07_15-54-473wnu2slv/checkpoint_30/checkpoint" USE_CUDA = torch.cuda.is_available(...
desihub/desitarget
doc/nb/elg-properties-dr7.1.ipynb
bsd-3-clause
import os, warnings, pdb import numpy as np import fitsio from astropy.table import Table import matplotlib.pyplot as plt import seaborn as sns rc = {'font.family': 'serif'}#, 'text.usetex': True} sns.set(style='ticks', font_scale=1.5, palette='Set2', rc=rc) %matplotlib inline """ Explanation: Properties of ELGs in ...
gertingold/lit2017
lit2017.ipynb
mit
%matplotlib inline import numpy as np from scipy import misc, ndimage import matplotlib as mpl import matplotlib.pyplot as plt from skimage import (color, data, draw, exposure, filters, measure, morphology, transform) """ Explanation: Bildverarbeitung mit Python Gert-Ludwig Ingold <div style="marg...
OXPHOS/shogun
doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb
gpl-3.0
import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../../data') # training data train_income=['Low','Medium','Low','High','Low','High','Medium','Medium','High','Low','Medium', 'Medium','High','Low','Medium'] train_age = ['Old','Young','Old','Young','Old','Young','Young','Old','Old','Old','Young','Old', 'Old...
hzzyyy/pymcef
examples/2. Black Scholes revisit, delta hedging as an efficient portfolio.ipynb
bsd-3-clause
from scipy.stats import norm import numpy as np def bs_put(df, fwd, t, vol, k): log_fwd_moneyness = np.log(fwd/k) d1 = (log_fwd_moneyness + vol**2 /2.0 * t) / vol / np.sqrt(t) d2 = d1 - vol * np.sqrt(t) return df * (-norm.cdf(-d1) * fwd + norm.cdf(-d2) * k), norm.cdf(-d1) """ Explanation: Introduction...
soracom/handson
cloud/gcp/src/datalab/datalab_basic.ipynb
apache-2.0
# このセルにカーソルを当ててCtrl+Enter もしくは Shift+Enterを押すと'hello world'と出力することができます print('hello world') # 各種制御構文、クラスや関数なども含めて通常のプログラミングと同じように動作させることができます for i in range(10): print(i) # 変数の定義はセル内だけでなく、ノートブック全体がスコープとなり、通常のPythonと同じような扱いとなります x = 10 # xは10なので、10+20となります y = x + 20 print(y) """ Explanation: Pythonのコードをセル内に書いて...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/ets.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import pandas as pd %matplotlib inline from statsmodels.tsa.exponential_smoothing.ets import ETSModel plt.rcParams['figure.figsize'] = (12, 8) """ Explanation: ETS models The ETS models are a family of time series models with an underlying state space model consistin...
sjsrey/pysal
notebooks/explore/segregation/inference_wrappers_example.ipynb
bsd-3-clause
%matplotlib inline import geopandas as gpd from pysal.explore import segregation import pysal.lib import pandas as pd import numpy as np from pysal.explore.segregation.inference import SingleValueTest, TwoValueTest """ Explanation: Inference Wrappers use cases This is an example of the PySAL segregation framework to...
CentroGeo/Analisis-Espacial
muap/MUAP.ipynb
gpl-2.0
from geopandas import GeoDataFrame estatal = GeoDataFrame.from_file('data/des_rezago_estado.shp') municipal = GeoDataFrame.from_file('data/muns_geo_des.shp') """ Explanation: Unidad de Area Modificable En esta práctica vamos a explorar la forma en la agregación delos datos influye en los resultados de un análisis. Par...
berlemontkevin/Jupyter_Notebook
Algorithm_Physic/M2_PTSC_17/.ipynb_checkpoints/Sampling_pi-checkpoint.ipynb
apache-2.0
import random #Library of random numbers import matplotlib.pyplot as plt #Ploting Library %matplotlib inline # In order to plot in the notebook n_trials = 4000 #Number of thrown peebles num_inside = 0 data_inside_x = [] data_inside_y = [] data_outside_x = [] data_o...
acehanks/projects
machine_learning_hello_world/Iris_dataset_ML_getting_started.ipynb
mit
iris['data'][:5] print(iris['DESCR'] + "\n") iris['data'].shape iris['target'].shape X= iris['data'] y= iris['target'] """ Explanation: data from first 5 columns End of explanation """ from sklearn.neighbors import KNeighborsClassifier knn= KNeighborsClassifier(n_neighbors=1) """ Explanation: instantiate KNN ...
dsacademybr/PythonFundamentos
Cap02/Notebooks/DSA-Python-Cap02-Exercicios.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 2</font> Download: http://github.com/dsacademybr End of explanation """ # Exerc...
tpin3694/tpin3694.github.io
machine-learning/.ipynb_checkpoints/loading_scikit-learns_digits-dataset-checkpoint.ipynb
mit
# Load libraries from sklearn import datasets import matplotlib.pyplot as plt """ Explanation: Title: Loading Scikit-Learn's Digits Dataset Slug: loading_scikit-learns_digits-dataset Summary: Loading the built-in digits datasets of Scikit-Learn. Date: 2016-08-31 12:00 Category: Machine Learning Tags: Basics Authors:...
sassoftware/sas-viya-programming
python/network-analysis/Hartford Drug User Social Network Analysis using CAS HyperGroup.ipynb
apache-2.0
import swat import time import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx # Also import networkx used for rendering a network import networkx as nx %matplotlib inline """ Explanation: A Simple Pipeline using Hypergroup to Perform Com...
eds-uga/csci4360-fa17
workshops/w0/W0--Getting Started with Anaconda for Data Science in Python.ipynb
mit
# Step 1: right-click the "download" link on the left # Step 2: select "copy link address" # Step 3: paste the link into the following bash command, after "wget" !wget https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh """ Explanation: Preliminaries Assuming either Linux (Ubuntu) macOS though Windo...
yevheniyc/Projects
1j_NLP_Python/ex08.ipynb
mit
from datasketch import MinHash # greate library for Probabilistic Data Structures def mh_digest (data): mh = MinHash(num_perm=512) for d in data: mh.update(d.encode('utf8')) # hashing and encoding with utf8 return mh """ Explanation: Exercise 08: semantic similarity First, let's create a function to calcu...
zonemercy/Kaggle
quora/solution/Importance of a Linguistic Pre-processing .ipynb
mit
from nltk.stem.wordnet import WordNetLemmatizer from nltk.stem import LancasterStemmer stemmer = LancasterStemmer() lemmer = WordNetLemmatizer() """ Explanation: I've seen a couple of nice kernels here, but no one explained the importance of a morphological pre-processing of the data. So I decided to compare two appr...
darrenxyli/deeplearning
lessons/sentimentanalysis/sentiment-analysis/Sentiment analysis with TFLearn.ipynb
apache-2.0
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...
Naereen/notebooks
Obfuscated_code_or_piece_of_art.ipynb
mit
%%time b_ = ( 255, lambda V ,B,c :c and Y(V*V+B,B, c -1)if(abs(V)<6)else ( ...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/projects/01-first-neural-network/notebooks/Your_first_neural_network_v0.00.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...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_objects_from_arrays.ipynb
bsd-3-clause
# Author: Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: BSD (3-clause) import numpy as np import neo import mne print(__doc__) """ Explanation: Creating MNE objects from data arrays In this simple example, the creation of MNE objects from numpy arrays is demonstrated. In the last example case, a NEO fil...
y2ee201/Deep-Learning-Nanodegree
autoencoder/Simple_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
VectorBlox/PYNQ
Pynq-Z1/notebooks/examples/arduino_grove_ledbar.ipynb
bsd-3-clause
# Make sure the base overlay is loaded from pynq import Overlay Overlay("base.bit").download() """ Explanation: Grove LED Bar Example This example shows how to use the Grove LED Bar on the Pynq-Z1 board. The LED bar has 10 LEDs: 8 green LEDs, 1 orange LED, and 1 red LED. The brightness for each LED can be set indepen...
achave11/bioapi-examples
python_notebooks/1kg.ipynb
apache-2.0
import ga4gh.client as client c = client.HttpClient("http://1kgenomes.ga4gh.org") """ Explanation: GA4GH 1000 Genome Examples Variant data from the Thousand Genomes project is being served by the GA4GH reference server. In this example we show how to use the GA4GH client to access the data. Initialize the client In t...
google/starthinker
colabs/sa360_web_query.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: SA360 Web Query Report Download SA360 reports into a Google Sheet. 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. You may obtain ...
GoogleCloudPlatform/asl-ml-immersion
notebooks/launching_into_ml/solutions/supplemental/basic_intro_logistic_regression.ipynb
apache-2.0
import os import matplotlib.pyplot as plt import tensorflow as tf print(f"TensorFlow version: {tf.__version__}") print(f"Eager execution: {tf.executing_eagerly()}") """ Explanation: Introduction to Logistic Regression Using TF 2.0 Learning Objectives Build a model, Train this model on example data, and Use the mod...
nicococo/tilitools
lectures/optimization_exercise.ipynb
mit
from functools import partial from scipy.optimize import check_grad, minimize import numpy as np import cvxopt as cvx import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Exercise: Optimization We will implement various optimization algorithms and examine their performance for various tasks. First-o...
mne-tools/mne-tools.github.io
0.20/_downloads/78dfec6019dc9e7214e1efd97200f1c4/plot_10_overview.ipynb
bsd-3-clause
import os import numpy as np import mne """ Explanation: Overview of MEG/EEG analysis with MNE-Python This tutorial covers the basic EEG/MEG pipeline for event-related analysis: loading data, epoching, averaging, plotting, and estimating cortical activity from sensor data. It introduces the core MNE-Python data struct...
lukechen526/kaggle-competitions
house-prices-advanced-regression-techniques/comprehensive_exploration.ipynb
mit
#invite people for the Kaggle party import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.stats import norm from sklearn.preprocessing import StandardScaler from scipy import stats import warnings warnings.filterwarnings('ignore') %matplotlib inline # Download the file...
angelmtenor/deep-learning
tv-script-generation/AMT_dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation Student: Angel Martinez-Tenor <br> Deep Learning Nanodegree...
greenelab/GCB535
32_ML-V/ML5.ipynb
bsd-3-clause
# numpy provides python tools to easily load comma separated files. import numpy as np # use numpy to load disease #1 data d1 = np.loadtxt(open("../31_Data_ML-IV/D1.csv", "rb"), delimiter=",") # features are all rows for columns before 200 # The canonical way to name this is that X is our matrix of # examples by feat...
tensorflow/docs-l10n
site/ja/addons/tutorials/layers_normalizations.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...
tensorflow/docs-l10n
site/ja/guide/eager.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...
fastai/course-v3
nbs/dl1/rossman_data_clean.ipynb
apache-2.0
PATH=Config().data_path()/Path('rossmann/') table_names = ['train', 'store', 'store_states', 'state_names', 'googletrend', 'weather', 'test'] tables = [pd.read_csv(PATH/f'{fname}.csv', low_memory=False) for fname in table_names] train, store, store_states, state_names, googletrend, weather, test = tables len(train),len...
anilcs13m/MachineLearning_Mastering
movie review sentiment analysis/Movie Review Sentiment Analysis.ipynb
gpl-2.0
import csv from sklearn.linear_model import LogisticRegression as LR from sklearn import svm from sklearn.naive_bayes import BernoulliNB from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn import cross_validation from sklearn.metrics impo...
quantopian/research_public
notebooks/lectures/Introduction_to_Pairs_Trading/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import statsmodels import statsmodels.api as sm from statsmodels.tsa.stattools import coint # just set the seed for the random number generator np.random.seed(107) import matplotlib.pyplot as plt """ Explanation: Introduction to Pairs Trading By Delaney Mackenzie and Maxwell Ma...
tensorflow/docs-l10n
site/en-snapshot/lite/guide/authoring.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...
dataplumber/nexus
esip-workshop/student-material/workshop1/4 - Student Exercise.ipynb
apache-2.0
# TODO: Make sure you run this cell before continuing! %matplotlib inline import matplotlib.pyplot as plt def show_plot(x_data, y_data, x_label, y_label): """ Display a simple line plot. :param x_data: Numpy array containing data for the X axis :param y_data: Numpy array containing data for the Y...
amsehili/audio-segmentation-by-classification-tutorial
multiclass_audio_segmentation.ipynb
gpl-3.0
import wave import pickle import numpy as np from sklearn.mixture import GMM import librosa from auditok import DataValidator, ADSFactory, DataSource, StreamTokenizer, BufferAudioSource, player_for """ Explanation: Multiclass audio segmentation using auditok and GMMs What is audio segmentation? Audio segmentation mean...
rashikaranpuria/Machine-Learning-Specialization
Classification/Week 1/module-2-linear-classifier-assignment-blank.ipynb
mit
from __future__ import division import graphlab import math import string """ Explanation: Predicting sentiment from product reviews The goal of this first notebook is to explore logistic regression and feature engineering with existing GraphLab functions. In this notebook you will use product review data from Amazon....
AllenDowney/ThinkBayes2
soln/chap08.ipynb
mit
# If we're running on Colab, install empiricaldist # https://pypi.org/project/empiricaldist/ 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...
scottquiring/Udacity_Deeplearning
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels_orig = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent n...
jarrodmcc/OpenFermion
examples/jordan_wigner_and_bravyi_kitaev_transforms.ipynb
apache-2.0
from openfermion import * # Create some ladder operators annihilate_2 = FermionOperator('2') create_2 = FermionOperator('2^') annihilate_5 = FermionOperator('5') create_5 = FermionOperator('5^') # Construct occupation number operators num_2 = create_2 * annihilate_2 num_5 = create_5 * annihilate_5 # Map FermionOpera...
HrWangChengdu/CS231n
assignment1/two_layer_net.ipynb
mit
# A bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.neural_net import TwoLayerNet %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # for auto-reloadi...
aayushmudgal/Reducing-Manufacturing-Failures
scripts/visualizer.ipynb
apache-2.0
import numpy as np import pandas as pd import collections import matplotlib import matplotlib.pyplot as plt %matplotlib inline # import seaborn as sns # sns.set_style("whitegrid", {'axes.grid' : False}) train_categorical_iter=pd.read_csv("../data/train_categorical.csv",chunksize=100000, dtype=str,usecols=list(range...
oemof/feedinlib
examples/run_pvlib_model.ipynb
mit
from feedinlib import Photovoltaic # suppress warnings import warnings warnings.filterwarnings("ignore") """ Explanation: Example for using the Pvlib model The Pvlib model can be used to determine the feed-in of a photovoltaic module using the pvlib. The pvlib is a python library for simulating the performance of pho...
tensorflow/docs-l10n
site/ja/hub/tutorials/cropnet_cassava.ipynb
apache-2.0
!pip install matplotlib==3.2.2 import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_hub as hub #@title Helper function for displaying examples def plot(examples, predictions=None): # Get the images, labels, and optionally predictions imag...
zegnus/self-driving-car-machine-learning
p01-finding-lane-lines/P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dimesions:', im...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_visualize_evoked.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne # sphinx_gallery_thumbnail_number = 9 """ Explanation: Visualize Evoked data In this tutorial we focus on the plotting functions of :class:mne.Evoked. End of explanation """ data_path = mne.datasets.sample.data_path() fname = op.joi...
sueiras/training
sklearn/02 - Regression models - SOLVED.ipynb
gpl-3.0
from sklearn import datasets all_data = datasets.california_housing.fetch_california_housing() # Describe dataset print(all_data.DESCR) print(all_data.feature_names) # Print some data lines print(all_data.data[:10]) print(all_data.target) #Randomize, normalize and separate train & test from sklearn.utils import sh...
google-aai/tf-serving-k8s-tutorial
jupyter/estimator_training_to_serving.ipynb
apache-2.0
import numpy as np import os import tensorflow as tf import urllib.request # Define a constant indicating the number of layers in our loaded model. We're loading a # resnet-50 model. RESNET_SIZE = 50 # Model and serving directories MODEL_DIR="resnet_model_checkpoints" SERVING_DIR="estimator_servable" SAMPLE_DIR="....
paolorivas/homeworkfoundations
08/Homework_8_Paolo_Rivas.ipynb
mit
df['Count'].plot.box() """ Explanation: 0. How is this data distributed? The presence of extrame values is a common pattern in this dataframe. We need to be carefull while using cetered measures. End of explanation """ df.groupby('Year')['Count'].sum().sort_values(ascending=False) df.groupby('Year')['Count'].sum()...
materialsvirtuallab/megnet
notebooks/molecule_example.ipynb
bsd-3-clause
import tensorflow as tf import pandas as pd data = pd.read_json('molecules.json').sample(1000) """ Explanation: Example using MEGNet with Molecules This example shows how to use MEGNet with molecular data. It will require that you have installed MEGNet with the extra depedencies for molecules, as described in the doc...
richlewis42/scikit-chem
docs/tutorial/filters.ipynb
bsd-3-clause
skchem.filters.__all__ """ Explanation: Filtering Operations looking to remove compounds from a collection are implemented as Filters in scikit-chem. These are implemented in the skchem.filters packages: End of explanation """ of = skchem.filters.OrganicFilter() benzene = skchem.Mol.from_smiles('c1ccccc1', name='b...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session09/Day1/ConditionalEntropy.ipynb
mit
def gen_periodic_data(x, period=1, amplitude=1, phase=0, noise=0): '''Generate periodic data given the function inputs y = A*cos(x/p - phase) + noise Parameters ---------- x : array-like input values to evaluate the array period : float (default=1) period of the pe...
statsmodels/statsmodels.github.io
v0.13.1/examples/notebooks/generated/statespace_arma_0.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from scipy import stats import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.graphics.api import qqplot """ Explanation: Autoregressive Moving Average (ARMA): Sunspots data This notebook replicates the existing ARMA notebook using th...
datamicroscopes/release
examples/gauss2d.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pylab as plt import numpy as np import time import seaborn as sns import pandas as pd rc = plt.rc("figure", figsize=(8,8)) sns.set_style('darkgrid', rc) sns.set_context('talk') sns.set_palette("Set2", 30) """ Explanation: Inferring Gaussians with the Dirichlet Process Mixture Model...
atlury/deep-opencl
DL0110EN/2.2.1linear_regression_one_parameter_v2.ipynb
lgpl-3.0
# These are the libraries will be used for this lab. import numpy as np import matplotlib.pyplot as plt """ Explanation: <a href="http://cocl.us/pytorch_link_top"> <img src="https://cocl.us/Pytorch_top" width="750" alt="IBM 10TB Storage" /> </a> <img src="https://ibm.box.com/shared/static/ugcqz6ohbvff804xp84y4kq...
hjelmj/electrochem
notebooks/EIS_2D_interactive.ipynb
mit
#python dependencies import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from ipywidgets import interact, FloatSlider, RadioButtons #change the default font set (matplotlib.rc) mpl.rc('mathtext', fontset='stixsans', default='regular') #increase text size somewhat mpl.rcParams.update({'axes.labe...
xodus7/tensorflow
tensorflow/contrib/lite/tutorials/post_training_quant.ipynb
apache-2.0
! pip uninstall -y tensorflow ! pip install -U tf-nightly import tensorflow as tf tf.enable_eager_execution() ! git clone --depth 1 https://github.com/tensorflow/models import sys import os if sys.version_info.major >= 3: import pathlib else: import pathlib2 as pathlib # Add `models` to the python path. mo...
dsacademybr/PythonFundamentos
Cap02/Notebooks/DSA-Python-Cap02-Exercicios-Solucao.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 2</font> Download: http://github.com/dsacademybr End of explanation """ # Exerc...
efoley/deep-learning
embeddings/Skip-Gram word2vec.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
bmcinnes/VCU-VIP-Nanoinformatics
NERD/DecisionTree/Decision Tree NER Model Results.ipynb
gpl-3.0
#python3 arff_translator.py [filename] """ Explanation: Experimental Results from a Decision Tree based NER model Decisions Trees, as opposed to other machine learning techniques such as SVM's and Neural Networks, provide a human-interpretable classification model. We will exploit this to both generate pretty pictures...
karlstroetmann/Formal-Languages
ANTLR4-Python/Calculator/Calculator.ipynb
gpl-2.0
!cat -n Program.g4 """ Explanation: Embedded Actions in <span style="font-variant:small-caps;">Antlr</span> Grammars The pure grammar is stored in the file Grammar.g4. On Unix-like operating systems, the following command displays the file Program.g4. End of explanation """ !type Program.g4 """ Explanation: On a W...
gaufung/PythonStandardLibrary
DataPersistence/sqllite.ipynb
mit
import os import sqlite3 db_filename = 'todo.db' db_is_new = not os.path.exists(db_filename) conn = sqlite3.connect(db_filename) if db_is_new: print('Need to create schema') else: print('Database exists, assume schme does, too.') conn.close() %ls *.db %rm -rf todo.db import os import sqlite3 db_filename= 'tod...
lucasbrsa/MLANN-1
src/ann_guide/architecture.ipynb
gpl-3.0
import numpy as np from scipy import optimize # training data x_train = np.array(([3,5],[5,1],[10,2],[6,1.5]), dtype=float) y_train = np.array(([75],[82],[93],[70]), dtype=float) # testing data x_test = np.array(([4, 5.5],[4.5, 1],[9,2.5],[6,2]), dtype=float) y_test = np.array(([70],[89],[85],[75]), dtype=float) """...
ksooklall/deep_learning_foundation
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:200] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural ...
pvalienteverde/ElCuadernillo
ElCuadernillo/20160725_SistemasDeRecomendacionContentBased/Content-Based paso a paso.ipynb
mit
import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from sklearn.neighbors import NearestNeighbor...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160627월_21일차_PCA Principal Component Analysis/3.PCA.ipynb
mit
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) plt.scatter(X[:,0], X[:,1], s=100) plt.xlim(-4,4) plt.ylim(-3,3) plt.title("original data") plt.show() from sklearn.decomposition import PCA pca = PCA(n_components=2) pca.fit(X) Z = pca.transform(X) Z w, V = np.linalg.eig(pca.get_covariance()) V.T...
hbjornoy/DataAnalysis
Backup (not final delivery)/Homework 1.ipynb
apache-2.0
# Imports %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import glob import csv import calendar import webbrowser from datetime import datetime # Constants DATA_FOLDER = 'Data/' """ Explanation: Table of Contents <p><div class="lev1"><a href="#Task-1.-Compiling-Ebola-Data">...
exe0cdc/PyscesToolbox
documentation/notebooks/RateChar.ipynb
bsd-3-clause
mod = pysces.model('lin4_fb.psc') rc = psctb.RateChar(mod) """ Explanation: RateChar RateChar is a tool for performing generalised supply-demand analysis (GSDA) [2,3]. This entails the generation data needed to draw rate characteristic plots for all the variable species of metabolic model through parameter scans and t...
maxkleiner/maXbox4
MNISTSinglePredict2Test.ipynb
gpl-3.0
#sign:max: MAXBOX8: 13/03/2021 07:46:37 import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import tree from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from sklearn import datasets from sklearn.metrics import accuracy_score from sklearn.model_selection im...
dusenberrymw/incubator-systemml
samples/jupyter-notebooks/Linear Regression Algorithms Demo.ipynb
apache-2.0
!pip uninstall systemml --y !pip install --user https://repository.apache.org/content/groups/snapshots/org/apache/systemml/systemml/1.0.0-SNAPSHOT/systemml-1.0.0-20171201.070207-23-python.tar.gz !pip show systemml """ Explanation: Linear Regression Algorithms using Apache SystemML This notebook shows: - Install Syste...
rsheftel/raccoon
examples/usage_series.ipynb
mit
# remove comment to use latest development version import sys; sys.path.insert(0, '../') # import libraries import raccoon as rc """ Explanation: Example Usage for Series End of explanation """ # empty DataFrame srs = rc.Series() srs # with indexes but no data srs = rc.Series(index=[1, 2, 3]) srs # with data srs ...
cloudedbats/cloudedbats_dsp
notebooks/experimental/librosa_detect_bat_pulses_in_time_domain.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (15, 4) import numpy as np import librosa """ Explanation: Librosa - detect bat pulses in time domain This is an early test to check if librosa can be used to detect bat pulses and sequences in time domain. Bat sound is normally "spa...
Leguark/GeMpy
Prototype Notebook/Sandstone Project.ipynb
mit
# Setting extend, grid and compile # Setting the extent sandstone = GeMpy_core.GeMpy() # Create Data class with raw data sandstone.import_data( 696000,747000,6863000,6950000,-20000, 2000, path_f = os.pardir+"/input_data/a_Foliations.csv", path_i...
matthewzimmer/carnd-behavioral-cloning
basic_training.ipynb
mit
class RecordingMeasurement: """ A representation of a vehicle's state at a point in time while driving around a track during recording. Features available are: left_camera_view - An image taken by the LEFT camera. center_camera_view - An image taken by the CENTER camera. ...
jorgehatccrma/pyGrFNN
notebooks/utils/.ipynb_checkpoints/Resonance Sequences-checkpoint.ipynb
bsd-3-clause
!date %matplotlib inline from __future__ import division import math def fareySequence(N, k=1): """ Generate Farey sequence of order N, less than 1/k """ # assert type(N) == int, "Order (N) must be an integer" a, b = 0, 1 c, d = 1, N seq = [(a,b)] while c/d <= 1/k: seq.append((...
pvchaumier/ml_by_example
src/PCA.ipynb
isc
# to display interactive plots within the notebook %matplotlib notebook # to define the size of the plotted images from pylab import rcParams rcParams['figure.figsize'] = (10, 8) import matplotlib.pyplot as plt import numpy as np from fct import generate_multivariate, normalize, plot_3d, plot_2d, Arrow3D """ Explana...
ComputationalModeling/spring-2017-danielak
past-semesters/fall_2016/day-by-day/day20-monte-carlo-integration/MonteCarlo_Integration_SOLUTIONS.ipynb
agpl-3.0
# Put your code here! import random as rand import math def f(x): return 2.0*(x**2) + 3.0 # x min, max: -2, 4 (delta_x = 6) # y min, max: 0, 35 Area = (35-0)*(4+2) real_area = 66.0 samples = [] errors = [] for i in range(1,7): N_samples = 10**i N_below = 0 for j in range(N_samples):...
btel/2015_eitn_swc_pandas
01 - Introduction.ipynb
bsd-2-clause
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt pd.options.display.max_rows = 8 """ Explanation: <h1>Pandas Tutorial</h1> <h3>Software Carpentry, EITN, Paris, November 20th, 2015</h3> <h2>Bartosz Teleńczuk</h2> forked from the tutorial at EuroScipy 2015 by Joris Van den Boss...
tpin3694/tpin3694.github.io
sql/select_entire_table.ipynb
mit
# Ignore %load_ext sql %sql sqlite:// """ Explanation: Title: Select An Entire Table Slug: select_entire_table Summary: Select an entire table in SQL. Date: 2016-05-01 12:00 Category: SQL Tags: Basics Authors: Chris Albon Note: This tutorial was written using Catherine Devlin's SQL in Jupyter Notebooks library. If ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/building_production_ml_systems/labs/4b_streaming_data_inference_vertex.ipynb
apache-2.0
import numpy as np import os import shutil import tensorflow as tf from google.cloud import aiplatform from google.cloud import bigquery from google.protobuf import json_format from google.protobuf.struct_pb2 import Value from matplotlib import pyplot as plt from tensorflow import keras from tensorflow.keras.callbacks...
feststelltaste/software-analytics
prototypes/Quantifying Graph Data.ipynb
gpl-3.0
import py2neo import pandas as pd graph = py2neo.Graph() graph.dbms.kernel_version """ Explanation: Introduction This is a simple helper notebook to quickly get some numbers about your graphs out of a Neo4j database. You just need to start your Neo4j database locally with the default values before running this noteb...
alorenzo175/pvlib-python
docs/tutorials/tmy_to_power.ipynb
bsd-3-clause
# built-in python modules import os import inspect # scientific python add-ons import numpy as np import pandas as pd # plotting stuff # first line makes the plots appear in the notebook %matplotlib inline import matplotlib.pyplot as plt import matplotlib as mpl # finally, we import the pvlib library import pvlib ...
intel-analytics/analytics-zoo
pyzoo/zoo/chronos/use-case/fsi/stock_prediction_prophet.ipynb
apache-2.0
import numpy as np import pandas as pd import os FILE_NAME = 'all_stocks_5yr.csv' filepath = os.path.join('data', FILE_NAME) print(filepath) # read data data = pd.read_csv(filepath) print(data[:10]) # change input column name data = data[data['Name']=='MMM'].rename(columns={"date":"ds", "close":"y"}) data.head() ...
opengeostat/pygslib
pygslib/Ipython_templates/.ipynb_checkpoints/bicalib_raw-checkpoint.ipynb
mit
#general imports import matplotlib.pyplot as plt import pygslib import numpy as np import pandas as pd #make the plots inline %matplotlib inline """ Explanation: PyGSLIB Bicalib The GSLIb equivalent parameter file is ``` Parameters for BICALIB **** START OF PARAMETERS: ...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/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', 'nims-kma', 'sandbox-2', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-2 Topic: Landice Sub-Topics: Glaciers, Ice. Pro...