repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
spencer2211/deep-learning
language-translation/dlnd_language_translation.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 In this project, you’re going...
elenduuche/deep-learning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that takes in a sequence of letters, an...
pbutenee/ml-tutorial
source/1/machine_learning.ipynb
mit
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = (13.0, 8.0) %matplotlib inline import pickle import sklearn import sklearn.linear_model import sklearn.preprocessing import sklearn.gaussian_process import sklearn.ensemble """ Explanation: Machine Learning 101++ in Python Created b...
mjabri/holoviews
doc/Tutorials/Showcase.ipynb
bsd-3-clause
import holoviews as hv from holoviews.operation import contours, threshold, gradient import numpy as np %reload_ext holoviews.ipython """ Explanation: HoloViews encapsulates your continuous or discrete data into storable, composable, sliceable objects, leveraging matplotlib for visualization and IPython Notebook for ...
AllenDowney/ThinkBayes2
examples/changepoint.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...
atremblay/deep-learning
tv-script-generation/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 In this project, you'll generate your own Simpsons TV scrip...
IIPBC/Material
IntroPandas/Intro-Pandas-PBCII.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: Introduction to data manipulation and analysis with Pandas The objective of this notebook is to make a brief overview of the pandas module for data analysis and manipulation. To present the different pandas tools,w e use as an exam...
jseabold/statsmodels
examples/notebooks/stationarity_detrending_adf_kpss.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm """ Explanation: Stationarity and detrending (ADF/KPSS) Stationarity means that the statistical properties of a time series i.e. mean, variance and covariance do not change over time. Many statistical...
ucsd-ccbb/jupyter-genomics
notebooks/networkAnalysis/network_viz_interactive_widget/network_viz_interactive_widget.ipynb
mit
import numpy as np from pandas import * import networkx as nx import matplotlib.pyplot as plt % matplotlib inline """ Explanation: This notebook will create an interactive widget to illustrate network interconnections End of explanation """ # set file name and directory: network format from GeneMania file...
kinverarity1/lasio
notebooks/set logging level for lasio.ipynb
mit
import logging import lasio """ Explanation: lasio uses the logging module to log warnings and other information when manipulating LAS files. End of explanation """ l = lasio.read("../tests/examples/sample.las") """ Explanation: Sometimes you may want more or less information shown to you when you are reading LAS f...
AllenDowney/ThinkBayes2
examples/blaster_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 math import numpy as np from thinkbayes2 import Hist, Pmf, Suite, Beta import thinkplot """ Expl...
arborh/tensorflow
tensorflow/lite/g3doc/performance/post_training_quant.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...
fugufisch/hu_bp_python_course
05_dataio_matplotlib/dataio_matplotlib_exercise.ipynb
mit
import cPickle as pickle with open('GPD1_seq.fasta', 'r') as f: lines = f.readlines() a = 0 t = 0 g = 0 c = 0 for line in lines: if line.startswith('>'): continue else: a = a + line.count('A') t = t + line.count('T') g = g + line.count('G') c = c + line.count('...
JAmarel/Phys202
Fitting/.ipynb_checkpoints/FittingModelsEx02-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Fitting Models Exercise 2 Imports End of explanation """ data = np.load('decay_osc.npz') tdata = data['tdata'] ydata = data['ydata'] dy = data['dy'] plt.figure(figsize=(8,6)) plt.plot(tdata, ydata) ...
MartyWeissman/Python-for-number-theory
PwNT Notebook 5.ipynb
gpl-3.0
23 % 5 # What is the remainder after dividing 23 by 5? What is the natural representative of 23 modulo 5? """ Explanation: Part 5: Modular arithmetic and primality testing Python, like most programming languages, comes with a "mod operation" % to compute remainders. This makes basic modular arithmetic straightforw...
quantumlib/Cirq
docs/tutorials/azure-quantum/getting_started_honeywell.ipynb
apache-2.0
!pip install azure-quantum[cirq] --quiet """ Explanation: Getting started with Honeywell and Cirq on Azure Quantum <table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href="https://quantumai.google/cirq/tutorials/azure-quantum/getting_started_honeywell"><img src="https://quantumai.google/si...
ledeprogram/algorithms
class3/homework/born_mathias_2_2.ipynb
gpl-3.0
import random """ Explanation: Assignment 2 Implement the search algorithm you came up with in pseudocode with Python Test the search algorithm with a list of 10,100,1000 random numbers (sorted with your sorting algorithm) and compare the result using the %time to time your code and submit your results in code commen...
Cyb3rWard0g/ThreatHunter-Playbook
docs/notebooks/windows/08_lateral_movement/WIN-201009173318.ipynb
gpl-3.0
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Remote WMI Wbemcomn DLL Hijack Metadata | | | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2020/10/09 | | modification date | 2020/10/09 | | playbook related | ['WI...
asweigart/pyautogui
docs/simplified-chinese.ipynb
bsd-3-clause
import pyperclip import pyautogui # PyAutoGUI中文输入需要用粘贴实现 # Python 2版本的pyperclip提供中文复制 def paste(foo): pyperclip.copy(foo) pyautogui.hotkey('ctrl', 'v') foo = u'学而时习之' # 移动到文本框 pyautogui.click(130,30) paste(foo) """ Explanation: PyAutoGUI——让所有GUI都自动化 本教程译自大神Al Sweigart的PyAutoGUI项目,Python自动化工具,更适合处理GUI任务,网页...
ekwan/PyQuiver
scripts/pyquiver.ipynb
apache-2.0
# import the necessary package elements import numpy as np import sys sys.path.append("../src") from kie import KIE_Calculation """ Explanation: PyQuiver This is an IPython Notebook interface for the PyQuiver package. The code below will guide you through using PyQuiver through a native Python interface. The same step...
lichao890427/lichao890427.github.io
jupyter/machine_learning_1.ipynb
mit
# coding: utf-8 from sklearn import datasets import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model import Perceptron from sklearn.metrics import accuracy_score iris = datasets.load_iris() # 加载鸢尾花数据库 X = iris.data[:, [2, 3]] # 选...
Kreiswolke/gensim
docs/notebooks/online_w2v_tutorial.ipynb
lgpl-2.1
from gensim.corpora.wikicorpus import WikiCorpus from gensim.models.word2vec import Word2Vec, LineSentence from pprint import pprint from copy import deepcopy from multiprocessing import cpu_count """ Explanation: Online word2vec tutorial So far, word2vec cannot increase the size of vocabulary after initial training. ...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/07-BONUS-NOTEBOOKS-NO-VIDEOS/Working with Stopwords.ipynb
apache-2.0
import spacy nlp = spacy.load('en_core_web_sm') stopwords = nlp.Defaults.stop_words len(stopwords) type(stopwords) print(sorted(list(stopwords))) """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Working with Stop Words In the previous sections we've seen how to acces...
alasdairtran/mclearn
projects/weiyen/notebooks/knfst.ipynb
bsd-3-clause
def nullspace(A, eps=1e-12): u, s, vh = svd(A) null_mask = (s <= eps) null_space = sp.compress(null_mask, vh, axis=0) return sp.transpose(null_space) """ Explanation: Kernel Null Foley-Sammon Transform for Novelty Detection The following function calculates the basis for the nullspace of a given matrix...
feststelltaste/software-analytics
notebooks/Structural Test Case Similarity.ipynb
gpl-3.0
import pandas as pd invocations = pd.read_csv("datasets/test_code_invocations.csv", sep=";") invocations.head() """ Explanation: Introduction In big and old legacy systems, tests are often a mess. Especially end-to-end-tests with UI testing frameworks like Selenium quickly become a PITA aka unmaintainable. They are r...
hparik11/Deep-Learning-Nanodegree-Foundation-Repository
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...
mne-tools/mne-tools.github.io
0.23/_downloads/c129e399417e02679103f64ce31da37e/mne_inverse_envelope_correlation.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # Sheraz Khan <sheraz@khansheraz.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.connectivity import envelope_correlation from mn...
tleonhardt/CodingPlayground
python/networkx/2 using Networkx to Explore Pathfinding Specific Graphs.ipynb
mit
#image below using <img src="files/wgraph5.png"> """ Explanation: 2 Using Networkx to Explore Pathfinding Specific graphs Drawing and creating the graph in networkX Setup of simple examples using NetworkX - take an example and create networkx graph - steps involved - running dijkstra and A* on the graph End of expla...
owlas/magpy
docs/source/notebooks/.archive/magpy-equilibrium-tests-combine0.ipynb
bsd-3-clause
# dipole interaction energy def dd(t1, t2, nu): return -nu*(3*np.cos(t1)*np.cos(t2) - np.cos(t1-t2)) # anisotropy energy def anis(t1, t2, sigma): return -sigma*(np.cos(t1)**2 + np.cos(t2)**2) # total energy def tot(t1, t2, nu, sigma): return dd(t1, t2, nu) + anis(t1, t2, sigma) # numerator of the Boltzma...
smorton2/think-stats
code/chap10soln.ipynb
gpl-3.0
from __future__ import print_function, division %matplotlib inline import numpy as np import random import thinkstats2 import thinkplot """ Explanation: Examples and Exercises from Think Stats, 2nd Edition http://thinkstats2.com Copyright 2016 Allen B. Downey MIT License: https://opensource.org/licenses/MIT End of...
whitead/numerical_stats
unit_5/hw_2019/Homework_5_key.ipynb
gpl-3.0
import matplotlib.pyplot as plt import numpy as np #set parameter p = 0.2 x=[] #days y=[] #probanilities #init sum for expetation #for loop over sample space for i in range(1, 32): # P(i) * i x.append(i) y.append((1 - p)**(i - 1) * p) print(x,y) plt.plot(x,y, 'o') plt.xlabel('Days') plt.ylabel('Probabil...
SciTools/courses
course_content/iris_course/2.Loading_and_Saving.ipynb
gpl-3.0
import iris """ Explanation: Iris introduction course 2. Loading and Saving Learning Outcome: by the end of this section, you will be able to use Iris to load datasets from disk as Iris cubes and save Iris cubes back to disk. Duration: 30 minutes. Overview:<br> 2.1 Iris Load Functions<br> 2.2 Saving Cubes<br> 2.3 Exer...
Eric89GXL/vispy
examples/ipynb/colormaps.ipynb
bsd-3-clause
import numpy as np from vispy.color import (get_colormap, get_colormaps, Colormap) from IPython.display import display_html for cmap in get_colormaps(): display_html('<h3>%s</h3>' % cmap, raw=True) display_html(get_colormap(cmap)) """ Explanation: VisPy colormaps This notebook illustrates the colormap API pro...
sbenthall/bigbang
examples/experimental_notebooks/MultiGitRepos.ipynb
agpl-3.0
org_name = "glass-bead-labs" repo = repo_loader.get_org_multirepo(org_name) full_info = repo.commit_data handled = pd.DataFrame(full_info.groupby(["Repo Name", "Committer Name"]).size()) repo_size_df = pd.DataFrame(full_info.groupby("Repo Name").size()) author_commits_df = pd.DataFrame(full_info.groupby("Committer Nam...
samirma/deep-learning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 %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 ridersh...
CompPhysics/MachineLearning
doc/Programs/ProjectsData/project_solution.ipynb
cc0-1.0
import numpy as np # we'll be using this shorthand for the NumPy library throughout dataset = np.load("../data/images/project_data.npy") n_samples = dataset.shape[0] print("Data shape: ", dataset.shape) """ Explanation: Image classification of simulated AT-TPC events Welcome to this project in applied machine learni...
lcharleux/numerical_analysis
doc/Traitement_signal/signal_processing.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt def signal(t, f = 1.): return np.cos(2. * np.pi * f * t) D = 3.2 # duration t = np.linspace(0., D, 1000) x = signal(t) fs = 10. # sampling rate tn = np.linspace(0., D, fs * D) xn = signal(tn) plt.plot(t, x, "k-", label = "Analog") plt.plot(tn, xn, "bo--", l...
rebeccabilbro/viz
bokeh/gapminder.ipynb
mit
import numpy as np import pandas as pd from bokeh.embed import file_html from bokeh.io import output_notebook, show from bokeh.layouts import layout from bokeh.models import ( ColumnDataSource, Plot, Circle, Range1d, LinearAxis, HoverTool, Text, SingleIntervalTicker, Slider, CustomJS) from bokeh.palettes impo...
ueapy/ueapy.github.io
content/notebooks/2016-02-05-ipywidgets-interact.ipynb
mit
import warnings warnings.filterwarnings('ignore') """ Explanation: Today's meeting opened the topic of building interactive figures in Python. This notebook will show an example of using ipywidgets module, more specifically interact() function. The full documentation can be found on the ipywidgets website, but beware:...
DillmannFrench/Intro-PYTHON
Cours03_DILLMANN_ISEP2016.ipynb
gpl-3.0
print(type(42)) """ Explanation: 1 Variables 1.1 Qu'est ce qu'une Variable ? 1.1.1 Contenu Le contenu d'une variable est une valeur. Il s'agit forcément d'une instance d'un objet , stockée en mémoire. Celle-ci est donc reliée à une classe. Le type de l'instance est le nom de la classe. End of explanation """ pi=3.14...
Aggieyixin/cjc2016
code/05.PythonCrawler_tianya_threads.ipynb
mit
import urllib2 from bs4 import BeautifulSoup """ Explanation: 数据抓取: 使用Python编写网络爬虫 王成军 wangchengjun@nju.edu.cn 计算传播网 http://computational-communication.com 需要解决的问题 页面解析 获取Javascript隐藏源数据 自动翻页 自动登录 连接API接口 End of explanation """ from IPython.display import display_html, HTML HTML('<iframe src=http://bbs.tianya.cn...
tbarrongh/cosc-learning-labs
src/notebook/03_interface_configuration_update.ipynb
apache-2.0
help('learning_lab.03_interface_configuration_update') """ Explanation: COSC Learning Lab 03_interface_configuration_update.py Related Scripts: * 03_interface_configuration.py * 03_interface_names.py * 03_interface_properties.py Table of Contents Table of Contents Documentation Implementation Execution HTTP Document...
arasdar/DL
uri-dl/uri-dl-hw-2/assignment2/TensorFlow.ipynb
unlicense
import tensorflow as tf import numpy as np import math import timeit import matplotlib.pyplot as plt %matplotlib inline from cs231n.data_utils import load_CIFAR10 def get_CIFAR10_data(num_training=49000, num_validation=1000, num_test=10000): """ Load the CIFAR-10 dataset from disk and perform preprocessing to...
AtmaMani/pyChakras
udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Matrix Plots.ipynb
mit
import seaborn as sns %matplotlib inline flights = sns.load_dataset('flights') tips = sns.load_dataset('tips') tips.head() flights.head() """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Matrix Plots Matrix plots allow you to plot data as color-encoded matrices and...
hypergravity/cham_hates_python
notebook/cham_hates_python_06_astronomical_data.ipynb
mit
%pylab inline from astropy.io import fits # read hdu list hl = fits.open('./data/lamost_dr2_spectra/spec-55892-F9205_sp09-174.fits') # show fits info print hl.info() # read HDU header hl[0].header # read HDU data hl[0].data # transform data to WVS coordinates naxis1 = hl[0].header['NAXIS1'] crval1 = hl[0].header['...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/discrete_choice_example.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.api as sm from scipy import stats from statsmodels.formula.api import logit print(sm.datasets.fair.SOURCE) print(sm.datasets.fair.NOTE) dta = sm.datasets.fair.load_pandas().data dta["affair"] = (dta["affair...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_sensors_time_frequency.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet, psd_multitaper from mne.datasets import somato """ Explanation: Frequency and time-frequency sensors analysis The objective is to show you how to explore the spectral content of your data (frequency and time-frequ...
ffpenaloza/AstroExp
tarea2-1/.ipynb_checkpoints/Tarea 2.1-checkpoint.ipynb
gpl-3.0
import kplr import matplotlib.pyplot as plt import numpy as np %matplotlib inline client = kplr.API() star1 = client.star(2305930) curva1 = star1.get_light_curves(short_cadence=False) time1, flux1, ferr1, quality1 = [], [], [], [] for lc in curva1: with lc.open() as f: hdu_data = f[1].data times...
muatik/dm
SingularValueDecomposition.ipynb
mit
A = np.mat([ [4, 5, 4, 1, 1], [5, 3, 5, 0, 0], [0, 1, 0, 1, 1], [0, 0, 0, 0, 1], [1, 0, 0, 4, 5], [0, 1, 0, 5, 4], ]) U, S, V = np.linalg.svd(A) U.shape, S.shape, V.shape """ Explanation: SVD is one of the matrix factorization tecniques. It factors a matrix into three parts with which we can r...
EmuKit/emukit
notebooks/Emukit-tutorial-how-to-write-a-notebook.ipynb
apache-2.0
# General imports and parameters of figures should be loaded at the beginning of the overview ### General imports %matplotlib inline import numpy as np import matplotlib.pyplot as plt from matplotlib import colors as mcolors ### --- Figure config colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS) LEGEND_SIZE =...
tensorflow/docs-l10n
site/ja/tutorials/generative/cyclegan.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
philippgrafendorfe/stackedautoencoders
IONOSPHERE_Autoencoder.ipynb
mit
# data = np.genfromtxt("data/ionosphere.data") data = pd.read_csv('data/ionosphere.data', sep=",", header=None) data.head() data.describe() """ Explanation: Data Set Information This radar data was collected by a system in Goose Bay, Labrador. This system consists of a phased array of 16 high-frequency antennas with...
jrg365/gpytorch
examples/02_Scalable_Exact_GPs/SGPR_Regression_CUDA.ipynb
mit
import math import torch import gpytorch from matplotlib import pyplot as plt # Make plots inline %matplotlib inline """ Explanation: Sparse Gaussian Process Regression (SGPR) Overview In this notebook, we'll overview how to use SGPR in which the inducing point locations are learned. End of explanation """ import u...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-hm/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-hm', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-HM Sub-Topics: Radiative Forcings. Propert...
tanghaibao/goatools
notebooks/semantic_similarity.ipynb
bsd-2-clause
%load_ext autoreload %autoreload 2 from goatools.obo_parser import GODag godag = GODag("go-basic.obo") go_id3 = 'GO:0048364' go_id4 = 'GO:0032501' print(godag[go_id3]) print(godag[go_id4]) """ Explanation: Computing basic semantic similarities between GO terms Adapted from book chapter written by Alex Warwick Vesztr...
mne-tools/mne-tools.github.io
0.22/_downloads/d9e2f27df3a137317d331d3be6f3814d/plot_dics_source_power.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # Roman Goj <roman.goj@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import os.path as op import numpy as np import mne from mne.datasets import somato from...
jdossgollin/CWC_ANN
Week02/01-GettingStartedSequentialModel.ipynb
mit
from keras.models import Sequential # sequential model from keras.layers import Dense, Activation # layers import numpy as np """ Explanation: Keras Sequential Model Today we're going to look at Keras, which is a high-level language for building neural networks in TensorFlow (or other languages -- but we'll focus on T...
GoogleCloudPlatform/vertex-ai-samples
notebooks/official/migration/UJ4 Vertex SDK AutoML Tabular Binary Classification.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex AI: Vertex AI Migration: AutoML Tabular Binary Classification <table align="left"> <td...
4dsolutions/Python5
DinoDataLab.ipynb
mit
dinos.assign(Decimal = dinos.sha256.apply(lambda x: int(x, base=16))) """ Explanation: LAB Add a column to dinos that contains the decimal equivalent of the sha256 hash. Hint. End of explanation """ dinos.sort_values(by='sha256').head(10) """ Explanation: LAB Sort dinos by the column sha256 -- this will be an alph...
KirstieJane/BrainsForPublication
notebooks/show_glass_brain.ipynb
mit
%matplotlib inline """ Explanation: Visualize Glass Brain End of explanation """ stats_file = '../test_data/ALL_N95_Mean_cope2_thresh_zstat1.nii.gz' view = 'ortho' colormap = 'RdBu_r' threshold = '2.3' black_bg """ Explanation: 1. Upload all statistical maps into the data folder The data folder can be found in the...
ethen8181/machine-learning
python/cython/cython.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', '..', 'notebook_format')) from formats import load_style load_style(plot_style = False) os.chdir(path) # 1. magic to print version # 2. magic so that th...
dewitt-li/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...
guyrt/teaching
2017/Com597I/visualization/VisualizationNotebook_workedinclass.ipynb
mit
# This section imports some important libraries that we'll need. # the most important is the second line. After you run this, "plt" will be # the plotting library in python. import numpy import matplotlib.pyplot as plt %pylab inline """ Explanation: Welcome to the Python Plotting Tutorial for Com597I! This is intend...
CPernet/LanguageDecision
notebooks/exploratory/2017-06-11-ddm-pilot-data.ipynb
gpl-3.0
def parse_condition(stim_num): if stim_num == '1': return 'SS' if stim_num == '2': return 'CP' if stim_num == '3': return 'CS' if stim_num == '4': return 'US' import csv import glob csv_dir = '../data/pilot_subjects/' subjects = [] for csv_file in glob.glob(csv_dir +...
hetaodie/hetaodie.github.io
assets/media/uda-ml/deep/shensd/keras录取学生/StudentAdmissionsKeras-zh.ipynb
mit
# Importing pandas and numpy import pandas as pd import numpy as np # Reading the csv file into a pandas DataFrame data = pd.read_csv('student_data.csv') # Printing out the first 10 rows of our data data[:10] """ Explanation: 利用神经网络的 Kera 预测学生录取情况 在该 notebook 中,我们基于以下三条数据预测了加州大学洛杉矶分校的研究生录取情况: GRE 分数(测试)即 GRE Score...
nellore/omfgene
omfgene_submit.ipynb
mit
import sevenbridges as sbg from sevenbridges.errors import SbgError from sevenbridges.http.error_handlers import * import re import datetime import binpacking print("SBG library imported.") print sbg.__version__ """ Explanation: Scattering and SBG-FS file stream read notebook This notebook explores setting up tasks fo...
computational-class/cjc2016
code/09.01-machine-learning-with-sklearn.ipynb
mit
import seaborn as sns sns.set_context("talk", font_scale=1.5) iris = sns.load_dataset('iris') iris.head() """ Explanation: Introducing Scikit-Learn for Machine Learning <!--BOOK_INFORMATION--> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitH...
pyreaclib/pyreaclib
pynucastro/library/tabular/use_tabulated_rate.ipynb
bsd-3-clause
import pynucastro as pyrl """ Explanation: Tabulated weak nuclear reaction rates The reaction rate parameterizations in pynucastro/library/tabular were obtained from: Toshio Suzuki, Hiroshi Toki and Ken'ichi Nomoto (2016): ELECTRON-CAPTURE AND beta-DECAY RATES FOR sd-SHELL NUCLEI IN STELLAR ENVIRONMENTS RELEVANT TO HI...
eegkno/mltoolbox.tutorial
0.1/binary_classification.ipynb
bsd-3-clause
# Load the iris dataset and randomly permute it from sklearn import datasets from sklearn.ensemble import RandomForestClassifier from sklearn.svm import SVC from sklearn.model_selection import StratifiedKFold from mltoolbox.model_selection.classification import MultiClassifier """ Explanation: Binary Classification L...
terrai/rastercube
doc/notebooks/load_ndvi_glcf.ipynb
mit
import pylab as pl import numpy as np import matplotlib.cm as cm import terrapy import rastercube.jgrid as jgrid import rastercube.jgrid.utils as jgrid_utils import rastercube.regions as regions import rastercube.datasources.glcf as terra_glcf %matplotlib inline np.set_printoptions(precision=5, suppress=True) glcf_he...
yannikbehr/spectroscopy
examples/datamodel.ipynb
gpl-3.0
from IPython.display import Image Image(filename='../docs/_images/datamodel_simple.png') """ Explanation: General structure of the datamodel End of explanation """ d = Dataset.open('../tests/data/minidoas_test.h5') # Get the first PreferredFlux element pf = d.elements['PreferredFlux'][0] pf # Show the values of th...
fagonzalezo/is-2017-1
assign3.ipynb
mit
class Directions: NORTH = 'North' SOUTH = 'South' EAST = 'East' WEST = 'West' STOP = 'Stop' """ Explanation: Intelligent Systems Assignment 3 Bayes' net inference Names: IDs: End of explanation """ def P_1(eps, E_N, E_S): ''' Calculates: P(X=x|E_{N}=e_{N},E_{S}=e_{S}) Arguments: E_N, ...
XinyiGong/pymks
notebooks/elasticity_2D_Multiphase.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt n = 21 n_phases = 3 from pymks.tools import draw_microstructures from pymks.datasets import make_delta_microstructures X_delta = make_delta_microstructures(n_phases=n_phases, size=(n, n)) """ Explanation: Line...
hasadna/knesset-data-pipelines
jupyter-notebooks/running the pipelines - getting fresh committee data.ipynb
mit
import os os.chdir('..') os.getcwd() """ Explanation: Running pipelines The pipelines are run on the server periodically and based on pipeline and data dependencies. You can also run specific pipelines manually for development or to run custom pipelines. Change directory to project root The Jupyter notebooks run in ...
Atomahawk/flagging-suspicious-blockchain-transactions
lab_notebooks/blockchain-preprocessing.ipynb
mit
import errno import os import shutil import zipfile import numpy as np import pandas as pd # In[22]: # TARGETDIR = '../btc/graphs_njp.zip' # In[23]: # with open(doc, "rb") as zipsrc: # zfile = zipfile.ZipFile(zipsrc) # for member in zfile.infolist(): # target_path = os.path.join(TARGETDIR, member.f...
sangheestyle/ml2015project
howto/model05_Au_Aq_RMSE_linear_model_and_DictVectorizer.ipynb
mit
import gzip import cPickle as pickle with gzip.open("../data/train.pklz", "rb") as train_file: train_set = pickle.load(train_file) with gzip.open("../data/test.pklz", "rb") as test_file: test_set = pickle.load(test_file) with gzip.open("../data/questions.pklz", "rb") as questions_file: questions = pickle...
calroc/joypy
docs/Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators.ipynb
gpl-3.0
def hylomorphism(c, F, P, G): '''Return a hylomorphism function H.''' def H(a): if P(a): result = c else: b, aa = G(a) result = F(b, H(aa)) return result return H """ Explanation: Cf. "Bananas, Lenses, & Barbed Wire" Hylomorphism A hylomorphism ...
DLTK/DLTK
examples/tutorials/03_building_a_model_fn.ipynb
apache-2.0
import SimpleITK as sitk import tensorflow as tf import os from dltk.io.augmentation import * from dltk.io.preprocessing import * tf.logging.set_verbosity(tf.logging.ERROR) os.environ['CUDA_VISIBLE_DEVICES'] = '0' # Generate a simple toy dataset im_width = 256 im_height = 256 num_imgs = 200 def create_test_image(w...
rgarcia-herrera/sistemas-dinamicos
Glass_Pasternack.ipynb
gpl-3.0
def g(x, alpha, beta): assert alpha >= 0 and beta >= 0 return (alpha*x)/(1 + (beta * x)) def plot_cobg(x, alpha, beta): y = np.linspace(x[0],x[1],300) g_y = g(y, alpha, beta) cobweb(lambda x: g(x, alpha, beta), y, g_y) # configura gráfica interactiva interact(plot_cobg, x=widgets.FloatR...
hetland/python4geosciences
materials/ST_shapefiles.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import cartopy import cartopy.io.shapereader as shpreader import shapely.geometry """ Explanation: Shapefiles on maps End of explanation """ # how we tell cartopy which data we want, from the list at the end of the maps notebook shapename = 'adm...
4dsolutions/Python5
Clock Arithmetic.ipynb
mit
(5 + 5) % 10 # no remainder divmod(10, 5) # 5 goes into 10 twice, no remainder 19 % 10 # divide by 10, give the remainder """ Explanation: Oregon Curriculum Network <br /> Discovering Math with Python Chapter 4: CLOCK ARITHMETIC Calling modulo arithmetic "clock arithmetic" is a way of calling attention to the finite...
wiheto/sentiment-timelines
notebooks/league_1_watford.ipynb
mit
import praw import datetime import pandas as pd import nltk.sentiment.vader import matplotlib.pyplot as plt # Import all relevant packages from bs4 import BeautifulSoup from selenium import webdriver import numpy as np import os """ Explanation: Sentiment analysis of match thread To run this yourself. Two things have ...
himkt/notebooks
Hidden Markov Models.ipynb
mit
A = zeros((3, 3)) A[0, 0] = 0.4 A[0, 1] = 0.3 A[0, 2] = 0.3 A[1, 0] = 0.2 A[1, 1] = 0.6 A[1, 2] = 0.2 A[2, 0] = 0.1 A[2, 1] = 0.1 A[2, 2] = 0.8 # this is not probability (observed) pi = [1, 1, 1] print(A) """ Explanation: A tutorial on hidden Markov models and selected applications in speech recognition. Rabiner, ...
bassio/omicexperiment
omicexperiment/docs/03_experiment_transforms.ipynb
bsd-3-clause
%load_ext autoreload %autoreload 2 #Load our data from omicexperiment.experiment.microbiome import MicrobiomeExperiment mapping = "example_map.tsv" biom = "example_fungal.biom" tax = "blast_tax_assignments.txt" exp = MicrobiomeExperiment(biom, mapping,tax) exp.data_df exp.mapping_df """ Explanation: Experiment tr...
avicennax/jedi
notebooks/DFORCE.ipynb
mit
import pylab as plt import numpy as np %matplotlib inline from __future__ import division from scipy.integrate import odeint,ode from numpy import zeros,ones,eye,tanh,dot,outer,sqrt,linspace,cos,pi,hstack,zeros_like,abs,repeat from numpy.random import uniform,normal,choice %config InlineBackend.figure_format = 'retina'...
csaladenes/csaladenes.github.io
test/eis-metadata-validation/Planon metadata validation4-Copy2.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: EIS metadata validation script Used to validate Planon output with spreadsheet input 1. Data import End of explanation """ planon=pd.read_excel('EIS Assets.xlsx',index_col = 'Code') master_loggerscontrollers = ...
mit-eicu/eicu-code
notebooks/infusiondrug.ipynb
mit
# Import libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt import psycopg2 import getpass import pdvega # for configuring connection from configobj import ConfigObj import os %matplotlib inline # Create a database connection using settings from config file config='../db/config.ini' #...
HazyResearch/snorkel
tutorials/snark/Snark Tutorial.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 import os # Remember to specify the SNORKELDB environment variable (with an absolute path if using the file system) os.environ['SNORKELDB'] = 'sqlite:///' + os.getcwd() + os.sep + '../cdr/snorkel.db' from snorkel import SnorkelSession snorkel_session = SnorkelSession() """ Explan...
aleph314/K2
Foundations/Math/2-derivatives_and_integrals.ipynb
gpl-3.0
import numpy as np import sympy import matplotlib.pyplot as plt %matplotlib inline def gradient_descent(func, var, initial_value, lamb = 1e-3, eps = 1e-6): ''' Calculates gradient descent for the function func in the variable var starting from initial_value with a step of lamb. Stops if the difference in t...
PYPIT/COS_REDUX
docs/nb/Redux_Example.ipynb
bsd-2-clause
# imports import os import glob import pdb #from imp import reload #from importlib import reload from astropy.io import fits from cosredux import utils as cr_utils from cosredux import trace as cr_trace from cosredux import darks as cr_darks from cosredux import io as cr_io from cosredux import science as cr_science ...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_artifacts_correction_ica.ipynb
bsd-3-clause
import numpy as np import mne from mne.datasets import sample from mne.preprocessing import ICA from mne.preprocessing import create_eog_epochs, create_ecg_epochs # getting some data ready data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif' raw = mne.io.read_raw_fif(...
4dsolutions/Python5
Dot Product.ipynb
mit
import numpy as np one_dimensional = np.array([1,1,1,2,3,3,3,3,3]) one_dimensional one_dimensional.shape # not yet rows & columns one_dimensional.reshape((9,-1)) # let numpy figure out how many columns one_dimensional # still the same one_dimensional.ndim two_dimensional = one_dimensional.reshape(1,9) # recyc...
cosmicBboy/cosmicBboy.github.io
notebooks/quest-for-an-offensiveness-detector-part-1.ipynb
gpl-2.0
import numpy as np import matplotlib import matplotlib.pyplot as plt import pandas as pd import re from os import path from scipy.ndimage import imread from nltk.util import ngrams from collections import Counter from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator from IPython.display import display, HTML ...
psychemedia/ou-robotics-vrep
robotVM/notebooks/Demo - Square 2 - Variables.ipynb
apache-2.0
# Create the message variable and assign the value "Hello World" to it message="Hello World" # Use the variable in a print statement # The print statement retrieves the value assigned to the variable and displays the value print(message) """ Explanation: Traverse a Square - Part 2 - Variables In this notebook, we wil...
jsrois/uoc-summer16
experiments/1.visualize-rf.ipynb
mit
# set up Python environment: numpy for numerical routines, and matplotlib for plotting import numpy as np import matplotlib.pyplot as plt # display plots in this notebook %matplotlib inline # set display defaults plt.rcParams['figure.figsize'] = (5,5) # large images plt.rcParams['image.interpolation'] = 'neares...
walkon302/CDIPS_Recommender
notebooks/07282017_todo_CDIPS.ipynb
apache-2.0
import pandas as pd import numpy as np import os from sklearn.manifold import TSNE from sklearn.decomposition import PCA os.chdir('/Users/Walkon302/Desktop/deep-learning-models-master/view2buy') # Read the preprocessed file, containing the user profile and item features from view2buy folder df = pd.read_pickle('user_...
tensorflow/docs-l10n
site/en-snapshot/lite/models/modify/model_maker/audio_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...
eneskemalergin/Data_Structures_and_Algorithms
Chapter5/5-Searching_and_Sorting.ipynb
gpl-3.0
theArray = range(0,100) key = 101 if key in theArray: print("The key is in the array.") else: print("The key is not in the array.") """ Explanation: Searching and Sorting Searching Process of selecting information from a collection based on specific criteria. Linear Search Simplest approach to searching probl...
hethapu/big-data-python-class
Lectures/Lecture2-Jupyter_and_python/Lecture-2-Introduction-to-Python-Programming 2017.ipynb
mit
ls ..\..\Scripts\hello-world*.py """ Explanation: Introduction to Python programming This crash course on python is take from two souces: http://github.com/jrjohansson/scientific-python-lectures. and Chapter 2 of the Datascience from scratch: First principles with python Python program files Python code is usually s...
Kelvinrr/test_notebook
Black Box Tutorial.ipynb
unlicense
import os import sys import argparse import yaml import networkx as nx sys.path.insert(0, os.path.abspath('..')) from autocnet.examples import get_path from autocnet.graph.network import CandidateGraph from autocnet.fileio.io_controlnetwork import to_isis, write_filelist from IPython.display import display %pylab inl...