repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
atulsingh0/MachineLearning | MasteringML_wSkLearn/05_Decision_Trees.ipynb | gpl-3.0 | # import
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifier
df ... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/matplotlib/04.09-Text-and-Annotation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.style.use('seaborn-whitegrid')
import numpy as np
import pandas as pd
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Pyt... |
peterwittek/ipython-notebooks | Comparing_DMRG_ED_and_SDP.ipynb | gpl-3.0 | import pyalps
"""
Explanation: Comparing the ground state energies obtained by density matrix renormalization group, exact diagonalization, and an SDP hierarchy
We would like to compare the ground state energy of the following spinless fermionic system [1]:
$H_{\mathrm{free}}=\sum_{<rs>}\left[c_{r}^{\dagger} c_{s}+c_{... |
vzg100/Post-Translational-Modification-Prediction | old/Phosphorylation Sequence Tests -MLP -dbptm+ELM-VectorAvr.-phos_stripped.ipynb | mit | from pred import Predictor
from pred import sequence_vector
from pred import chemical_vector
"""
Explanation: Template for test
End of explanation
"""
par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"]
for i in par:
print("y", i)
y = Predictor()
y.load_data(file="Data/Trainin... |
Timmy-Oh/Generating-Visual-Explanation | XAI.ipynb | mit | import tensorflow as tf
from PIL import Image
import numpy as np
from scipy.misc import imread, imresize
from imagenet_classes import class_names
import os
"""
Explanation: Import
End of explanation
"""
#File Path
# filepath_input = "./data/run/" #input csv file path
filepath_ckpt = "./ckpt/model_weight.ckpt" #wei... |
monicathieu/cu-psych-r-tutorial | public/tutorials/python/3_descriptives/challenge_key.ipynb | mit | # load packages we will be using for this lesson
import pandas as pd
"""
Explanation: Descriptive Statistics Data Challange
Goals of this challenge
Students will test their ability to:
Group and categorize data in Python
Generate descriptive statistics in Python
Using the same dataset as the lesson, complete the f... |
samuelsinayoko/kaggle-housing-prices | research/outlier_detection_statsmodels.ipynb | mit | import numpy as np
import statsmodels.api as sm # For some reason this import is necessary...
import statsmodels.formula.api as smapi
import statsmodels.graphics as smgraph
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Outlier detection
Detect outliers using linear regression model and statsmod... |
bayesimpact/bob-emploi | data_analysis/notebooks/datasets/imt/employment_type_api.ipynb | gpl-3.0 | import os
from os import path
import matplotlib
import pandas as pd
import seaborn as _
DATA_FOLDER = os.getenv('DATA_FOLDER')
employment_types = pd.read_csv(path.join(DATA_FOLDER, 'imt/employment_type.csv'), dtype={'AREA_CODE': 'str'})
employment_types.head()
"""
Explanation: Author: Marie Laure, marielaure@bayesi... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/how_google_does_ml/bigquery_ml/labs/intro_bqml.ipynb | apache-2.0 | import matplotlib.pyplot as plt
"""
Explanation: Introduction to BigQuery ML - Predict Birth Weight
Learning Objectives
Use BigQuery to explore the natality dataset
Create a regression (linear regression) model in BQML
Evaluate the performance of your machine learning model
Make predictions with a trained BQML model
... |
tpin3694/tpin3694.github.io | python/all_combinations_of_a_list_of_objects.ipynb | mit | # Import combinations with replacements from itertools
from itertools import combinations_with_replacement
"""
Explanation: Title: All Combinations For A List Of Objects
Slug: all_combinations_of_a_list_of_objects
Summary: All Combinations For A List Of Objects
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Auth... |
jasonding1354/pyDataScienceToolkits_Base | Scikit-learn/.ipynb_checkpoints/(6)classification_metrics-checkpoint.ipynb | mit | # read the data into a Pandas DataFrame
import pandas as pd
url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data'
col_names = ['pregnant', 'glucose', 'bp', 'skin', 'insulin', 'bmi', 'pedigree', 'age', 'label']
pima = pd.read_csv(url, header=None, names=col_na... |
datamicroscopes/release | examples/normal-inverse-chisquare.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_context('talk')
sns.set_style('darkgrid')
lynx = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/lynx.csv',
index_col=0)
lynx = lynx.set_index('time')
l... |
LeonardoCastro/Servicio_social | Parte 1 - CUDA C/03 - Multiplicacion de vectores.ipynb | mit | %%writefile Programas/Mul_vectores.cu
__global__ void multiplicar_vectores(float * device_A, float * device_B, float * device_C, int TAMANIO)
{
// Llena el kernel escribiendo la multiplicacion de los vectores A y B
}
int main( int argc, char * argv[])
{
int TAMANIO 1000 ;
float h_A[TAMANIO] ;
float h_B... |
GoogleCloudPlatform/bigquery-notebooks | notebooks/community/analytics-componetized-patterns/retail/recommendation-system/bqml-mlops/kfp_tutorial.ipynb | apache-2.0 | # CHANGE the following settings
BASE_IMAGE = "gcr.io/your-image-name"
MODEL_STORAGE = "gs://your-bucket-name/folder-name" # Must include a folder in the bucket, otherwise, model export will fail
BQ_DATASET_NAME = "hotel_recommendations" # This is the name of the target dataset where you model and predictions will be ... |
BrentDorsey/pipeline | gpu.ml/notebooks/01a_Explore_GPU.ipynb | apache-2.0 | %%bash
nvidia-smi
"""
Explanation: Explore GPU
Sanity Check #1:
Run Standard nvidia-smi Tool
End of explanation
"""
%%bash
xla_device_test &> xla_device_test.log
tail -3 xla_device_test.log
"""
Explanation: Sanity Check #2:
Run Accelerated Linear Algebra (XLA) Tests
End of explanation
"""
%%bash
cat /root/... |
machinelearningnanodegree/stanford-cs231 | solutions/pranay/assignment1/features.ipynb | mit | import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloading extenrnal modu... |
science-of-imagination/nengo-buffer | Project/low_pass_training.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
%matplotlib inline
import nengo
import numpy as np
import scipy.ndimage
import matplotlib.animation as animation
from matplotlib import pylab
from PIL import Image
import nengo.spa as spa
import cPickle
import random
from nengo_extras.data import load_mnist
from nengo_extras.vision impo... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/02-ANN-Artificial-Neural-Networks/03-Basic-PyTorch-NN.ipynb | apache-2.0 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from sklearn.model_selection import train_test_split
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: <img src="../Pierian-Data-Logo.PNG">
<br>
<strong><center>Cop... |
DallasTrinkle/Onsager | docs/source/InputOutput.ipynb | mit | import numpy as np
import sys
sys.path.extend(['.', '..'])
from onsager import crystal
"""
Explanation: Input and output for Onsager transport calculation
The Onsager calculators currently include two computational approaches to determining transport coefficients: an "interstitial" calculation, and a "vacancy-mediated... |
mitdbg/modeldb | client/workflows/demos/registry/tensorflow-mnist-end-to-end.ipynb | mit | import os
import tensorflow as tf
# restart your notebook if prompted on Colab
try:
import verta
except ImportError:
!pip install verta
import os
# Ensure credentials are set up, if not, use below
# os.environ['VERTA_EMAIL'] =
# os.environ['VERTA_DEV_KEY'] =
# os.environ['VERTA_HOST'] =
from verta import ... |
abevieiramota/data-science-cookbook | 2017/06-linear-regression/Linear_Regression_Tutorial.ipynb | mit | # Calculate the mean value of a list of numbers
def mean(values):
return sum(values) / float(len(values))
"""
Explanation: Regressão Linear Simples
1. Introdução
A regressão linear é um método de predição com mais de 200 anos de idade. A regressão linear simples é um ótimo primeiro algoritmo de aprendizado de máquin... |
fedhere/ADSgenderclustering | parse_analyze_names.ipynb | mit | from __future__ import print_function, division
import os,sys
import pickle, pprint,csv
import numpy as np
import pylab as pl
%pylab inline
DEBUG = False
NMC = 1000 #number of montecarlo draws
# doing this only for >=3 author papers,
# and limiting the inference to the first 3 authors
maxauth=3
#read in list of nam... |
drakero/Electron_Spectrometer | Lanex_Strip_Test.ipynb | mit | #Imports
from math import *
import numpy as np
import scipy as sp
import scipy.special
import scipy.interpolate as interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import seaborn as sns
import sys
import os
#Import custom modules
from physics import *
%matplotlib n... |
israelzuniga/spark_streaming_class | spark_streaming_class/Spark_Streaming.ipynb | mit | from pyspark import SparkContext
# https://spark.apache.org/docs/latest/api/python/pyspark.streaming.html#pyspark.streaming.StreamingContext
from pyspark.streaming import StreamingContext
sc = SparkContext("local[2]", "NetworkWordCount")
ssc = StreamingContext(sc, 10)
"""
Explanation: Spark Streaming
Spark Streaming ... |
xebia-france/luigi-airflow | Luigi_airflow_002.ipynb | apache-2.0 | raw_dataset = pd.read_csv(source_path + "Speed_Dating_Data.csv")
"""
Explanation: Import data
End of explanation
"""
raw_dataset.head(3)
raw_dataset_copy = raw_dataset
#merged_datasets = raw_dataset.merge(raw_dataset_copy, left_on="pid", right_on="iid")
#merged_datasets[["iid_x","gender_x","pid_y","gender_y"]].hea... |
hetland/python4geosciences | examples/intro.ipynb | mit | import os
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import colors, colorbar
import shapely.geometry as geometry
pd.set_option("display.max_rows", 5) # limit number of rows shown in dataframe
# display plots within the notebook
%matplotlib inline
import seaborn as sns # for better style in pl... |
phoebe-project/phoebe2-docs | 2.3/tutorials/pitch_yaw.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Misalignment (Pitch & Yaw)
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import u # units
import numpy a... |
jinntrance/MOOC | coursera/deep-neural-network/quiz and assignments/RNN/Dinosaurus+Island+--+Character+level+language+model+final+-+v3.ipynb | cc0-1.0 | import numpy as np
from utils import *
import random
"""
Explanation: Character level language model - Dinosaurus land
Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of... |
daniestevez/jupyter_notebooks | dslwp/DSLWP-B orbital parameter analysis.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: DSLWP-B orbital parameter analysis
In this notebook we analyse the Keplerian orbital parameters derived from the DSLWP-B tracking files published by Wei Mingchuan BG2BHC using GMAT. The ECEF cartesian state is loaded from the first line of the tracking file and then the orbit is pro... |
phoebe-project/phoebe2-docs | 2.2/tutorials/atm_passbands.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Atmospheres & Passbands
Setup
Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
"""
%matplotlib inli... |
mdda/deep-learning-workshop | notebooks/2-CNN/4-ImageNet/3-inception-v3_theano.ipynb | mit | import lasagne
from lasagne.layers import InputLayer
from lasagne.layers import Conv2DLayer, Pool2DLayer
from lasagne.layers import DenseLayer
from lasagne.layers import GlobalPoolLayer
from lasagne.layers import ConcatLayer
from lasagne.layers.normalization import batch_norm
import numpy as np
import matplotlib.pyp... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/solutions/basic_retrieval.ipynb | apache-2.0 | !pip install -q tensorflow-recommenders
!pip install -q --upgrade tensorflow-datasets
!pip install -q scann
"""
Explanation: Recommending movies: retrieval
Learning Objectives
In this notebook, we're going to build and train such a two-tower model using the Movielens dataset.
We're going to:
Get our data and split it... |
thehyve/transmart-api-training | EXERCISE TranSMART REST API V2 (2017).ipynb | gpl-3.0 | import getpass
from transmart import TransmartApi
api = TransmartApi(
host = 'http://transmart-test.thehyve.net',
user = input('Username:'),
password = getpass.getpass('Password:'),
apiversion = 2)
api.access()
"""
Explanation: <img style="float: right;" src="files/thehyve_logo.png">
TranSMART 17.1 R... |
zephirefaith/AI_Fall15_Assignments | A3/probability_notebook.ipynb | mit | """Testing pbnt.
Run this before anything else
to get pbnt to work!"""
import sys
# from importlib import reload
if('pbnt/combined' not in sys.path):
sys.path.append('pbnt/combined')
from exampleinference import inferenceExample
# Should output:
# ('The marginal probability of sprinkler=false:', 0.80102921)
#('The... |
angelmtenor/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160601수_11일차_데이터 전처리 Data Preprocessing, (결정론적)선형 회귀 분석 Linear Regression Analysis/3.선형 회귀 분석의 기초.ipynb | mit | from sklearn.datasets import make_regression
bias = 100
X0, y, coef = make_regression(n_samples=100, n_features=1, bias=bias, noise=10, coef=True, random_state=1)
X = np.hstack([np.ones_like(X0), X0])
X[:5]
"""
Explanation: 선형 회귀 분석의 기초
결정론적 모형은 그냥 함수를 찾는 것. 간단한 함수부터 시작을 한다. 간단한 함수는 선형식을 의미하는 듯
선형 회귀 분석은 부호, 크기, 관계 등... |
jljones/portfolio | ds/Webscraping_Craigslist.ipynb | apache-2.0 | # Python 3.4
%pylab inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import requests
from bs4 import BeautifulSoup as bs4
"""
Explanation: Webscraping Craigslist for House Prices in the East Bay
Jennifer Jones, PhD
jennifer.jon
... |
aam-at/tensorflow | tensorflow/lite/g3doc/performance/post_training_integer_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... |
ssunkara1/bqplot | examples/Applications/Wealth of Nations.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import os
from bqplot import (
LogScale, LinearScale, OrdinalColorScale, ColorAxis,
Axis, Scatter, Lines, CATEGORY10, Label, Figure, Tooltip
)
from ipywidgets import HBox, VBox, IntSlider, Play, jslink
initial_year = 1800
"""
Explanation: This is a bqplot recreation of... |
samuelshaner/openmc | docs/source/pythonapi/examples/mgxs-part-i.ipynb | mit | from IPython.display import Image
Image(filename='images/mgxs.png', width=350)
"""
Explanation: This IPython Notebook introduces the use of the openmc.mgxs module to calculate multi-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the following features:
General equ... |
wasit7/PythonDay | notebook/Somkiat's Basic Python.ipynb | bsd-3-clause | x=1
print x
type(x)
x.conjugate()
type(1+2j)
z=1+2j
print z
(1,2)
t=(1,2,"text")
t
t
def foo():
return (1,2)
x,y=foo()
print x
print y
def swap(x,y):
return (y,x)
x=1;y=2
print "{0:d} {1:d}".format(x,y)
x,y=swap(x,y)
print "{:f} {:f}".format(x,y)
dir(1)
x=[]
x.append("text")
x
x.append(1)
x.p... |
mommermi/Introduction-to-Python-for-Scientists | notebooks/Function_Fitting_20161028.ipynb | mit | # matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# read in signal.csv
data = np.genfromtxt('signal.csv', delimiter=',',
dtype=[('x', float), ('y', float), ('yerr', float)])
"""
Explanation: Example: Function Fitting
This example involves basic plotting with Matplotlib and f... |
jrmontag/Data-Science-45min-Intros | text-comparison/text_comparison.ipynb | unlicense | import itertools
import nltk
import operator
import numpy as np
import sklearn
from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer
"""
Explanation: Introduction
There is a perception that Twitter data can be used to surface insights: unexpected features of the data that have business value. In... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec6_4_4_Theis_Hantush_implementations.ipynb | gpl-3.0 | import numpy as np
from scipy.integrate import quad
from scipy.special import exp1
import matplotlib.pyplot as plt
from timeit import timeit
import pdb
# Handy for object inspection:
attribs = lambda obj: [o for o in dir(obj) if not o.startswith('_')]
def newfig(title='title', xlabel='xlabel', ylabel='ylabel',
... |
usantamaria/iwi131 | ipynb/08-EjerciciosRuteoFuncionesCondicionales/Ejercicios.ipynb | cc0-1.0 | def mi_funcion(x,y,z):
a = x * y * z
b = x/2 + y/4 + z/8
c = a + b
return c
a = 1.0
b = 2.0
a = mi_funcion(a, b, 3.0)
print a
"""
Explanation: <header class="w3-container w3-teal">
<img src="images/utfsm.png" alt="" align="left"/>
<img src="images/inf.png" alt="" align="right"/>
</header>
<br/><br/><b... |
franciscodominguezmateos/DeepLearningNanoDegree | 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... |
fastai/fastai | nbs/42_tabular.model.ipynb | apache-2.0 | #|export
def emb_sz_rule(
n_cat:int # Cardinality of a category
) -> int:
"Rule of thumb to pick embedding size corresponding to `n_cat`"
return min(600, round(1.6 * n_cat**0.56))
#|export
def _one_emb_sz(classes, n, sz_dict=None):
"Pick an embedding size for `n` depending on `classes` if not given in ... |
gregmedlock/Medusa | docs/medusa_objects.ipynb | mit | import medusa
from medusa.test.test_ensemble import construct_textbook_ensemble
example_ensemble = construct_textbook_ensemble()
"""
Explanation: Introduction to Medusa
Loading an example ensemble and inspecting its parts
In medusa, ensembles of genome-scale metabolic network reconstructions (GENREs) are represented ... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage2/get_started_vertex_training_sklearn.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
arcyfelix/Courses | In Progress - Deep Learning - The Straight Dope/01 - Crash Course/05 - Problem Set.ipynb | apache-2.0 | import mxnet as mx
mx.random.seed(1)
"""
Explanation: Problem Set
"For the things we have to learn before we can do them, we learn by doing them." - Aristotle
There's nothing quite like working with a new tool to really understand it, so we have put together some exercises through this book to give you a chance to put... |
BadWizard/Inflation | Disaggregated-Data/weather-like-plot-HICP-by-item.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
import numpy as np
from matplotlib.ticker import FixedLocator, FixedFormatter
#import seaborn as sns
to_colors = lambda x : x/255.
ls
df_ind_items = pd.read_csv('raw_data_items.csv',header=0,index_col=0,parse_dates=... |
jo-tez/aima-python | search4e.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import random
import heapq
import math
import sys
from collections import defaultdict, deque, Counter
from itertools import combinations
class Problem(object):
"""The abstract class for a formal problem. A new domain subclasses this,
overriding `actions` and ... |
dataventures/workshops | 2/1 - SVM.ipynb | mit | from IPython.display import Image
from IPython.core.display import HTML
"""
Explanation: Support Vector Machines
Support vector machines (SVMs) are among the most powerful and commonly used models for supervised classification. Today, we will look at the intuition and mathematics behind SVM classifiers, then use them... |
dsacademybr/PythonFundamentos | Cap07/DesafioDSA/Missao5/missao5.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 7</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Impor... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/text_classification/labs/rnn_encoder_decoder.ipynb | apache-2.0 | import os
import pickle
import sys
import nltk
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.keras.layers import (
Dense,
Embedding,
GRU,
Input,
)
from tensorflow.keras.models import (
load_model,
Model,
)
im... |
mkcor/advanced-pandas | notebooks/03_multiindex.ipynb | cc0-1.0 | import pandas as pd
mlo = pd.read_csv('../data/co2-mm-mlo.csv', na_values=-99.99, index_col='Date', parse_dates=True)
mlo.head()
s = mlo['Interpolated']
mlo.assign(smooth=s.rolling(12).mean()).tail()
"""
Explanation: The MultiIndex object
View vs copy
End of explanation
"""
mlo.head()
s2 = mlo.loc[:'1958-05', '... |
Chipe1/aima-python | search4e.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import random
import heapq
import math
import sys
from collections import defaultdict, deque, Counter
from itertools import combinations
class Problem(object):
"""The abstract class for a formal problem. A new domain subclasses this,
overriding `actions` and ... |
wtbarnes/aia_response | notebooks/calculating_temperature_response_functions.ipynb | mit | import json
import numpy as np
import h5py
import seaborn as sns
from scipy.interpolate import splev,splrep
import matplotlib.pyplot as plt
import astropy.units as u
from sunpy.instr import aia
import ChiantiPy.core as ch
import ChiantiPy.tools.data as ch_data
%matplotlib inline
"""
Explanation: AIA Temperature Resp... |
simpleblob/ml_algorithms_stepbystep | algo_example_NN_multilayer_FNN.ipynb | mit | from sklearn.datasets import load_digits
digits = load_digits(n_class=10)
print type(digits)
import random
digits_sample = random.sample(range(0,digits.images.shape[0]),10)
print digits_sample
#show sample digits
plt.rcParams['figure.figsize'] = (12, 4)
f, axarr = plt.subplots(2, 5)
for j in range(0,axarr.shape[1]):
... |
wllmtrng/udacity_data_analyst_nanodegree | P0 Relationships/Data_Analyst_ND_Project0.ipynb | mit | import pandas as pd
# pandas is a software library for data manipulation and analysis
# We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd.
# hit shift + enter to run this cell or block of code
path = r'./chopstick-effectiveness.csv'
# Change the path to the location where the c... |
EvenStrangest/tensorflow | tensorflow/examples/udacity/5_word2vec.ipynb | apache-2.0 | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
%matplotlib inline
from __future__ import print_function
import collections
import math
import numpy as np
import os
import random
import tensorflow as tf
import zipfile
from matplotlib import pylab
from six.mov... |
mercybenzaquen/foundations-homework | databases_hw/db06/Homework_6.ipynb | mit | import requests
data = requests.get('http://localhost:5000/lakes').json()
print(len(data), "lakes")
for item in data[:10]:
print(item['name'], "- elevation:", item['elevation'], "m / area:", item['area'], "km^2 / type:", item['type'])
"""
Explanation: Homework 6: Web Applications
For this homework, you're going to... |
SnShine/aima-python | planning.ipynb | mit | from planning import *
"""
Explanation: Planning: planning.py; chapters 10-11
This notebook describes the planning.py module, which covers Chapters 10 (Classical Planning) and 11 (Planning and Acting in the Real World) of Artificial Intelligence: A Modern Approach. See the intro notebook for instructions.
We'll start... |
cehbrecht/demo-notebooks | wps-cfchecker.ipynb | apache-2.0 | from owslib.wps import WebProcessingService
token = 'a890731658ac4f1ba93a62598d2f2645'
headers = {'Access-Token': token}
wps = WebProcessingService("https://bovec.dkrz.de/ows/proxy/hummingbird", verify=False, headers=headers)
"""
Explanation: Init WPS with cfchecker proceses
hummingbird caps url: https://bovec.dkrz.... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-3/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-3', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-3
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection... |
mne-tools/mne-tools.github.io | 0.22/_downloads/d5dd378a96a427683b4c918f7cdf9064/plot_ssd_spatial_filters.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis.engemann@gmail.com>
# Victoria Peterson <victoriapeterson09@gmail.com>
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne import Epochs
from mne.datasets.fieldtrip_cmc import data_path
from mne.decoding import SSD
"""
Explanation: Compute Sepctro-... |
Naereen/notebooks | Une_exploration_visuelle_de_l_algorithme_du_Simplexe_en_3D_avec_Python.ipynb | mit | from IPython.display import YouTubeVideo
# https://www.youtube.com/watch?v=W_U8ozVsh8s
YouTubeVideo("W_U8ozVsh8s", width=944, height=531)
"""
Explanation: Une exploration visuelle de l'algorithme du Simplexe en 3D avec Python
Dans ce notebook (utilisant Python 3), je souhaite montrer des animations de l'algorithme du ... |
amirziai/learning | algorithms/Spanning-Tree-with-Message-Passing.ipynb | mit | %matplotlib inline
import networkx as nx
"""
Explanation: Spanning Tree with Message Passing
End of explanation
"""
clique = nx.Graph()
clique.add_nodes_from([1, 2, 3])
clique.add_edges_from([(1, 2), (1, 3), (3, 2)])
nx.draw_networkx(clique)
"""
Explanation: Spanning tree of an undirected graph is a tree which in... |
ueapy/ueapy.github.io | content/notebooks/2016-05-06-classes.ipynb | mit | s = 'hello world'
"""
Explanation: We start with the introduction from Python docs [1]
Compared with other programming languages, Python’s class mechanism adds classes with a minimum of new syntax and semantics. It is a mixture of the class mechanisms found in C++ and Modula-3. Python classes provide all the standard... |
SebastianBocquet/pygtc | Planck-vs-WMAP.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina' # For mac users with Retina display
import numpy as np
from matplotlib import pyplot as plt
import pygtc
"""
Explanation: Example 2: Making a GTC/triangle plot with Planck and WMAP data!
This example is built from a jupyter notebook hosted on the pyGTC... |
mgalardini/2017_python_course | notebooks/[4a]-Exercises-solutions.ipynb | gpl-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Data visualization: exercises
End of explanation
"""
plt.figure(figsize=(18, 7))
words = {}
for line in open('../data/aristotle.txt'):
for word in line.rstrip().split():
words[word] = words.get(word, 0)
words[word] += 1
plt.ba... |
AlCap23/Thesis | Python/FOTD-Design-Simple.ipynb | gpl-3.0 | # Import the needed packages, SymPy
import sympy as sp
from sympy import init_printing
init_printing()
# Define the variables
# Complex variable
s = sp.symbols('s')
# FOTD Coeffficients
T1,T2,T3,T4 = sp.symbols('T_11 T_12 T_21 T_22')
K1,K2,K3,K4 = sp.symbols('K_11 K_12 K_21 K_22')
# Time Delay Coefficients
L1,L2,L3,L4... |
tensorflow/lucid | notebooks/building-blocks/SemanticDictionary.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
massimo-nocentini/simulation-methods | notes/matrices-functions/exp-Pascal.ipynb | mit | from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, alpha
from commons import *
from matrix_functions import *
from sequences import *
import functions_catalog
init_printing()
"""
Explanation: <p>
<img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg"
alt="... |
drivendata/data-science-is-software | notebooks/labs/3.0-refactoring-solution.ipynb | mit | %matplotlib inline
from __future__ import print_function
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
PROJ_ROOT = os.path.join(os.pardir, os.pardir)
"""
Explanation: <table style="width:100%; border: 0px solid black;">
<tr style="width: 100%; border: 0px solid black;">
... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Programming/Python/Python3Espanol/1_Introduccion/01. Introduccion.ipynb | gpl-3.0 | print(10)
print("Hola")
print("Hola","como","estas")
print("Hola como estas")
print("Uno mas uno es:",2)
# Esto es un comentario
print("Uno mas uno es:",2) # Esto también
"""
Explanation: Cazando Planetas con Python
¿Te has preguntado cómo los científicos encuentran planetas en otros sistemas solares?
Resumen
En ... |
m2dsupsdlclass/lectures-labs | labs/06_deep_nlp/NLP_word_vectors_classification_rendered.ipynb | mit | import numpy as np
from sklearn.datasets import fetch_20newsgroups
newsgroups_train = fetch_20newsgroups(subset='train')
newsgroups_test = fetch_20newsgroups(subset='test')
sample_idx = 1000
print(newsgroups_train["data"][sample_idx])
target_names = newsgroups_train["target_names"]
target_id = newsgroups_train["tar... |
analysiscenter/dataset | examples/experiments/learning_rate_schedulers/research_learning_rate_schedulers.ipynb | apache-2.0 | import sys
import numpy as np
sys.path.append('../../..')
from batchflow import Pipeline, B, V, C
from batchflow.opensets import Imagenette160
from batchflow.models.torch import ResNet34
from batchflow.models.metrics import ClassificationMetrics
from batchflow.research import Research, Option, Results, KV, RP
from ba... |
southpaw94/MachineLearning | TextExamples/3547_13_Code.ipynb | gpl-2.0 | %load_ext watermark
%watermark -a 'Sebastian Raschka' -u -d -v -p numpy,matplotlib,theano,keras
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
"""
Explanation: Sebastian Raschka, 2015
Python Machine Learning
Chapter 13 - Pa... |
bradkav/runDM | python/runDM-examples.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib
from matplotlib import pyplot as pl
import runDM
"""
Explanation: runDM v1.0 - examples
With runDMC, It's Tricky. With runDM, it's not.
runDM is a tool for calculating the running of the couplings of Dark Matter (DM) to the Standard Model (SM) in simplified mode... |
palrogg/foundations-homework | 07/.ipynb_checkpoints/Homework7-JOINS-checkpoint.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv("07-hw-animals.csv")
df.columns
df.head(3)
df.sort_values(by='length', ascending=False).head(3)
df['animal'].value_counts()
dogs = df[df['animal']=='dog']
dogs
df[df['length'] > 40]
df['inches'] = .393701 * df['length']
df
... |
tata-antares/tagging_LHCb | MC/ss_os_training.ipynb | apache-2.0 | %pylab inline
import sys
sys.path.insert(0, "../")
"""
Explanation: About
Training of the BDT to define if track comes from the same side or opposite side.
Labels:
* 0 (NAN), cannot establish SS or OS
* -1 (OS) - opposite side tracks (good agreement with indeed OS tracks)
* 1 (SS) - tracks grandmother, grand... |
TimothyHelton/k2datascience | notebooks/Classification_Exercises.ipynb | bsd-3-clause | from k2datascience import classification
from k2datascience import plotting
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
%matplotlib inline
"""
Explanation: Classification
Timothy Helton
<br>
<font color="red">
NOTE:
<br>
This notebook uses co... |
eds-uga/csci1360-fa16 | lectures/L14.ipynb | mit | file_object = open("alice.txt", "r")
contents = file_object.read()
print(contents[:71])
file_object.close()
"""
Explanation: Lecture 14: Interacting with the filesystem
CSCI 1360: Foundations for Informatics and Analytics
Overview and Objectives
So far, all the data we've worked with have either been manually instanti... |
NYUDataBootcamp/Projects | UG_S16/Aung-Merrick-NYC311Requests.ipynb | mit | import pandas as pd
url1='...'
url2='/Aung-Merrick-NYC311Requests/DataBootcamp311Data.csv'
url= url1+url2
data= pd.read_csv(url)
"""
Explanation: Data Bootcamp Project
Lu Maw Aung, Patrick Merrick
An Analysis of NYC 311 Service Requests from 2010/16
May 12, 2016
311 is New York City's main source of government inform... |
GregDMeyer/dynamite | examples/1-BuildingOperators.ipynb | mit | from dynamite.operators import sigmax, sigmay, sigmaz, index_product
# product of sigmaz along the spin chain up to index k
k = 4
index_product(sigmaz(), size=k)
# with that, we can easily build our operator
def majorana(i):
k = i//2
edge_op = sigmay(k) if (i%2) else sigmax(k)
bulk = index_product(sigmaz(... |
AllenDowney/ProbablyOverthinkingIt | multinorm.ipynb | mit | from __future__ import print_function, division
import numpy as np
import pandas as pd
from scipy.stats import multivariate_normal, wishart
from itertools import product, starmap
import thinkbayes2
import thinkplot
%matplotlib inline
"""
Explanation: Bayesian estimation with multivariate normal disributions
Copyri... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_introduction.ipynb | bsd-3-clause | import mne
"""
Explanation: Basic MEG and EEG data processing
MNE-Python reimplements most of MNE-C's (the original MNE command line utils)
functionality and offers transparent scripting.
On top of that it extends MNE-C's functionality considerably
(customize events, compute contrasts, group statistics, time-frequenc... |
y2ee201/Deep-Learning-Nanodegree | sentiment-rnn/Sentiment RNN.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment_network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment_network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/homework/HW3/Homework_3_SOLUTIONS.ipynb | agpl-3.0 | # put your code here
%matplotlib inline
import matplotlib.pyplot as plt
import random
import numpy as np
import numpy.random as rand
# takes nothing, returns an xstep, ystep pair
def step2d():
'''
step2d picks a random direction to step in (+/-x, +/-y).
Takes no arguments, returns an xstep, ystep pair.
... |
nik-hil/fastai | deeplearning1/nbs/lesson1.ipynb | apache-2.0 | # step to run on theano. Data is mounted at /data
# floyd run --mode jupyter --gpu --env theano:py2 --data rarce/datasets/dogsvscats/1:data
# if bcolz gives error, uncomment and run
# !pip install bcolz
# if keras gives error on importing l2, uncomment and run following
# !pip uninstall -y keras
# !pip install keras==... |
opensanca/trilha-python | 01-python-intro/aula-04/Aula 04.ipynb | mit | '{} + {} = {}'.format(10, 10, 20)
"""
Explanation: [Py-Intro] Aula 04
Tipos básicos e estruturas de controles
O que você vai aprender nesta aula?
Após o término da aula você terá aprendido:
Formatação de strings
Conjuntos: set
Mapeamentos: dicionários
Formatação de strings
Complementando a aula passada será explicad... |
MartyWeissman/Python-for-number-theory | PwNT Notebook 6.ipynb | gpl-3.0 | W = "Hello"
print W
for j in range(len(W)): # len(W) is the length of the string W.
print W[j] # Access the jth character of the string.
"""
Explanation: Part 6: Ciphers and Key exchange
In this notebook, we introduce cryptography -- how to communicate securely over insecure channels. We begin with a study of ... |
liganega/Gongsu-DataSci | ref_materials/exams/2017/A02/final-a02.ipynb | gpl-3.0 | from __future__ import division, print_function
import numpy as np
import pandas as pd
from datetime import datetime as dt
"""
Explanation: 2017년 2학기 공업수학 기말고사 시험지
이름:
학번:
모듈 임포트
코드를 실행하기 위해 필요한 모듈들이다.
End of explanation
"""
a = np.arange(1, 12, 2)
b = a.reshape(3,2)
b
"""
Explanation: 넘파이 어레이
아래 모양의 어레이를 생성하기 위해 r... |
jennybrown8/python-notebook-coding-intro | lesson5exercises.ipynb | apache-2.0 | count = 0
while (count < 5):
print "Still going! ", count
count = (count + 1)
print "All done!"
"""
Explanation: Lesson 5: While Loops
Here's a code example of a while loop. You can refer to it for ideas.
End of explanation
"""
text = "Hello, "
text = text + "Jenny. "
text = text + "How are you today? "
print... |
coolharsh55/advent-of-code | 2016/python3/Day14.ipynb | mit | import re
three_repeating_characters = re.compile(r'(.)\1{2}')
with open('../inputs/day14.txt', 'r') as f:
salt = f.readline().strip()
# TEST DATA
# salt = 'abc'
print(salt)
"""
Explanation: Day 14: One-Time Pad
author: Harshvardhan Pandit
license: MIT
link to problem statement
In order to communicate sec... |
pichot/citibike-publicspace | notebooks/1.7-kk-process-income.ipynb | mit | income = pd.read_excel("../data/unique/ACS_14_5YR_B19013.xls")
income = income.loc[8:]
income.head()
income = income.drop(['Unnamed: 1', 'Unnamed: 2', 'Unnamed: 3'], axis=1)
income = income.rename(columns={'B19013: MEDIAN HOUSEHOLD INCOME IN THE PAST 12 MONTHS (IN 2014 INFLATION-ADJUSTED DOLLARS) - Universe: Househo... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day23-agent-based-modeling-day1/Day_23_pre_class_notebook-SOLUTIONS.ipynb | agpl-3.0 | # Put your code here!
import numpy as np
A = np.zeros((10,10), dtype='int')
for i in range(a.shape[0]):
for j in range(a.shape[1]):
A[i,j] = i+j
print(A)
"""
Explanation: Day 23 Pre-class assignment
Goals for today's pre-class assignment
In this pre-class assignment, you will:
Create and slic... |
martinjrobins/hobo | examples/sampling/nuts-mcmc.ipynb | bsd-3-clause | import pints
import pints.toy as toy
import pints.plot
import numpy as np
import matplotlib.pyplot as plt
# Load a forward model
model = toy.LogisticModel()
# Create some toy data
real_parameters = np.array([0.015, 500])
times = np.linspace(0, 1000, 50)
org_values = model.simulate(real_parameters, times)
# Add noise... |
srnas/barnaba | examples/example_09_cluster.ipynb | gpl-3.0 | import glob
import barnaba as bb
import numpy as np
flist = glob.glob("snippet/*.pdb")
if(len(flist)==0):
print("# You need to run the example example8_snippet.ipynb")
exit()
# calculate G-VECTORS for all files
gvecs = []
for f in flist:
gvec,seq = bb.dump_gvec(f)
assert len(seq)==4
gvecs.ext... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.