repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ChristinaB/Observatory
tutorials/Observatory_usecase6_observationdata.ipynb
mit
#conda install -c conda-forge basemap-data-hires --yes # data processing import os import pandas as pd, numpy as np, dask, json import ogh import geopandas as gpd # data migration library from utilities import hydroshare # plotting and shape libraries %matplotlib inline # silencing warning import warnings warnings....
samstav/scipy_2015_sklearn_tutorial
notebooks/04.4 Model Evaluation and Scoring Metrics.ipynb
cc0-1.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np np.set_printoptions(precision=2) from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from sklearn.svm import LinearSVC digits = load_digits() X, y = digits.data, digits.target X_train, X_test, y_train, y_t...
CAChemE/curso-python-datos
notebooks/004-PythonBasico-EjerciciosBuclesCondicionales.ipynb
bsd-3-clause
def sumatorio(num): """Suma los `num` primeros números. Ejemplos -------- >>> sumatorio(4) 10 """ suma = 0 for nn in range(1, num + 1): suma = nn + suma return suma """ Explanation: Ejercicios bucles y condicionales Vamos a afianzar los conocimientos de Python que acabamos...
parklab/PaSDqc
examples/07_example_region_blacklist/regions_blacklist.ipynb
mit
import PaSDqc import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pathlib %matplotlib inline %load_ext autoreload %autoreload 2 sns.set_context('poster') sns.set_style("ticks", {'ytick.minor.size': 0.0, 'xtick.minor.size': 0.0}) """ Explanation: Introduction In this no...
openhep/ackp16
LandauPole.ipynb
gpl-3.0
%matplotlib inline from scipy.integrate import odeint import matplotlib.pyplot as plt import numpy as np #import math from scipy import pi from sympy import Rational, sqrt, Symbol, init_printing # local packages # from plothelp import label_line from smgroup import * from constants import * init_printing(use_latex='m...
sunilmallya/dl-twitch-series
E3_finetuning_randall_not_randall.ipynb
apache-2.0
# helper functions import mxnet as mx import os, urllib def download(url): filename = url.split("/")[-1] if not os.path.exists(filename): urllib.urlretrieve(url, filename) def get_model(prefix, epoch): download(prefix+'-symbol.json') download(prefix+'-%04d.params' % (epoch,)) get_mode...
kern-lab/popGenMachineLearningExamples
ancPopSizeRegressionExample.ipynb
mit
#untar and compile ms and sample_stats !tar zxf ms.tar.gz; cd msdir; gcc -o ms ms.c streec.c rand1.c -lm #I get three compiler warnings from ms, but everything should be fine #now I'll just move the program into the current working dir !mv msdir/ms .; """ Explanation: Using a random forest to infer past population siz...
georgetown-analytics/machine-learning
archive/notebook/ML Class Session III.ipynb
mit
import matplotlib.pyplot as plt %matplotlib inline import pandas as pd df = pd.read_csv('../data/energy/energy.csv') df.shape df.describe() """ Explanation: Energy Efficiency What can you tell me about the data? End of explanation """ import matplotlib.pyplot as plt %matplotlib inline from pandas.tools.plotting im...
astro4dev/OAD-Data-Science-Toolkit
Teaching Materials/Machine Learning/Supervised Learning/Examples/PPC/Pulsar Problem Intro.ipynb
gpl-3.0
# Plotting library. import matplotlib.pyplot as plt # For some math we need to do. import numpy as np # The HTRU 2 profile data is split - one file containing the real pulsar # profiles, one file containing noise/interference profiles. We load both # these data sources here. First we construct relative paths to the f...
ioggstream/python-course
connexion-101/notebooks/03-connexion.ipynb
agpl-3.0
# At first ensure connexion is installed # together with the swagger module used to render the OAS3 spec # in the web-ui !pip install connexion[swagger-ui] connexion """ Explanation: Connexion Connexion is a python framework based on Flask. It streamlines the creation of contract-first REST APIs. Once you have your O...
UCBerkeleySETI/breakthrough
GBT/filterbank_tutorial/Filterbank Tutorial (public).ipynb
gpl-3.0
from blimpy import Waterfall fil = Waterfall('blc04_guppi_57563_69862_HIP35136_0011.gpuspec.0002.fil') """ Explanation: Introduction to Working with Filterbank Files by Umran Haji, Undergraduate Research Intern Welcome! In this tutorial I will demonstrate the basics of working with filterbank (.fil) files using bli...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week5/.ipynb_checkpoints/module-8-boosting-assignment-2-graphlab-checkpoint.ipynb
mit
import sys sys.path.append('C:\Anaconda2\envs\dato-env\Lib\site-packages') import graphlab import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Boosting a decision stump The goal of this notebook is to implement your own boosting module. Brace yourselves! This is going to be a fun and challenging assign...
usdivad/fibonaccistretch
nbs/fibonaccistretch_using_module.ipynb
mit
import IPython.display as ipd ipd.Audio("../data/out_humannature_90s_stretched.mp3", rate=44100) """ Explanation: Fibonacci Stretch: An Exploration Through Code by David Su This notebook and its associated code are also available on GitHub. Contents Introduction A sneak peek at the final result Part 1 - Representin...
ueapy/ueapy.github.io
content/notebooks/2017-06-30-pdf-scraping.ipynb
mit
stars_file = '../pdfs/stars-dat_user-manual_p2d-4_v3p1.pdf' moore2016_file = '../pdfs/moore_bromwich_qjrms_2016.pdf' """ Explanation: Some organisations still release their data in PDF format PDF was not designed as a data format. It was designed as an "electronic paper" format. Main purpose: presenting elements exact...
antoniomezzacapo/qiskit-tutorial
community/hello_world/laurel_or_yanny.ipynb
apache-2.0
from qiskit import ClassicalRegister, QuantumRegister from qiskit import QuantumCircuit, execute from qiskit.tools.visualization import plot_histogram from qiskit import IBMQ, available_backends, get_backend from pydub import AudioSegment from pydub.playback import play #Set up the quantum and classical registers, and...
NuGrid/NuPyCEE
regression_tests/temp/RTS_custom_imf.ipynb
bsd-3-clause
import matplotlib matplotlib.use('nbagg') import matplotlib.pyplot as plt #matplotlib.use('nbagg') import numpy as np %matplotlib inline import sygma as s reload(s) """ Explanation: Introduction to SYGMA parameter Tips at the beginning: $\odot$ You can find the documentation <a href="DOC/sygma.html">here</a>. $\odot$...
crystalzhaizhai/cs207_yi_zhai
lectures/L6/L6-slides.ipynb
mit
from IPython.display import HTML # Allows us to embed HTML into our notebook. HTML('<iframe width="800" height="400" frameborder="0" src="http://pythontutor.com/iframe-embed.html#code=a%20%3D%20%5B1,%203,%205%5D%0Ab%20%3D%20a%0Aprint%28%22a%20%3D%20%7B0%7D%20and%20has%20id%20%7B1%7D%22.format%28a,%20id%28a%29%29%29%0Ap...
minesh1291/Practicing-Kaggle
MNIST_2017/dump_/Mens_script.ipynb
gpl-3.0
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
mne-tools/mne-tools.github.io
dev/_downloads/c37ac181bfe2eb2f1fa69c3fab30417d/mne_cov_power.ipynb
bsd-3-clause
# Author: Denis A. Engemann <denis-alexander.engemann@inria.fr> # Luke Bloy <luke.bloy@gmail.com> # # License: BSD-3-Clause import os.path as op import numpy as np import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse_cov data_path = sample.data_path() s...
PhilipReschke/TensorFlow-Code-Examples
Recurring Neural Network.ipynb
gpl-3.0
import tensorflow as tf import numpy as np """ Explanation: TensorFlow - Recurring Neural Neural Network Example About this notebook Author: Philip Reschke (http://www.philipreschke.com). Project: https://github.com/PhilipReschke/TensorFlow-Code-Examples I will build a Recurring Neural Network using a number of LSTM l...
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module03/03-04-More Matrices.ipynb
mit
import numpy as np A = np.array([[1,2,3], [4,5,6]]) print(2 * A) """ Explanation: More Matrices This notebook continues your exploration of matrices. Matrix Multiplication Multiplying matrices is a little more complex than the operations we've seen so far. There are two cases to consider, scalar multipl...
whitead/numerical_stats
unit_7/hw_2017/problem_set_1.ipynb
gpl-3.0
data = [-4.4,-10.1,1.6,4.0,3.4,-2.0,-5.8,-1.9,-3.1,1.8,-2.9,4.9,2.7,-9.5,2.8,4.3,-1.1,3.9,-9.1,5.6,1.1,-1.0,0.7,9.7,-1.6,-2.3,1.4,2.5,-9.0,1.1] ### BEGIN SOLUTION import scipy.stats as stats x = np.mean(data) s = np.std(data, ddof=1) Z = stats.norm.ppf(0.975) print('{:.2f} +/- {:.2f}'.format(x, s * Z / np.sqrt(len(dat...
tanyaschlusser/office-nfl-pool
Fantasy (first steps).ipynb
mit
## # Setup -- import the modules we want and set up inline plotting # from __future__ import print_function import datetime import matplotlib import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # Bigger fonts and figures for the demo matplotlib.rcParams.update({ 'font.size...
hfoffani/deep-learning
gan_mnist/Intro_to_GANs.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...
xdze2/thermique_appart
get_data_and_preprocess.ipynb
mit
coords_grenoble = (45.1973288, 5.7139923) startday = pd.to_datetime('12/07/2017', format='%d/%m/%Y').tz_localize('Europe/Paris') lastday = pd.to_datetime('now').tz_localize('Europe/Paris') """ Explanation: Téléchargement des données et premier traitement End of explanation """ # routine pour construire automatiquem...
weleen/mxnet
example/notebooks/tutorials/finetune-CNN-catsvsdogs.ipynb
apache-2.0
# Data Iterators for cats vs dogs dataset import mxnet as mx def get_iterators(batch_size, data_shape=(3, 224, 224)): train = mx.io.ImageRecordIter( path_imgrec = './cats_dogs_train.rec', data_name = 'data', label_name = 'softmax_label', batch_size ...
JoseGuzman/myIPythonNotebooks
Optimization/linear_regression.ipynb
gpl-2.0
%pylab inline from numpy import poly1d, polyfit """ Explanation: <H1>Linear regression</H1> End of explanation """ # generate some data np.random.seed(1000) mysize = 1000 xdata = np.random.normal(3.0, 1.0, mysize) m = 2.0 + np.random.normal(0,.2,mysize) a = 0.05 + np.random.normal(0, .01, size=mysize) ydata = m*xdat...
keshr3106/ThinkStats2
code/chap03soln.ipynb
gpl-3.0
%matplotlib inline import chap01soln resp = chap01soln.ReadFemResp() """ Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br> Allen Downey Read the female respondent file. End of explanation """ import thinkstats2 pmf = thinkstats2.Pmf(resp.numkdhh) pmf """ Explanation: Make a PMF of <tt>numkd...
cathywu/flow
tutorials/tutorial09_environments.ipynb
mit
# import the base environment class from flow.envs import Env # define the environment class, and inherit properties from the base environment class class myEnv(Env): pass """ Explanation: Tutorial 09: Creating Custom Environments This tutorial walks you through the process of creating custom environments in Flow...
mrcslws/nupic.research
projects/archive/dynamic_sparse/notebooks/mcaporale/2019-10-10-ExperimentAnalysis-GSCSparser.ipynb
agpl-3.0
from IPython.display import Markdown, display %load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands i...
AeroPython/Taller-PyConEs-2015
Ejercicios/El problema de los matrimonios estables/matrimonios_estables.ipynb
mit
from IPython.display import HTML HTML('<iframe src="http://youtube.com" width="700" height="400"></iframe>') """ Explanation: El problema de los matrimonios estables Dados un cierto número de hombres y mujeres heterosexuales, organízalos por parejas de tal manera que su matrimonio sea estable. Cada persona ha ordenad...
yandexdataschool/Practical_RL
week05_explore/week5.ipynb
unlicense
class BernoulliBandit: def __init__(self, n_actions=5): self._probs = np.random.random(n_actions) @property def action_count(self): return len(self._probs) def pull(self, action): if np.any(np.random.random() > self._probs[action]): return 0.0 return 1.0 ...
dmolina/es_intro_python
08-Defining-Functions.ipynb
gpl-3.0
print('abc') """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="fig/cover-small.jpg"> This notebook contains an excerpt from the Whirlwind Tour of Python by Jake VanderPlas; the content is available on GitHub. The text and code are released under the CC0 license; see also the c...
yonetaniryo/corrsearch
ipython_notebook/example.ipynb
gpl-2.0
sys.path.append('../src/') import CorrSearchSV as CSSV # main module rootdir = '<set your path to the example directory>' # Input data tardir = rootdir + '/example/1/ppm' # rgb data, .ppm format obsdir = rootdir + '/example/0/ppm' # rgb data, .ppm format svdir = CSSV.glob.glob(rootdir + '/example/0/sv/*') # set of dire...
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module03/03-01-Vectors.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt # We'll use a numpy array for our vector v = np.array([2,1]) # and we'll use a quiver plot to visualize it. origin = [0], [0] plt.axis('equal') plt.grid() plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0)) plt.quiver(*origin, *v, scal...
gsorianob/fiuba-python
Clase 09 - Introducción POO.ipynb
apache-2.0
class Mesa(object): cantidad_de_patas = None color = None material = None mi_mesa = Mesa() mi_mesa.cantidad_de_patas = 4 mi_mesa.color = 'Marrón' mi_mesa.material = 'Madera' print 'Tendo una mesa de {0.cantidad_de_patas} patas de color {0.color} y esta hecha de {0.material}'.format(mi_mesa) """ Expla...
mfouesneau/pyphot
examples/sandbox_QuickStart.ipynb
mit
%matplotlib inline import pylab as plt import numpy as np import sys sys.path.append('../') from pyphot import sandbox as pyphot """ Explanation: pyphot - A tool for computing photometry from spectra Some examples are provided in this notebook Full documentation available at http://mfouesneau.github.io/docs/pyphot/ ...
duncanwp/python_for_climate_scientists
course_content/notebooks/python_introduction.ipynb
gpl-3.0
# The obligatory hello world... print("Hello world!") an_integer = 9 a_float = 2.5 a_string = "blah" a_complex_number = 2.0 + 2.3j # Note that variables are case-sensitive a = 1 A = 2 print(a, A) # And can be dynamically reassigned an_integer = 7 print(an_integer) """ Explanation: Python 101 This introduction is b...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/sdk/sdk_custom_tabular_regression_online.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: Custom training tabular regression model for online prediction <table align="left">...
loredanacirstea/ai-algos
DNN Speech Recognizer/vui_notebook.ipynb
gpl-3.0
from data_generator import vis_train_features # extract label and audio features for a single training example vis_text, vis_raw_audio, vis_mfcc_feature, vis_spectrogram_feature, vis_audio_path = vis_train_features() """ Explanation: Artificial Intelligence Nanodegree Voice User Interfaces Project: Speech Recognition...
ledeprogram/algorithms
class7/donow/ronga_paul_donow_7.ipynb
gpl-3.0
import pandas as pd %matplotlib inline import numpy as np from sklearn.linear_model import LogisticRegression """ Explanation: Apply logistic regression to categorize whether a county had high mortality rate due to contamination 1. Import the necessary packages to read in the data, plot, and create a logistic regressi...
inakic/matsoft
IPython-parallel.ipynb
unlicense
from IPython.parallel import Client cli = Client() """ Explanation: IPython parallel Jupyter prilično jednostavno omogućava paralelizaciju koda. Dokumentaciju možete naći ovdje: Using IPython for parallel computing. No modifikacija Jupyter notebook u Sagemath oblaku to ne omogućuje. No u Sagemath oblaku možemo pokret...
sharynr/notebooks
Exploring Heating Problems in Manhattan.ipynb
apache-2.0
import os import matplotlib.pyplot as plt import pandas as pd os.environ['BRUNEL_CONFIG'] = "locjavascript=/data/jupyter2/static-file-content-delivery-network/nbextensions/brunel_ext" import brunel # Brunel will be used to visualize data later on !pip install --user brunel """ Explanation: Exploring Heating Problems ...
philippgrafendorfe/stackedautoencoders
.ipynb_checkpoints/MNIST_advanced-checkpoint.ipynb
mit
from keras.layers import Input, Dense, Dropout from keras.models import Model from keras.datasets import mnist from keras.models import Sequential, load_model from keras.optimizers import RMSprop from keras.callbacks import TensorBoard from __future__ import print_function from IPython.display import SVG, Image from ke...
eduardojvieira/Curso-Python-MEC-UCV
4-matplotlib.ipynb
mit
%matplotlib inline """ Explanation: <table width="100%" border="0"> <tr> <td><img src="./images/ing.png" alt="" align="left" /></td> <td><img src="./images/ucv.png" alt="" align="center" height="100" width="100" /></td> <td><img src="./images/mec.png" alt="" align="right"/></td> </tr> </table> <br> <h1 ...
tensorflow/hub
examples/colab/semantic_similarity_with_tf_hub_universal_encoder.ipynb
apache-2.0
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
yuvrajsingh86/DeepLearning_Udacity
first-neural-network/Your_first_neural_network.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...
datactive/bigbang
examples/git-analysis/MultiGitRepos.ipynb
mit
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...
dipanjank/ml
simple_implementations/LDA.ipynb
gpl-3.0
import numpy as np import pandas as pd %pylab inline pylab.style.use('ggplot') """ Explanation: <h1 align="center">Linear Discriminant Analysis</h1> End of explanation """ import seaborn as sns iris_df = sns.load_dataset('iris') iris_df = iris_df.set_index('species') iris_df.head() """ Explanation: The goal of a...
yunqu/PYNQ
boards/Pynq-Z1/base/notebooks/microblaze/microblaze_programming.ipynb
bsd-3-clause
from pynq.overlays.base import BaseOverlay base = BaseOverlay('base.bit') """ Explanation: Programming Microblaze Subsystems from Jupyter In the Base I/O overlays that accompany the PYNQ release Microblazes are used to control peripherals attached to the various connectors. These can either be programmed with existin...
fabiencampillo/systemes_dynamiques_agronomie
Partie5_Controle_PID.ipynb
gpl-3.0
# -*- coding: utf-8 -*- from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> Pour afficher le code python, cliquer sur le bouton: ...
mne-tools/mne-tools.github.io
0.12/_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...
oasis-open/cti-python-stix2
docs/guide/ts_support.ipynb
bsd-3-clause
import stix2 stix2.Indicator() """ Explanation: Technical Specification Support How imports work Imports can be used in different ways depending on the use case and support levels. People who want to support the latest version of STIX 2 without having to make changes, can implicitly use the latest version:<div class=...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_tf_dics.ipynb
bsd-3-clause
# Author: Roman Goj <roman.goj@gmail.com> # # License: BSD (3-clause) import mne from mne.event import make_fixed_length_events from mne.datasets import sample from mne.time_frequency import csd_fourier from mne.beamformer import tf_dics from mne.viz import plot_source_spectrogram print(__doc__) data_path = sample.d...
Population-Transcriptomics/C1-CAGE-preview
OP-WORKFLOW-CAGEscan-short-reads-v2.0.ipynb
cc0-1.0
import subprocess, os, csv, signal, pysam """ Explanation: OP-WORKFLOW-CAGEscan-short-reads-v2.0 This document is an example of how to process a C1 CAGE library with a Jupyter notebook from raw reads to single molecule count. All the steps are described in the tutorial section of this repository. In the following sect...
CUFCTL/DLBD
Fall2017/Module1_gpu.ipynb
mit
import sys, os import pickle import torch import torch.utils.data as data import glob from PIL import Image import numpy as np def unpickle(fname): with open(fname, 'rb') as f: Dict = pickle.load(f, encoding='bytes') return Dict def load_data(batch): print ("Loading batch:{}".format(batch)) ...
kevinsung/OpenFermion
docs/tutorials/circuits_2_diagonal_coulomb_trotter.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...
tpin3694/tpin3694.github.io
machine-learning/chi-squared_for_feature_selection.ipynb
mit
# Load libraries from sklearn.datasets import load_iris from sklearn.feature_selection import SelectKBest from sklearn.feature_selection import chi2 """ Explanation: Title: Chi-Squared For Feature Selection Slug: chi-squared_for_feature_selection Summary: How to remove irrelevant features using chi-squared for machine...
tpin3694/tpin3694.github.io
machine-learning/.ipynb_checkpoints/split_data_into_training_and_test_sets-checkpoint.ipynb
mit
# Load libraries from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split """ Explanation: Title: Split Data Into Training And Test Sets Slug: split_data_into_training_and_test_sets Summary: How to split data into training and test sets for mach...
tuanavu/coursera-university-of-washington
machine_learning/4_clustering_and_retrieval/assigment/week3/.ipynb_checkpoints/module-5-decision-tree-assignment-2-blank-Graphlab-checkpoint.ipynb
mit
import graphlab """ Explanation: Implementing binary decision trees The goal of this notebook is to implement your own binary decision tree classifier. You will: Use SFrames to do some feature engineering. Transform categorical variables into binary variables. Write a function to compute the number of misclassified e...
CitrineInformatics/lolo
python/examples/ling-immi-2017.ipynb
apache-2.0
%matplotlib inline from matplotlib import pyplot as plt from matminer.data_retrieval.retrieve_Citrine import CitrineDataRetrieval from matminer.featurizers.base import MultipleFeaturizer from matminer.featurizers import composition as cf from lolopy.learners import RandomForestRegressor from sklearn.model_selection imp...
Chipe1/aima-python
nlp_apps.ipynb
mit
from utils import open_data from text import * flatland = open_data("EN-text/flatland.txt").read() wordseq = words(flatland) P_flatland = NgramCharModel(2, wordseq) faust = open_data("GE-text/faust.txt").read() wordseq = words(faust) P_faust = NgramCharModel(2, wordseq) """ Explanation: NATURAL LANGUAGE PROCESSING...
michaelaye/planetpy
notebooks/planet4_hirise_index_parsing.ipynb
bsd-3-clause
from planetarypy import pdstools as pds """ Explanation: Instructions pip install planetarypy I wrote highly generalized PDS index readers, that wrap the Python Parameter Value Language module PVL (The syntax for Planetary Data System label files). Relevant functions are in https://github.com/michaelaye/planetarypy/...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb
apache-2.0
import os PROJECT_ID = "" # Get your Google Cloud project ID from gcloud if not os.getenv("IS_TESTING"): shell_output = !gcloud config list --format 'value(core.project)' 2>/dev/null PROJECT_ID = shell_output[0] print("Project ID: ", PROJECT_ID) """ Explanation: Pricing Optimization Table of contents Ov...
jingyany/data-512-a1
hcds-a1-data-curation.ipynb
mit
import requests import json import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import numpy as np import matplotlib.dates as mdates import datetime """ Explanation: English Wikipedia page views, 2008 - 2017 End of explanation """ endpoint1 = 'https://wikimedia.org/api/rest_v1/metrics/legacy/pagec...
3upperm2n/notes-deeplearning
word_embedding/embeddings/Skip-Grams-Solution.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...
tpin3694/tpin3694.github.io
machine-learning/detect_edges.ipynb
mit
# Load image import cv2 import numpy as np from matplotlib import pyplot as plt """ Explanation: Title: Detect Edges Slug: detect_edges Summary: How to detect edges images using OpenCV in Python. Date: 2017-09-11 12:00 Category: Machine Learning Tags: Preprocessing Images Authors: Chris Albon Preliminaries End of...
hadibakalim/deepLearning
01.neural_network/01.first_neural_net-linear_regression_1/01.linear_regression_1.ipynb
mit
import pandas as pd from sklearn import linear_model import matplotlib.pyplot as plt """ Explanation: First Neural Networks We have a dataset of measurement of different animals of brain weight and body weight. We want to predict an animal's body weight given its brain weight. Since our data is labeled this will be Su...
MSeeker/Notebook-Collections
Numerical Solution to the 1D Steady State Schrödinger Equation.ipynb
mit
import numpy as np import scipy import matplotlib from scipy import linalg from scipy.integrate import quad, ode import matplotlib.pyplot as plt %matplotlib inline """ Explanation: 1. Introduction Apart from a few worked examples in the textbook, it is quite difficult to obtain analytic solutions to the Schrödinger Eq...
xpharry/Udacity-DLFoudation
tutorials/batch-norm/Batch_Normalization_Solutions.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a co...
bhattacharjee/courses
CourseraDeepLearningSpecialization/1.NeuralNetworksAndDeepLearning/Week4/Exercises/Deep+Neural+Network+-+Application+v3.ipynb
mit
import time import numpy as np import h5py import matplotlib.pyplot as plt import scipy from PIL import Image from scipy import ndimage from dnn_app_utils_v2 import * %matplotlib inline plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams[...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/labs/preproc.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install --user google-cloud-bigquery==1.25.0 """ Explanation: <h1> Preprocessing using Dataflow </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using Dataflow </ol> <p> While Pandas is fine for experimenting, fo...
jasag/Phytoliths-recognition-system
code/notebooks/Prototypes/Classifiers_and_HoG/3_validation.ipynb
bsd-3-clause
import pickle path = '../../rsc/obj/' # Todas las rutas svm_path = path + 'svm_clf.sav' svm2_path = path + 'svm2_clf.sav' gtb_path = path + 'gtb_clf.sav' rf_path = path + 'rf_clf.sav' # Serizalización svm_clf = pickle.load(open(svm_path, 'rb')) svm2_clf = pickle.load(open(svm2_path, 'rb')) gtb_clf = pickle.load(open...
tensorflow/cloud
g3doc/tutorials/distributed_training_nasnet_with_tensorflow_cloud.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...
colour-science/colour-ipython
notebooks/colorimetry/lightness.ipynb
bsd-3-clause
import colour colour.utilities.filter_warnings(True, False) sorted(colour.LIGHTNESS_METHODS.keys()) """ Explanation: !!! D . R . A . F . T !!! Lightness Lightness is defined as the brightness of an area judged relative to the brightness of a similarly illuminated area that appears to be white or highly transmitting....
mne-tools/mne-tools.github.io
0.24/_downloads/e41b6a898e7a75f8a9f1a6c00ca73857/20_visualize_epochs.ipynb
bsd-3-clause
import os 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, verbose=False).crop(tmax=120) """ Explanation: Visualizing epo...
learnleapfly/gamecamp
Take notes in a notebook.ipynb
mit
!ls -la """ Explanation: Bonus points for taking notes in a notebook The best way to document what you're doing is in a jupyter notebook. If you've never used notebooks before, make sure you have it installed in whatever virtual environment you're using. If you're using anaconda, from your kivy environment you'll wan...
balarsen/pymc_learning
Logit/Reeves_Denton_Dst_MinL-10nTbins-pymc3.ipynb
bsd-3-clause
# http://onlinelibrary.wiley.com/doi/10.1002/2016JA022652/epdf import pymc3 import tqdm from pprint import pprint import numpy as np import matplotlib.pyplot as plt import spacepy.plot as spp import seaborn as sns sns.set(font_scale=1.5) """ Explanation: Is there a cutoff in Dst that allows slot filling? Method Usin...
StudyExchange/Udacity
MachineLearning(Advanced)/p3_creating_customer_segments/customer_segments.ipynb
mit
%%time # 引入这个项目需要的库 import numpy as np import pandas as pd import visuals as vs from IPython.display import display # 使得我们可以对DataFrame使用display()函数 # 设置以内联的形式显示matplotlib绘制的图片(在notebook中显示更美观) %matplotlib inline # 载入整个客户数据集 try: data = pd.read_csv("customers.csv") data.drop(['Region', 'Channel'], axis = 1, ...
DaveBackus/Data_Bootcamp
Code/IPython/bootcamp_exam_practice.ipynb
mit
# import packages import pandas as pd # data management import matplotlib.pyplot as plt # graphics # IPython command, puts plots in notebook %matplotlib inline # check Python version import datetime as dt import sys print('Today is', dt.date.today()) print('What version of Python are we r...
cni/psych204a
mrDiffusion.ipynb
gpl-2.0
%pylab inline rcParams["figure.figsize"] = (8, 6) rcParams["axes.grid"] = True from IPython.display import display, clear_output from mpl_toolkits.axes_grid1 import make_axes_locatable from time import sleep from __future__ import division def cart2pol(x, y): theta = arctan2(y, x) r = sqrt(x ** 2 + y ** 2) ...
parrt/msan692
notes/html.ipynb
mit
! curl https://www.sec.gov/Archives/edgar/data/1318605/000119312510017054/ds1.htm > /tmp/TeslaIPO.html """ Explanation: Extracting text from HTML file There are lots of data sources from which we might want to extract information, such as initial public offerings for various companies. E.g., Tesla's IPO prospectus. On...
texib/spark_tutorial
3.AnalysisArticle_HTML.ipynb
gpl-2.0
def parseRaw(json_map): url = json_map['url'] content = json_map['html'] return (url,content) """ Explanation: Parse Json End of explanation """ import json import pprint pp = pprint.PrettyPrinter(indent=2) path = "./pixnet.txt" all_content = sc.textFile(path).map(json.loads).map(parseRaw) """ Explanati...
NicolasHug/Surprise
examples/notebooks/KNNBasic_analysis.ipynb
bsd-3-clause
from __future__ import (absolute_import, division, print_function, unicode_literals) import pickle import os import pandas as pd from surprise import KNNBasic from surprise import Dataset fr...
skkandrach/foundations-homework
data-databases/Homework2.ipynb
mit
import pg8000 conn = pg8000.connect(database="homework2") """ Explanation: Homework 2: Working with SQL (Data and Databases 2016) This homework assignment takes the form of an IPython Notebook. There are a number of exercises below, with notebook cells that need to be completed in order to meet particular criteria. Yo...
Danghor/Formal-Languages
Ply/LaTeX2HTML.ipynb
gpl-2.0
with open('example.tex') as f: data = f.read() """ Explanation: Converting $\LaTeX$ to <span style="font-variant:small-caps;">Html</span> The purpose of the following exercise is to implement a translator from $\LaTeX$ to MathML. $\LaTeX$ is a document markup language that is especially well suited to present te...
quiltdata/quilt
docs/walkthrough/installing-a-package.ipynb
apache-2.0
import quilt3 # list local packages list(quilt3.list_packages()) # list remote packages list(quilt3.list_packages("s3://quilt-example")) """ Explanation: Searching for packages As explained in "Uploading a Package", packages are managed using registries. There is a one local registry on your machine, and potentially...
dolittle007/dolittle007.github.io
notebooks/GP-smoothing.ipynb
gpl-3.0
%pylab inline figsize(12, 6); import numpy as np import scipy.stats as stats x = np.linspace(0, 50, 100) y = (np.exp(1.0 + np.power(x, 0.5) - np.exp(x/15.0)) + np.random.normal(scale=1.0, size=x.shape)) plot(x, y); xlabel("x"); ylabel("y"); title("Observed Data"); """ Explanation: Gaussian Process (GP) smooth...
mayank-johri/LearnSeleniumUsingPython
Section 1 - Core Python/Chapter 12 - Introspection/Chapter14_Introspection.ipynb
gpl-3.0
trospection or reflection is the ability of software to identify and report their own internal structures, such as types, variabl# Getting some information # about global objects in the program from types import ModuleType def info(n_obj): # Create a referênce to the object obj = globals()[n_obj] # Show...
psci2195/espresso-ffans
doc/tutorials/08-visualization/08-visualization.ipynb
gpl-3.0
from matplotlib import pyplot import espressomd import numpy espressomd.assert_features("LENNARD_JONES") # system parameters (10000 particles) box_l = 10.7437 density = 0.7 # interaction parameters (repulsive Lennard-Jones) lj_eps = 1.0 lj_sig = 1.0 lj_cut = 1.12246 lj_cap = 20 # integration parameters system = esp...
bharath31/carnd-p1
lanelines.ipynb
mit
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Finding Lanes on the Road The objective of this project is to develop a software pipeline to identify lane lines on the road. The software pipeline is first tested on a series of images an...
OSGeoLabBp/tutorials
english/data_processing/lessons/text_files.ipynb
cc0-1.0
from IPython.display import Image from IPython.core.display import HTML Image(url= "https://github.com/OSGeoLabBp/tutorials/blob/master/english/data_processing/lessons/images/file_proc.png?raw=true") """ Explanation: <a href="https://colab.research.google.com/github/OSGeoLabBp/tutorials/blob/master/english/data_proce...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/08. Calling Functions.ipynb
mit
# Defining the function... def boring(): return "ZZZZZZZZ..." # calling said function... boring() """ Explanation: How to Call Functions... What are functions... Functions are an incredibly useful concept and I will cover them in greater detail later on, I promise. But for now let's just say functions are bits of...
machlearn/ipython-notebooks
ML dataset - Iris.ipynb
mit
from sklearn import datasets iris = datasets.load_iris() X = iris.data y = iris.target X.shape y.shape """ Explanation: This is the best known dataset for doing classification. It contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class is linearly separable from the other ...
Xilinx/meta-petalinux
recipes-multimedia/gstreamer/gstreamer-vcu-notebooks/vcu-demo-transcode-to-file.ipynb
mit
from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:code_toggle()"><input type="submit" value="Click here...
eramirem/numerical-methods-pdes
07_ivp.ipynb
cc0-1.0
%matplotlib inline import numpy import matplotlib.pyplot as plt """ Explanation: <table> <tr align=left><td><img align=left src="https://i.creativecommons.org/l/by/4.0/88x31.png"> <td>Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT license. (c)...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/tensorflow_extended/solutions/penguin_simple.ipynb
apache-2.0
try: import colab !pip install --upgrade pip except: pass """ Explanation: TFX Pipeline Tutorial using Penguin dataset Learning objectives Prepare example data. Create a pipeline. Run the pipeline. Introduction In this notebook, you will create and run a TFX pipeline for a simple classification model. The pipe...
relopezbriega/mi-python-blog
content/downloads/PiDay.ipynb
gpl-2.0
# Pi utilizando el módulo math import math math.pi # Pi utiizando sympy, dps nos permite variar el número de dígitos de Pi from sympy.mpmath import mp mp.dps = 33 # número de dígitos print(mp.pi) """ Explanation: El día Pi Esta notebook fue creada originalmente como un blog post por Raúl E. López Briega en Mi blog s...
kecnry/autofig
docs/tutorials/3d.ipynb
gpl-3.0
import autofig import numpy as np #autofig.inline() t = np.linspace(0,10,31) x = np.random.rand(31) y = np.random.rand(31) z = np.random.rand(31) """ Explanation: Plotting in 3D with autofig End of explanation """ autofig.reset() autofig.plot(x, y, z, i=t, xlabel='x', ylabel='y', zlabel='z') mplfig = ...
tensorflow/docs-l10n
site/ja/tutorials/estimator/boosted_trees_model_understanding.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...