repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
mne-tools/mne-tools.github.io
0.13/_downloads/plot_point_spread.ipynb
bsd-3-clause
import os.path as op import numpy as np import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.simulation import simulate_stc, simulate_evoked """ Explanation: Corrupt known signal with point spread The aim of this tutorial is to demonstrate how to put ...
ebmdatalab/openprescribing
notebooks/measure-calculations.ipynb
mit
import pandas as pd import requests """ Explanation: Measure calculations This notebook describes how we perform measure calculations. A measure is the compuation of a ratio between two values (a numerator and a denominator). For instance: The proportion of prescribing (either items or quantity) for a chemical that i...
mne-tools/mne-tools.github.io
dev/_downloads/b36af73820a7a52a4df3c42b66aef8a5/source_power_spectrum_opm.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import os.path as op from mne.filter import next_fast_len import mne print(__doc__) data_path = mne.datasets.opm.data_path() subject = 'OPM_sam...
AbnerZheng/Titanic_Kaggle
scikit-learn/03_getting_started_with_iris.ipynb
mit
from IPython.display import HTML HTML('<iframe src=http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data width=300 height=200></iframe>') """ Explanation: Getting started in scikit-learn with the famous iris dataset From the video series: Introduction to machine learning with scikit-learn Agenda Wha...
rnder/data-science-from-scratch
notebook/ch16_logistic_regression.ipynb
unlicense
from collections import Counter from functools import partial, reduce from linear_algebra import dot, vector_add from gradient_descent import maximize_stochastic, maximize_batch from working_with_data import rescale from machine_learning import train_test_split from multiple_regression import estimate_beta, predict im...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/bnu-esm-1-1/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'bnu-esm-1-1', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: BNU Source ID: BNU-ESM-1-1 Sub-Topics: Radiative Forcings. Properties: 85 (4...
KitwareMedical/TubeTK
docs/examples/MergeAdjacentImages/MergeAdjacentImages.ipynb
apache-2.0
import os import sys import numpy # Path for TubeTK libs #Values takend from TubeTK launcher sys.path.append("C:/src/TubeTK_Python_ITK/TubeTK-build/lib/") sys.path.append("C:/src/TubeTK_Python_ITK/TubeTK-build/lib/Release") # Setting TubeTK Build Directory TubeTK_BUILD_DIR=None if 'TubeTK_BUILD_DIR' in os.environ:...
dsacademybr/PythonFundamentos
Cap10/Notebooks/DSA-Python-Cap10-Mini-Projeto3.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()) # Instala o TensorFlow !pip install -q tensorflow==2.5 # Instala o Pydot !pip install -q pydot # Imports import numpy as np import pandas as pd import matplotlib.pyplot...
sdpython/ensae_teaching_cs
_doc/notebooks/2a/seance_5_prog_fonctionnelle.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 2A.i - programmation fonctionnelle Itérateur, générateur, programmation fonctionnelle, tout pour éviter de charger l'intégralité des données en mémoire et commencer les calculs le plus vite possible. End of explanation """ import pyensa...
Vincibean/machine-learning-with-tensorflow
advanced-mnist-with-tensorflow.ipynb
apache-2.0
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) """ Explanation: Advanced MNIST with TensorFlow Abstract Just like programming has "Hello World", machine learning has MNIST. MNIST is a simple computer vision dataset. It consists of images of hand...
tensorflow/agents
docs/tutorials/8_networks_tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
TomAugspurger/engarde
examples/Trains.ipynb
mit
import pandas as pd import engarde.decorators as ed pd.set_option('display.max_rows', 10) dtypes = dict( price1=int, price2=int, time1=int, time2=int, change1=int, change2=int, comfort1=int, comfort2=int ) @ed.is_shape((-1, 11)) @ed.has_dtypes(items=dtypes) def unload(): url = "ht...
aburgasser/splat
tutorials/spectral_database_query.ipynb
mit
# main splat import import splat import splat.database as spdb # other useful imports import astropy.units as u import copy import numpy as np import pandas import matplotlib.pyplot as plt # make sure this is at least 2021.07.22 splat.VERSION """ Explanation: SPLAT Tutorials: Database Query Tools Authors Adam Burgas...
Xero-Hige/Notebooks
Algoritmos I/2018-1C/clase-09-04.ipynb
gpl-3.0
Image(filename='./clase-09-04_images/i1.jpg') """ Explanation: La Magia de la television Capitulo 1: La television argentina es un template gigante Parte 0: Repaso general de secuencias | |Cadenas|Tuplas|Listas| |:---|:---|:---|:---| |Acceso por indice|Si|Si|Si| |Recorrer por indices|Si|Si|Si| |Recorrer por elemento|S...
marfeljoergsen/crypto-trading-scripts
testing/single_stock_example.ipynb
mit
import pyfolio as pf %matplotlib inline # silence warnings import warnings warnings.filterwarnings('ignore') """ Explanation: Single stock analysis example in pyfolio Here's a simple example where we produce a set of plots, called a tear sheet, for a single stock. Import pyfolio and matplotlib End of explanation """ ...
mnschmit/LMU-Syntax-nat-rlicher-Sprachen
04-notebook.ipynb
apache-2.0
grammar1 = """ S -> NP VP NP -> DET N DET -> "der" | "die" | "das" N -> "Mann" | "Frau" | "Buch" VP -> V NP NP V -> "gibt" | "schenkt" """ """ Explanation: Übungsblatt 4 Präsenzaufgaben Aufgabe 1 &nbsp;&nbsp;&nbsp; Eine erste (Phrasenstruktur-)Grammatik Werfen Sie einen Blick auf die folgende s...
tensorflow/docs-l10n
site/en-snapshot/lattice/tutorials/custom_estimators.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/zh-cn/addons/tutorials/optimizers_conditionalgradient.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 # 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 License is d...
SamLau95/nbinteract
docs/notebooks/tutorial/tutorial_interact.ipynb
bsd-3-clause
from ipywidgets import interact """ Explanation: A Simple Webpage In this section, you will create and publish a simple interactive webpage! In Jupyter, create a notebook and name it tutorial.ipynb. Type or paste in the code from this tutorial into the notebook. Using Interact The ipywidgets library provides the simpl...
rishuatgithub/MLPy
torch/PYTORCH_NOTEBOOKS/00-Crash-Course-Topics/01-Crash-Course-Pandas/04-Groupby.ipynb
apache-2.0
import pandas as pd # Create dataframe data = {'Company':['GOOG','GOOG','MSFT','MSFT','FB','FB'], 'Person':['Sam','Charlie','Amy','Vanessa','Carl','Sarah'], 'Sales':[200,120,340,124,243,350]} df = pd.DataFrame(data) df """ Explanation: <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_label_from_stc.ipynb
bsd-3-clause
# Author: Luke Bloy <luke.bloy@gmail.com> # Alex Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.datasets import sample print(__doc__) data_pa...
ellisztamas/faps
docs/tutorials/03_paternity_arrays.ipynb
mit
import faps as fp import numpy as np print("Created using FAPS version {}.".format(fp.__version__)) """ Explanation: Paternity arrays Tom Ellis, March 2017, updated June 2020 End of explanation """ np.random.seed(27) # this ensures you get exactly the same answers as I do. allele_freqs = np.random.uniform(0.3,0.5, 5...
google-research/google-research
graph_sampler/molecule_sampling_demo.ipynb
apache-2.0
# Install graph_sampler !git clone https://github.com/google-research/google-research.git !pip install google-research/graph_sampler from rdkit import Chem import rdkit.Chem.Draw from graph_sampler import molecule_sampler from graph_sampler import stoichiometry import numpy as np """ Explanation: <a href="https://col...
cliburn/sta-663-2017
notebook/00_Jupyter.ipynb
mit
%lsmagic %%file hello.txt Hello, world This is thing number 1 This is thing number 2 This is thing number 3 %cat hello.txt """ Explanation: Notes on using Jupyter Keyboard Shortcuts General See Help menu for list of keyboard shortcuts For Windows users, the Ctrl key is the equivalent of the Cmd key Cmd-Shift-P: Bri...
UWSEDS/LectureNotes
PreFall2018/07-Exceptions.ipynb
bsd-2-clause
X = [1, 2, 3 a = 4 y = 4*x + 3 def f(): return GARBAGE """ Explanation: When Things Go Wrong: Exceptions and Errors Today we'll cover perhaps one of the most important aspects of using Python: dealing with errors and bugs in code. Three Classes of Errors Types of bugs/errors in code, from the easiest to the most...
geoscixyz/computation
docs/case-studies/PF/TKC_Mag.ipynb
mit
## First we need to load all the libraries and set up the path ## for the input files. Same files as used by the online tutorial %matplotlib notebook import scipy as sp import numpy as np import time as tm import os import shutil import matplotlib.colors as colors import matplotlib.pyplot as plt from SimPEG import Mesh...
raschuetz/foundations-homework
05/.ipynb_checkpoints/Spotify-API-checkpoint.ipynb
mit
import requests response = requests.get('https://api.spotify.com/v1/search?query=artist:lil&type=artist&market=us&limit=50') data = response.json() artists = data['artists']['items'] for artist in artists: print(artist['name'], artist['popularity']) """ Explanation: 1) With "Lil Wayne" and "Lil Kim" there are ...
drphilmarshall/SpaceWarps
analysis/make_lens_catalog.ipynb
mit
import pandas as pd import swap base_collection_path = '/nfs/slac/g/ki/ki18/cpd/swap/pickles/15.09.02/' base_directory = '/nfs/slac/g/ki/ki18/cpd/swap_catalog_diagnostics/' annotated_catalog_path = base_directory + 'annotated_catalog.csv' cut_empty = True stages = [1, 2] categories = ['ID', 'ZooID', 'location', 'mea...
lwahedi/CurrentPresentation
talks/MDI5/Scraping+Lecture (5).ipynb
mit
import pandas as pd import numpy as np import pickle import statsmodels.api as sm from sklearn import cluster import matplotlib.pyplot as plt %matplotlib inline from bs4 import BeautifulSoup as bs import requests import time # from ggplot import * """ Explanation: Collecting and Using Data in Python Laila A. Wahedi, P...
zzsza/Datascience_School
15. 선형 회귀 분석/01. 회귀 분석용 가상 데이터 생성 방법.ipynb
mit
from sklearn.datasets import make_regression X, y, c = make_regression(n_samples=10, n_features=1, bias=0, noise=0, coef=True, random_state=0) print("X\n", X) print("y\n", y) print("c\n", c) plt.scatter(X, y, s=100) plt.show() """ Explanation: 회귀 분석용 가상 데이터 생성 방법 Scikit-learn 의 datasets 서브 패키지에는 회귀 분석 시험용 가상 데이터를 생성하...
carichte/pyasf
pyasf/examples/GeTe switching.ipynb
gpl-3.0
%matplotlib notebook import pylab as pl import pyasf import sympy as sp # symbolic computing from IPython.display import display, Math print_latex = lambda x: display(Math(sp.latex(x))) # sp.init_printing() ls GeTe = pyasf.unit_cell("ICSD_188458.cif") # initialize crystal structure object """ Explanation: Germanium...
rhiever/scipy_2015_sklearn_tutorial
notebooks/04.2 Model Complexity and GridSearchCV.ipynb
cc0-1.0
from figures import plot_kneighbors_regularization plot_kneighbors_regularization() """ Explanation: Parameter selection, Validation & Testing Most models have parameters that influence how complex a model they can learn. Remember using KNeighborsRegressor. If we change the number of neighbors we consider, we get a sm...
kabrapratik28/Stanford_courses
cs231n/assignment3/StyleTransfer-TensorFlow.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 from scipy.misc import imread, imresize import numpy as np from scipy.misc import imread import matplotlib.pyplot as plt # Helper functions to deal with image preprocessing from cs231n.image_utils import load_image, preprocess_image, deprocess_image %matplotlib inline def get_ses...
jrmontag/Data-Science-45min-Intros
concurrency/enriching_the_enricher.ipynb
unlicense
DT_FORMAT_STR = "%Y-%m-%dT%H:%M:%S.%f" def stream_of_tweets(n=10): # generator function to generate sequential tweets for i in range(n): time.sleep(0.01) tweet = { 'body':'I am tweet #' + str(i), 'postedTime':datetime.datetime.now().strftime(DT_FORMAT_STR) ...
nickkunz/smogn
examples/smogn_example_1_beg.ipynb
gpl-3.0
## suppress install output %%capture ## install pypi release # !pip install smogn ## install developer version !pip install git+https://github.com/nickkunz/smogn.git """ Explanation: SMOGN (0.1.0): Usage Example 1: Beginner Installation First, we install SMOGN from the Github repository. Alternatively, we could ins...
tata-antares/tagging_LHCb
Stefania_files/track-based-tagging-OS.ipynb
apache-2.0
import pandas import numpy from folding_group import FoldingGroupClassifier from rep.data import LabeledDataStorage from rep.report import ClassificationReport from rep.report.metrics import RocAuc from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import roc_curve, roc_auc_score from utils impo...
sarvex/PythonMachineLearning
Chapter 2/Support Vector Machines.ipynb
isc
from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split digits = load_digits() X_train, X_test, y_train, y_test = train_test_split(digits.data / 16., digits.target % 2, random_state=2) from sklearn.svm import LinearSVC, SVC linear_svc = LinearSVC(loss="hinge").fit(X_train, y_tra...
mspieg/principals-appmath
PCA_EOF_example.ipynb
cc0-1.0
%matplotlib inline import numpy as np import scipy.linalg as la import matplotlib.pyplot as plt import csv """ Explanation: <table> <tr align=left><td><img align=left src="./images/CC-BY.png"> <td>Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT...
kdestasio/online_brain_intensive
nipype_tutorial/notebooks/basic_workflow.ipynb
gpl-2.0
%pylab inline import nibabel as nb # Let's create a short helper function to plot 3D NIfTI images def plot_slice(fname): # Load the image img = nb.load(fname) data = img.get_data() # Cut in the middle of the brain cut = int(data.shape[-1]/2) + 10 # Plot the data imshow(np.rot90(data[...,...
cwhite1026/Py2PAC
examples/Creating_AngularCatalogs_and_ImageMasks.ipynb
bsd-3-clause
import AngularCatalog_class as ac import ImageMask_class as imclass from astropy.io import fits from astropy.io import ascii import numpy as np import numpy.random as rand import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10, 6) """ Explanation: Creating AngularCatalogs and ImageMa...
georgetown-analytics/yelp-classification
data_munging/.ipynb_checkpoints/filter_user_reviews-checkpoint.ipynb
mit
biguser = [] for obj in users.find({'review_count':{'$gt':500}}): biguser.append(obj['user_id']) """ Explanation: The business ID field has already been filtered for only restaurants We want to filter the users collection for the following: 1. User must have at least 20 reviews 2. For users with 20 review...
ShubhamDebnath/Coursera-Machine-Learning
Course 5/Emojify v2.ipynb
mit
import numpy as np from emo_utils import * import emoji import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? You...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/noresm2-lmec/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lmec', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: NCC Source ID: NORESM2-LMEC Topic: Landice Sub-Topics: Glaciers, Ice. Propert...
aburrell/davitpy
docs/notebook/maps.ipynb
gpl-3.0
%pylab inline from davitpy.pydarn.radar import * from davitpy.pydarn.plotting import * from davitpy.utils import * import datetime as dt """ Explanation: Mapping utilities and options This notebook illustrate how to map SuperDARN radars and FoVs End of explanation """ figure(figsize=(15,10)) # Plot map subplot(121)...
morganics/bayesianpy
examples/notebook/iris_anomaly_detection.ipynb
apache-2.0
%matplotlib notebook import pandas as pd import sys sys.path.append("../../../bayesianpy") import bayesianpy from bayesianpy.network import Builder as builder import logging import os import matplotlib.pyplot as plt from IPython.display import display logger = logging.getLogger() logger.addHandler(logging.StreamHan...
mangecoeur/pineapple
data/examples/python3.5/Execution.ipynb
gpl-3.0
def f(x): return 1.0 / x def g(x): return x - 1.0 f(g(1.0)) """ Explanation: Executing Code In this notebook we'll look at some of the issues surrounding executing code in the notebook. Backtraces When you interrupt a computation, or if an exception is raised but not caught, you will see a backtrace of what ...
GoogleCloudPlatform/mlops-on-gcp
immersion/kubeflow_pipelines/walkthrough/labs/lab-01_vertex.ipynb
apache-2.0
!pip freeze | grep google-cloud-aiplatform || pip install google-cloud-aiplatform import os import time from google.cloud import aiplatform from google.cloud import bigquery import pandas as pd from sklearn.compose import ColumnTransformer from sklearn.linear_model import SGDClassifier from sklearn.pipeline import Pi...
AEW2015/PYNQ_PR_Overlay
Pynq-Z1/notebooks/examples/usb_wifi.ipynb
bsd-3-clause
# Make sure the base overlay is loaded from pynq import Overlay from pynq.drivers import Usb_Wifi Overlay("base.bit").download() port = Usb_Wifi() """ Explanation: USB Wifi Example In this notebook, a wifi dongle has been plugged into the board. Specifically a RALink wifi dongle commonly used with Raspberry Pi kits i...
sdpython/teachpyx
_doc/notebooks/pandas/pandas_groupby.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Pandas et groupby Petit tour de passe passe autour d'un groupby et des valeurs manquantes qui ne sont plus prises en compte depuis les dernières versions. End of explanation """ import pandas data = [{"a":1, "b":2}, {"a":10, "b":20}, {"...
ZhangXinNan/tensorflow
tensorflow/contrib/eager/python/examples/generative_examples/cvae.ipynb
apache-2.0
# to generate gifs !pip install imageio """ Explanation: Copyright 2018 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"). Convolutional VAE: An example with tf.keras and eager <table class="tfo-notebook-buttons" align="left"><td> <a target="_blank" href="https://colab.research.go...
lcharleux/numerical_analysis
doc/Optimisation/notebooks/Optimization_practical_work.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt %matplotlib nbagg import sys, copy, os from scipy import optimize sys.path.append("truss-master") try: import truss print("Truss is correctly installed") except: print("Truss is NOT correctly installed !") """ Explan...
yjzhang/uncurl_python
notebooks/Tutorial.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import scipy.io import uncurl """ Explanation: Tutorial Let's work through an example of single-cell data analysis using Uncurl, using many of its features. For a much briefer example using the same dataset, see examples/zeisel_subset_example.py. En...
info-370/classification
knn/INFO370-KNN_Exercise.ipynb
mit
from sklearn.datasets import load_boston from sklearn.cross_validation import train_test_split from sklearn.preprocessing import scale from sklearn.neighbors import KNeighborsRegressor from sklearn.metrics import mean_squared_error from sklearn.cross_validation import KFold import matplotlib.pyplot as plt import numpy ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_automl_image_object_detection_batch.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 SDK: AutoML training image object detection model for batch prediction <table align="lef...
xpharry/Udacity-DLFoudation
tutorials/gan_mnist/Intro_to_GANs_Solution.ipynb
mit
%matplotlib inline import pickle as pkl 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') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
kungsik/text_fabric_sample
tutorial_1.ipynb
gpl-3.0
from tf.fabric import Fabric """ Explanation: Text-Fabric Api 활용 예제 본 파일은 Text-Fabric Api를 활용하여 성서 검색 프로그램을 만들기 위한 시범 예제 페이지입니다. - 라이브러리 불러오기 End of explanation """ ETCBC = 'hebrew/etcbc4c' PHONO = 'hebrew/phono' TF = Fabric( modules=[ETCBC, PHONO], silent=False ) """ Explanation: - 데이터베이스 파일 로드 etcbc4c는 히브리어 텍스트, ...
cgpotts/cs224u
feature_attribution.ipynb
apache-2.0
__author__ = "Christopher Potts" __version__ = "CS224u, Stanford, Spring 2022" """ Explanation: Feature attribution End of explanation """ !pip install captum """ Explanation: Contents Overview InputXGradients Selectivity examples Simple feed-forward classifier example Bag-of-words classifier for the SST BERT exam...
bio-guoda/guoda-examples
ids_in_bhl/ids_demo.ipynb
mit
idigbio_full = sqlContext.read.parquet("../2016spr/data/idigbio/occurrence.txt.parquet") bhl_full = sqlContext.read.parquet("../guoda-datasets/BHL/data/bhl-20160516.parquet") # This replaces the datasets with ones that are a small subset #bhl = bhl_full.sample(fraction=0.01, withReplacement=False) #idigbio = idigbio_f...
woobe/odsc_h2o_machine_learning
py_04a_classification_basics.ipynb
apache-2.0
# Start and connect to a local H2O cluster import h2o h2o.init(nthreads = -1) """ Explanation: Machine Learning with H2O - Tutorial 4a: Classification Models (Basics) <hr> Objective: This tutorial explains how to build classification models with four different H2O algorithms. <hr> Titanic Dataset: Source: https:/...
intellimath/pyaxon
examples/axon_with_python.ipynb
mit
from __future__ import print_function from axon import loads, dumps from pprint import pprint """ Explanation: AXON is eXtended Object Notation. It's a simple notation of objects, documents and data. It's also a text based serialization format in first place. It tries to combine the best of JSON, XML and YAML. pyaxo...
quantopian/research_public
notebooks/data/quandl.cboe_vxv/notebook.ipynb
apache-2.0
# For use in Quantopian Research, exploring interactively from quantopian.interactive.data.quandl import cboe_vxv as dataset # import data operations from odo import odo # import other libraries we will use import pandas as pd # Let's use blaze to understand the data a bit using Blaze dshape() dataset.dshape # And h...
sdpython/ensae_teaching_cs
_doc/notebooks/sklearn_ensae_course/06_unsupervised_dimreduction.ipynb
mit
from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target """ Explanation: 2A.ML101.6: Unsupervised Learning: Dimensionality Reduction and Visualization Unsupervised learning is interested in situations in which X is available, but not y: data without labels. A typical use case is to find...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch6-Problem_6-02.ipynb
unlicense
%pylab notebook """ Explanation: Excercises Electric Machinery Fundamentals Chapter 6 Problem 6-2 End of explanation """ fse = 60.0 # [Hz] p = 2.0 s = 0.025 """ Explanation: Description Answer the questions in Problem 6-1 for a 480-V three-phase two-pole 60-Hz induction motor running at a sli...
flmath-dirty/matrixes_in_erlang
jupyter/results.ipynb
mit
LoadedTable.head() """ Explanation: Introduction Test scenarios descriptions The LoadedTable contains statistics gathered from running the script that generates a matrix (Width x Height) and then runs with the fprof following tests for each representation of matrix and sizes: The tests categories: one_rows_sums - s...
DallasTrinkle/Onsager
examples/Garnet.ipynb
mit
import sys sys.path.extend(['../']) import numpy as np import onsager.crystal as crystal import onsager.OnsagerCalc as onsager """ Explanation: Garnet correlation coefficients Comparing to correlation coefficients from William D. Carlson and Clark R. Wilson, Phys Chem Minerals 43, 363-369 (2016) doi:10.1007/s00269-016...
cathalmccabe/PYNQ
pynq/notebooks/common/programming_pybind11.ipynb
bsd-3-clause
from pynq.lib import pybind11 """ Explanation: Programming C/C++ using Pybind11 In this notebook we will show how to leverage Pybind11 to develop normal C/C++ program in Jupyter environment. This is a unique feature added by the pynq package. Compared to the SWIG binding, Pybind11 supports C++ program; therefore it...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-veg/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-veg', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-VEG Topic: Atmos Sub-Top...
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module01/01-06-Factorization.ipynb
mit
from random import randint x = randint(1,100) y = randint(1,100) (2*x*y**2)*(-3*x*y) == -6*x**2*y**3 """ Explanation: Factorization Factorization is the process of restating an expression as the product of two expressions (in other words, expressions multiplied together). For example, you can make the value 16 by per...
tensorflow/docs-l10n
site/en-snapshot/agents/tutorials/1_dqn_tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
shawger/uc-dand
P3/Wrangle OpenStreetMap Data.ipynb
gpl-3.0
#Creates and uses sample file if True USE_SAMPLE = False k = 10 inputFile = "calgary_canada.osm" sampleFile = "calgary_canada_sample.osm" if USE_SAMPLE: import createTestFile createTestFile.createTestFile(inputFile,sampleFile,k) print '%s created from %s for testing.' % (sampleFile,inputFil...
DigitalSlideArchive/HistomicsTK
docs/examples/polygon_merger_from_tiled_masks.ipynb
apache-2.0
import os CWD = os.getcwd() import os import girder_client from pandas import read_csv from histomicstk.annotations_and_masks.polygon_merger import Polygon_merger from histomicstk.annotations_and_masks.masks_to_annotations_handler import ( get_annotation_documents_from_contours, ) """ Explanation: Merging annotat...
GoogleCloudPlatform/ai-notebooks-extended
dataproc-hub-example/build/infrastructure-builder/mig/files/gcs_working_folder/examples/Python/bigquery/Visualizing BigQuery public data.ipynb
apache-2.0
%%bigquery SELECT source_year AS year, COUNT(is_male) AS birth_count FROM `bigquery-public-data.samples.natality` GROUP BY year ORDER BY year DESC LIMIT 15 """ Explanation: Vizualizing BigQuery data in a Jupyter notebook BigQuery is a petabyte-scale analytics data warehouse that you can use to run SQL queries ...
Xilinx/PYNQ
boards/Pynq-Z1/base/notebooks/pmod/pmod_dac_adc.ipynb
bsd-3-clause
from pynq.overlays.base import BaseOverlay from pynq.lib import Pmod_ADC, Pmod_DAC """ Explanation: DAC-ADC Pmod Examples using Matplotlib and Widget Contents Pmod DAC-ADC Feedback Tracking the IO Error Error plot with Matplotlib Widget controlled plot Pmod DAC-ADC Feedback This example shows how to use the PmodDA4 ...
ProfessorKazarinoff/staticsite
content/code/sympy/sympy_solving_equations-polymer-density-problem.ipynb
gpl-3.0
from sympy import symbols, nonlinsolve """ Explanation: Sympy is a Python package used for solving equations using symbolic math. Let's solve the following problem with SymPy. Given: The density of two different polymer samples $\rho_1$ and $\rho_2$ are measured. $$ \rho_1 = 0.904 \ g/cm^3 $$ $$ \rho_2 = 0.895 \ g/...
sidaw/mompy
polynomial_optimization.ipynb
mit
# we are dependent on numpy, sympy and cvxopt. import numpy as np import cvxopt import mompy as mp # just some basic settings and setup mp.cvxsolvers.options['show_progress'] = False from IPython.display import display, Markdown, Math, display_markdown sp.init_printing() def print_problem(obj, constraints = None, mom...
jarvis-fga/Projetos
Problema 2/alexandre/Second Project ML.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: 1. Descrição do Problema A empresa Amazon deseja obter um sistema inteligente para processar os comentários de seus clientes sobre os seus produtos, podendo classificar tais comentários dentre as categorias: positivo ou negativo. P...
waltervh/BornAgain-tutorial
old/python/tutorial.ipynb
gpl-3.0
from __future__ import print_function """ Explanation: Introduction to Python Useful links BornAgain: http://bornagainproject.org BornAgain tutorial: https://github.com/scgmlz/BornAgain-tutorial Python official tutorial: https://docs.python.org/3/tutorial/ Anaconda Python: https://www.continuum.io/ PyCharm IDE: https...
roebius/deeplearning_keras2
nbs2/babi-memnn.ipynb
apache-2.0
%matplotlib inline import importlib, utils2; importlib.reload(utils2) from utils2 import * np.set_printoptions(4) cfg = K.tf.ConfigProto(gpu_options={'allow_growth': True}) K.set_session(K.tf.Session(config=cfg)) """ Explanation: Babi End to End MemNN End of explanation """ def tokenize(sent): return [x.strip()...
tarunchhabra26/fss16dst
code/8/WS4/dndesai_performance.ipynb
apache-2.0
%matplotlib inline # All the imports from __future__ import print_function, division import pom3_ga, sys import pickle # TODO 1: Enter your unity ID here __author__ = "dndesai" """ Explanation: Workshop 4 - Performance Metrics In this workshop we study 2 performance metrics(Spread and Inter-Generational Distance) on...
Kaggle/learntools
notebooks/machine_learning/raw/ex6.ipynb
apache-2.0
# Code you have previously used to load data import pandas as pd from sklearn.metrics import mean_absolute_error from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeRegressor # Path of the file to read iowa_file_path = '../input/home-data-for-ml-course/train.csv' home_data = pd....
tensorflow/docs-l10n
site/ko/federated/tutorials/building_your_own_federated_learning_algorithm.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...
gldmt-duke/CokerAmitaiSGHMC
logistic_regression/logistic_regression_simulated.ipynb
mit
def logistic(x): ''' ''' return 1/(1+np.exp(-x)) def U_logistic(theta, Y, X, phi): ''' ''' return - (Y.T @ X @ theta - np.sum(np.log(1+np.exp(X @ theta))) - 0.5 * phi * np.sum(theta**2)) def gradU_logistic(theta, Y, X, phi): ''' ''' n = X.shape[0] Y_pred = logistic(X @ the...
epam/DLab
integration-tests/examples/test_templates/deeplearning/template_caffe2.ipynb
apache-2.0
# We'll also import a few standard python libraries from matplotlib import pyplot import numpy as np import time # These are the droids you are looking for. from caffe2.python import core, workspace from caffe2.proto import caffe2_pb2 # Let's show all plots inline. %matplotlib inline """ Explanation: Caffe2 Basic Co...
Abjad/intensive
day-3/4-command-classes.ipynb
mit
class IndicatorCommand: """ Indicator command. """ def __init__(self, indicator, selector): self.indicator = indicator self.selector = selector def __call__(self, music): for selection in self.selector(music): indicator = copy.copy(self.indicator) ab...
edwardd1/phys202-2015-work
assignments/assignment05/InteractEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 01 Import End of explanation """ def print_sum(a, b): """Print the sum of the arguments a and b.""" ...
Adamage/python-training
Lesson_01_variables_and_data_types.ipynb
apache-2.0
my_name = 'Adam' print my_name my_age = 92 your_age = 23 age_difference = my_age - your_age print age_difference """ Explanation: Python Training - Lesson 1 - Variables and Data Types Variables A variable refers to a certain value with specific type. For example, we may want to store a number, a fraction, or a name, ...
tensorflow/docs-l10n
site/ko/tutorials/images/data_augmentation.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...
h-mayorquin/time_series_basic
presentations/2015-11-10(Letter Frequency).ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from nltk.book import text7 as text import nltk import string print('Number of words', len(text)) text[0:10] """ Explanation: Studying Frequency on Corpus This is just to check what type of letters come in a determinate corpus and study the frequency distribution. T...
kubeflow/kfserving-lts
docs/samples/v1alpha2/custom/kfserving-custom-model/kfserving_sdk_custom_image.ipynb
apache-2.0
# Set this to be your dockerhub username # It will be used when building your image and when creating the InferenceService for your image DOCKER_HUB_USERNAME = "your_docker_username" %%bash -s "$DOCKER_HUB_USERNAME" docker build -t $1/kfserving-custom-model ./model-server %%bash -s "$DOCKER_HUB_USERNAME" docker push ...
mne-tools/mne-tools.github.io
stable/_downloads/0602f866d20bff8af56294e10dd6854d/10_preprocessing_overview.ipynb
bsd-3-clause
import os import numpy as np import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file) raw.crop(0, 60).load_data() # just use a fr...
samuelsinayoko/kaggle-housing-prices
research/long_form_featureplots_seaborn.ipynb
mit
import string import pandas as pd import numpy as np import seaborn as sns """ Explanation: Distributions of multiple numerical features with Seaborn When given a set of numerical features, it is desirable to plot all of them using for example violinplots, to get a sense of their respective distributions. Seaborn can...
andersrmr/JupyterWorkflow
UnsupervisedAnalysis.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.style.use('seaborn') import pandas as pd import numpy as np from sklearn.decomposition import PCA from sklearn.mixture import GaussianMixture """ Explanation: Unsupervised Analysis of Days of Week Treating crossings each day of features to learn about the relati...
tensorflow/docs-l10n
site/ja/tfx/tutorials/data_validation/tfdv_basic.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...
zhenxinlei/SpringSecurity1
ex1/ex1.ipynb
epl-1.0
import csv import pandas as pd import numpy as np from numpy import genfromtxt data = pd.read_csv('./ex1data1.csv', delimiter=',', names=['population','profit']) data.head() %matplotlib inline ''' import matplotlib.pyplot as plt x= data['population'] y= data['profit'] plt.plot(x,y,'rx') plt.ylabe...
karlstroetmann/Algorithms
Python/Chapter-06/Stack.ipynb
gpl-2.0
class Stack: pass S = Stack() S """ Explanation: Implementing a Stack Class First, we define an empty class Stack. End of explanation """ def stack(S): S.mStackElements = [] """ Explanation: Next we define a constructor for this class. The function stack(S) takes an uninitialized, empty object S and init...
natashabatalha/PandExo
notebooks/JWST_Running_Pandexo_w_ExoMAST.ipynb
gpl-3.0
import warnings warnings.filterwarnings('ignore') import pandexo.engine.justdoit as jdi import numpy as np import os """ Explanation: Getting Started Before starting here, all the instructions on the installation page should be completed! Here you will learn how to: set planet and star properties using exomast run...
rusucosmin/courses
ml/ex01/solution/taskB.ipynb
mit
np.random.seed(10) p, q = (np.random.rand(i, 2) for i in (4, 5)) p_big, q_big = (np.random.rand(i, 80) for i in (100, 120)) print(p, "\n\n", q) """ Explanation: Data Generation End of explanation """ def naive(p, q): result = np.zeros((p.shape[0], q.shape[0])) for i in range(p.shape[0]): for j in ra...
cni/psych204a
mrImaging.ipynb
gpl-2.0
%pylab inline import matplotlib as mpl mpl.rcParams["figure.figsize"] = (8, 6) mpl.rcParams["axes.grid"] = True from IPython.display import display, clear_output from time import sleep """ Explanation: MR Imaging Class: Psych 204a Tutorial: MR Imaging Author: Wandell Date: 03.15.04 Duration: 90 minutes C...
brian-rose/env-415-site
notes/Introducing_CESM.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo('As85L34fKYQ') """ Explanation: ENV / ATM 415: Climate Laboratory Introducing the Community Earth System Model About the model We are using a version of the Community Earth System Model (CESM) which is developed and maintained at the National Center for Atmospheri...
choyichen/omics
examples/biomaRt.ipynb
mit
import pandas as pd %load_ext rpy2.ipython %%R library(biomaRt) %load_ext version_information %version_information pandas, rpy2 """ Explanation: Access Ensembl BioMart using biomart module We use rpy2 and R magics in IPython Notebook to utilize the powerful biomaRt package in R. Usage: Run Setup Select a mart & dat...