repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
takahish/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... |
chrlttv/Teaching | Session3/2.TextClassification.ipynb | mit | import numpy as np
# Write code to import CountVectorizer
from ...
raw_docs_sample = ["The dog sat on the mat.",
"The cat sat on the mat!",
"We have a mat in our house."]
# Write code to create a CountVectorizer
# Hint: use "stop_word" argument to specify English stop words
vec... |
facebookincubator/prophet | notebooks/uncertainty_intervals.ipynb | bsd-3-clause | %%R
m <- prophet(df, interval.width = 0.95)
forecast <- predict(m, future)
forecast = Prophet(interval_width=0.95).fit(df).predict(future)
"""
Explanation: By default Prophet will return uncertainty intervals for the forecast yhat. There are several important assumptions behind these uncertainty intervals.
There are ... |
tensorflow/lucid | notebooks/tutorial.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... |
enakai00/jupyter_NikkeiLinux | No4/Figure8 - Graviation.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
%matplotlib nbagg
"""
Explanation: [2-1] 動画作成用のモジュールをインポートして、動画を表示可能なモードにセットします。
End of explanation
"""
fig = plt.figure(figsize=(4,4))
x = 0
y, vy = 0, 0
images = []
for _ in range(25):
image = plt.scatter([x],[y])
... |
anukarsh1/deep-learning-coursera | Improving Deep Neural networks- Hyperparameter Tuning - Regularization and Optimization/Tensorflow Tutorial.ipynb | mit | import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
%matplotlib inline
np.random.seed(1)
"""
Explanation: TensorFlow Tutorial
Welcome to this w... |
eugeniopacceli/ComputerVision | quiz2/.ipynb_checkpoints/Quiz2 final - Image Processing - Kernel -checkpoint.ipynb | mit | %matplotlib inline
import numpy as np
import cv2
import matplotlib.pyplot as plt
#image is height: 480, width: 640
#M:u:x:col:width
#N:v:y:row:height
#Calculate (u,v) distance from center of image
def getDValue(u,v,w,h):
return np.sqrt((u - (w/2.0))**2 + (v - (h/2.0))**2)
"""
Explanation: Quiz 2 - Image Proces... |
zzsza/Datascience_School | 27. 모형 최적화/01. 모형 하이퍼 파라미터 튜닝.ipynb | mit | from sklearn.datasets import load_digits
from sklearn.svm import SVC
from sklearn.learning_curve import validation_curve
digits = load_digits()
X, y = digits.data, digits.target
param_range = np.logspace(-6, -1, 10)
%%time
train_scores, test_scores = \
validation_curve(SVC(), X, y,
param_na... |
jessicaowensby/We-Rise-Keras | notebooks/02_Convolution1D_for_text_classification.ipynb | apache-2.0 | from __future__ import print_function
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.layers import Embedding
from keras.layers import Conv1D, GlobalMaxPooling1D
from keras.datasets import imdb
import numpy as np
import matplo... |
MLWave/kepler-mapper | docs/notebooks/Confidence-Graphs.ipynb | mit | %matplotlib inline
import keras
from keras import backend as K
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import Adam
import kmapper as km
import numpy as np
import pandas as pd
from sklearn import metrics, cluster, preprocessing
... |
jmhsi/justin_tinker | data_science/courses/temp/tutorials/linalg_pytorch.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
from fastai.imports import *
from fastai.torch_imports import *
from fastai.io import *
"""
Explanation: All the Linear Algebra You Need for AI
The purpose of this notebook is to serve as an explanation of two crucial linear algebra operations used when coding neural networks: matri... |
rocketproplab/Guides | Guides/algorithms/Sorting.ipynb | mit | import numpy as np
"""
Explanation: Sorting Algorithms
End of explanation
"""
def quicksort(arr,low,high):
pivot = arr[low] # pivot on the first value in the array
j = low # index of smaller element
for i in range(low,high):
if arr[i] <= pivot:
print('swap')
swap(arr,i,j... |
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Phosphorylation Sequence Tests -Forest-checkpoint.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... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/miroc-es2l/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'miroc-es2l', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: MIROC
Source ID: MIROC-ES2L
Topic: Ocean
Sub-Topics: Timestepping Framework, Advec... |
Danghor/Formal-Languages | Python/RegExp-Parser.ipynb | gpl-2.0 | import re
"""
Explanation: A Parser for Regular Expression
This notebook implements a parser for regular expressions. The parser that is implemented in the function parseExpr parses a regular expression
according to the following <em style="color:blue">EBNF grammar</em>.
regExp -> product ('+' product)*
produc... |
ALEXKIRNAS/DataScience | CS231n/assignment2/FullyConnectedNets.ipynb | mit | # As usual, a bit of setup
from __future__ import print_function
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solv... |
ComputationalModeling/spring-2017-danielak | past-semesters/spring_2016/day-by-day/day04-flint-water-data-analysis/Day_4_Pre_Class_Notebook.ipynb | agpl-3.0 | # Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.
# You need to run this cell before you run ANY of the YouTube videos.
from IPython.display import YouTubeVideo
# Display a specific YouTube video, with a given width and height.
# WE STRONGLY RECOMMEND that you can watch t... |
phoebe-project/phoebe2-docs | 2.2/tutorials/spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Binary with Spots
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 inline
im... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/text_classification/solutions/automl_for_text_classification.ipynb | apache-2.0 | import os
from google.cloud import bigquery
import pandas as pd
%load_ext google.cloud.bigquery
"""
Explanation: AutoML for Text Classification
Learning Objectives
Learn how to create a text classification dataset for AutoML using BigQuery
Learn how to train AutoML to build a text classification model
Learn how to ... |
dfm/AstroHackWeek2015 | day1/day1_ecosystem.ipynb | gpl-2.0 | from __future__ import print_function
import math
import numpy as np
"""
Explanation: Orienting Yourself
Image: @jakevdp
How to install packages using conda
If you're using anaconda, you probably already have most (if not all) of these installed. If you installed miniconda:
conda install numpy
Conda also has channel... |
gboeing/pynamical | examples/pynamical-quick-overview.ipynb | mit | from pynamical import logistic_map, simulate, bifurcation_plot
"""
Explanation: Pynamical: quick overview
Citation info: Boeing, G. 2016. "Visual Analysis of Nonlinear Dynamical Systems: Chaos, Fractals, Self-Similarity and the Limits of Prediction." Systems, 4 (4), 37. doi:10.3390/systems4040037.
Pynamical documentat... |
williamstern/Intro-to-CS-MIT-Course | Copy_of_Introduction_to_CNNs_Handout.ipynb | mit | !pip3 install http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl
!pip3 install torchvision
!pip3 install numpy
!pip3 install matplotlib
!pip3 install seaborn
"""
Explanation: View in Colaboratory
Classifying Handwritting using Convolutional Neural Networks
In this example we are going t... |
tjwei/HackNTU_Data_2017 | Week03/02-Handle TripInformation.ipynb | mit | import tqdm
import tarfile
import pandas
from urllib.request import urlopen
# 檔案名稱格式
filename_format="M06A_{year:04d}{month:02d}{day:02d}.tar.gz".format
xz_filename_format="xz/M06A_{year:04d}{month:02d}{day:02d}.tar.xz".format
csv_format = "M06A/{year:04d}{month:02d}{day:02d}/{hour:02d}/TDCS_M06A_{year:04d}{month:02d}... |
seg/2016-ml-contest | dagrha/RFC_submission_4_dagrha.ipynb | apache-2.0 | import pandas as pd
import numpy as np
from math import radians, cos, sin, asin, sqrt
import itertools
from sklearn import neighbors
from sklearn import preprocessing
from sklearn import ensemble
from sklearn.model_selection import LeaveOneGroupOut, LeavePGroupsOut
import inversion
import matplotlib.pyplot as plt
im... |
tensorflow/docs-l10n | site/zh-cn/hub/tutorials/text_classification_with_tf_hub_on_kaggle.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... |
mne-tools/mne-tools.github.io | 0.19/_downloads/ba93e79a900327aac9ad4c8f17e818c8/plot_brainstorm_phantom_elekta.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import find_events, fit_dipole
from mne.datasets.brainstorm import bst_phantom_elekta
from mne.io import read_raw_fif
print(__doc__)
"""
Explanatio... |
CommonClimate/teaching_notebooks | GEOL351/MOC_stability.ipynb | mit | import numpy as np
%matplotlib inline
from scipy.integrate import odeint
import matplotlib.pyplot as plt
plt.style.use('ggplot') # this will make the plots look professional, as opposed to the god-awful default
"""
Explanation: Stability analysis of the Meridional Overturning Circulation
As seen in class, Stommel [1... |
dnxbjyj/python-basic | object/handout.ipynb | mit | class Person(object):
pass
"""
Explanation: python面向对象基础
本文主要讲述python面向对象的一些基础语法。
创建对象及对象的属性
创建一个名为Person类,继承自object类(object类是所有类的祖先类),类体为空:
End of explanation
"""
p1 = Person()
"""
Explanation: 创建一个Person类的实例:
End of explanation
"""
p1.name = 'Tom'
print p1.name
"""
Explanation: 为p1动态添加一个'name'属性:
End of ex... |
dtamayo/rebound | ipython_examples/VariationalEquations.ipynb | gpl-3.0 | import rebound
import numpy as np
%matplotlib inline
import matplotlib;
import matplotlib.pyplot as plt
"""
Explanation: Variational Equations
For a complete introduction to variational equations, please read the paper by Rein and Tamayo (2016).
For this tutorial, we work with a two planet system. We vary the initial ... |
goddoe/CADL | session-3/session-3.ipynb | apache-2.0 | # First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n' \
'You should consider updating to Python 3.4.0 or ' \
'higher as the libraries built for this course ' \
'have only been tested in Python 3.4 and higher.\n'... |
phoebe-project/phoebe2-docs | 2.2/examples/minimal_synthetic.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
%matplotlib inline
"""
Explanation: Minimal Example to Produce a Synthetic Light Curve
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 rel... |
iRipVanWinkle/ml | Data Science UA - September 2017/Lecture 09 - Data Mining and Machine Learning/Decision_Trees.ipynb | mit | from __future__ import division
from collections import Counter, defaultdict
from functools import partial
import math, random
"""
Explanation: Classification Problem with Decision Trees
Getting data.
Creating a Decision Tree.
Plotting results.
Sample code from "Data Science from Scratch" by Joel Grus, O'Reilly Me... |
zzsza/Datascience_School | 10. 기초 확률론3 - 확률 분포 모형/12. 디리클레 분포.ipynb | mit | from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
fig = plt.figure()
ax = Axes3D(fig)
x = [1,0,0]
y = [0,1,0]
z = [0,0,1]
verts = [zip(x, y,z)]
ax.add_collection3d(Poly3DCollection(verts, edgecolor="k", lw=5, alpha=0.4))
ax.text(1, 0, 0, "(1,0,0)", position=(0.7,0.1))
ax.t... |
Gezort/YSDA_deeplearning17 | Seminar3/classwork/Classwork_week3.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from classwork_auxiliary import eval_numerical_gradient,eval_numerical_gradient_array,rel_error
"""
Explanation: My first neural network
Today we're gonna utilize the dark magic from previous assignment to write a neural network in pure numpy.
End o... |
jkthompson/pyspark-pictures | pyspark-pictures.ipynb | mit | import IPython
print("pyspark version:" + str(sc.version))
print("Ipython version:" + str(IPython.__version__))
"""
Explanation: <a>
<img align=left src="files/images/pyspark-page1.svg" width=500 height=250 />
</a>
DataFrame API
GitHub
related blog post
<a>
<img align=left src="files/images/pyspark-page2.svg" width=... |
amitkaps/machine-learning | time_series/6-Insight.ipynb | mit | # Import the library we need, which is Pandas and Matplotlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# import seaborn as sns
# Set some parameters to get good visuals - style to ggplot and size to 15,10
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = (15, 10)
... |
radhikapc/foundation-homework | homework_sql/Homework_2_Radhika_graded.ipynb | mit | import pg8000
conn = pg8000.connect(user='postgres', password='password', database="homework2_radhika")
"""
Explanation: Grade: 6 / 6 -- but search "TA-COMMENT" to see a few notes on some of the problems.
Homework 2: Working with SQL (Data and Databases 2016)
This homework assignment takes the form of an IPython Noteb... |
leomrtns/genefam-dist | docs/001.Whidden_USPR_comparison.ipynb | gpl-3.0 | %reload_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import sys, subprocess, time, dendropy
import numpy as np
bindir="/home/leo/local/bin/"
localdir="/tmp/"
def run_uspr (tree1, tree2, fast = False):
localfile = localdir + "pair.tre"
dendropy.TreeList([tre... |
roebius/deeplearning_keras2 | nbs/wordvectors.ipynb | apache-2.0 | def get_glove(name):
with open(path+ 'glove.' + name + '.txt', 'r') as f: lines = [line.split() for line in f]
words = [d[0] for d in lines]
vecs = np.stack(np.array(d[1:], dtype=np.float32) for d in lines)
wordidx = {o:i for i,o in enumerate(words)}
save_array(res_path+name+'.dat', vecs)
pickle... |
lilleswing/deepchem | examples/tutorials/23_Synthetic_Feasibility_Scoring.ipynb | mit | !curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import conda_installer
conda_installer.install()
!/root/miniconda/bin/conda info -e
!pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Tutorial Part 23: Synthetic Feasibility... |
wmarshall484/streamsx.topology | samples/python/topology/notebooks/NetDemo/NetDemo.ipynb | apache-2.0 | %matplotlib inline
%matplotlib notebook
import numpy as np, math
import matplotlib.pyplot as plt
from pybrain.datasets import SupervisedDataSet
from pybrain.structure import SigmoidLayer, LinearLayer
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers import BackpropTrainer
# Create samp... |
leoferres/prograUDD | labs/21.ejercicio_dict2.ipynb | mit | simbolos = {"AC" : (89, "Actinio"), "AG" : (47, "Plata"), "AL" : (13, "Aluminio"), "AM" : (95, "Americio"),
"AR" : (18, "Argón"), "AS" : (33, "Arsénico"), "AT" : (85, "Astato"), "AU" : (79, "Oro"),
"B" : (5, "Boro"), "BA" : (56, "Bario"), "BE" : (4, "Berilio"), "BH" : (107, "Bohrio"),
"BI" : (83, "Bismuto")... |
AllenDowney/ThinkStats2 | solutions/chap02soln.ipynb | gpl-3.0 | import numpy as np
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretrieve
local, _ = urlretrieve(url, filename)
print("Downloaded " + local)
download("https://github.com/AllenDowney/ThinkStats... |
iktakahiro/ipython-notebook-sample | pyladies/pyladies-tokyo-6-lt-sympy.ipynb | mit | import sympy
# 記号の定義
x, y = sympy.symbols('x y')
# 式の定義
expr = 2 * x + y
print('定義された式:\n', expr)
# x, y に数値を代入
a1 = expr.subs([(x, 4), (y, 3)])
print('\nx=4, Y=3の場合:\n', a1)
a2 = expr - y
print('\nexpr から y をマイナス:\n', a2)
"""
Explanation: SymPyとチャート式で復習する高校数学I - PyLadies Tokyo Meetup #6 LT
お前だれよ?
@iktakahiro
blo... |
SSQ/Coursera-UW-Machine-Learning-Classification | Week 5 PA 1/module-8-boosting-assignment-1.ipynb | mit | import numpy as np
import pandas as pd
import json
"""
Explanation: Exploring Ensemble Methods
In this assignment, we will explore the use of boosting. We will use the pre-implemented gradient boosted trees in GraphLab Create. You will:
Use SFrames to do some feature engineering.
Train a boosted ensemble of decision-... |
mitdbg/modeldb | demos/webinar-2020-4-1/census-s3-oss-versioning.ipynb | mit | # restart your notebook if prompted on Colab
try:
import verta
except ImportError:
!pip install verta
verta.__version__
"""
Explanation: Logistic Regression with Grid Search (scikit-learn)
<a href="https://colab.research.google.com/github/VertaAI/modeldb/blob/master/client/workflows/demos/sklearn.ipynb" targe... |
wd15/chimad-phase-field | hackathons/hackathon1/fipy/1a.ipynb | mit | %matplotlib inline
import sympy
import fipy as fp
import numpy as np
A, c, c_m, B, c_alpha, c_beta = sympy.symbols("A c_var c_m B c_alpha c_beta")
f_0 = - A / 2 * (c - c_m)**2 + B / 4 * (c - c_m)**4 + c_alpha / 4 * (c - c_alpha)**4 + c_beta / 4 * (c - c_beta)**4
print f_0
sympy.diff(f_0, c, 2)
"""
Explanation: Ta... |
crazyhottommy/scripts-general-use | Python/pybedtools_intro.ipynb | mit | import pybedtools
import sys
import os
"""
Explanation: This notebook is to get myself to be familair with the pybedtools
import the pybedtools module
End of explanation
"""
os.getcwd()
# use a pre-shipped bed file as an example
a = pybedtools.example_bedtool('a.bed')
"""
Explanation: get the working directory and ... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/supplemental_gradient_boosting/a_boosting_from_scratch.ipynb | apache-2.0 | from __future__ import print_function
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.tree import DecisionTreeRegressor
from tensorflow.keras.datasets import boston_housing
np.random.seed(0)
plt.rcParams['figure.figsize'] = (8.0, 5.0)
plt.rcParams['axes... |
mkuron/espresso | doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb | gpl-3.0 | import espressomd
print(espressomd.features())
required_features = ["LENNARD_JONES"]
espressomd.assert_features(required_features)
"""
Explanation: Tutorial 1: Lennard-Jones Liquid
Table of Contents
Introduction
Background
The Lennard-Jones Potential
Units
First steps
Overview of a simulation script
System setup
Choo... |
WNoxchi/Kaukasos | FAI_old/lesson3/L3HW_MNIST.ipynb | mit | import keras
import numpy as np
from keras.datasets import mnist
from keras.optimizers import Adam
from keras.models import Sequential
from keras.preprocessing import image
from keras.layers.core import Dense
from keras.layers.core import Lambda
from keras.layers.core import Flatten
from keras.layers.core import Dropo... |
jiarong/SSUsearch | notebooks/data-preparation.ipynb | bsd-3-clause | cd /usr/local/notebooks
mkdir -p ./data
cd ./data
"""
Explanation: Setup data directory
End of explanation
"""
!wget https://s3.amazonaws.com/ssusearchdb/SSUsearch_db.tgz
!tar -xzvf SSUsearch_db.tgz
"""
Explanation: Download database files
End of explanation
"""
!wget https://s3.amazonaws.com/ssusearchdb/test.... |
mne-tools/mne-tools.github.io | dev/_downloads/3bb9354e99617f5fdf32e50748fc566d/15_inplace.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')
# the preload flag loads the data into memory now
raw = mne.io.read_raw_fif(sample_data_raw_file, preload=True)... |
seg/2016-ml-contest | PA_Team/PA_Team_Submission_3.ipynb | apache-2.0 | import numpy as np
np.random.seed(1337)
import warnings
warnings.filterwarnings("ignore")
import time as tm
import pandas as pd
from keras.models import Sequential, Model
from keras.constraints import maxnorm
from keras.layers import Dense, Dropout, Activation
from keras.utils import np_utils
from sklearn.metrics ... |
kamujun/exercise_of_deep_larning_from_scratch | notebooks/section6.ipynb | mit | class SGD:
def __init__(self, lr=0.01):
self.lr = lr
def update(self, params, grads):
for key in params.keys():
params[key] -= self.lr * grads[key]
"""
Explanation: 6章 学習に関するテクニック
6.1 パラメータの更新
ニューラルネットワークの学習の目的は損失関数の値をできるだけ小さくするパラメータを見つけることである。このような問題を解くことを「最適化(optimization... |
w4zir/ml17s | lectures/.ipynb_checkpoints/lec02-regression-single-variable-checkpoint.ipynb | mit | import pandas as pd
from sklearn import linear_model
import matplotlib.pyplot as plt
# read data in pandas frame
dataframe = pd.read_csv('datasets/house_dataset1.csv')
# assign x and y
x_feature = dataframe[['Size']]
y_labels = dataframe[['Price']]
# check data by printing first few rows
dataframe.head()
"""
Explan... |
Geosyntec/pycvc | examples/1b - Prepare Tidy Data (SWMM models).ipynb | bsd-3-clause | %matplotlib inline
import os
import sys
import datetime
import warnings
import csv
import numpy as np
import matplotlib.pyplot as plt
import pandas
import seaborn
seaborn.set(style='ticks', context='paper')
import wqio
import pybmpdb
import pynsqd
import pycvc
min_precip = 1.9999
big_storm_date = datetime.date(201... |
georgetown-analytics/machine-learning | examples/dulybina/1_exploratory_analysis.ipynb | mit | import re, csv, os, sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn as sklearn
%matplotlib inline
file = open('/Users/dariaulybina/Desktop/georgetown/ml_practice/agaricus-lepiota.txt', 'r')
#file = open('U:\\agaricus-lepiota.txt', 'r')
list1 = []
for f in file:
l = f.split... |
JShadowMan/package | python/course/ch06-concurrent/并发编程.ipynb | mit | import time
# 引入多线程库
import threading
def say_hello(name):
for i in range(10):
print("hello {}".format(name))
thread1 = threading.Thread(target=say_hello, args=('small red',))
thread2 = threading.Thread(target=say_hello, args=('small light',))
thread1.start()
thread2.start()
"""
Explanation: 并发编程
不管在Pyt... |
ljwolf/spvcm | notebooks/using_the_sampler.ipynb | mit | import spvcm.api as spvcm #package API
spvcm.both.Generic # abstract customizable class, ignores rho/lambda, equivalent to MVCM
spvcm.both.MVCM # no spatial effect
spvcm.both.SESE # both spatial error (SE)
spvcm.both.SESMA # response-level SE, region-level spatial moving average
spvcm.both.SMASE # response-level SMA, ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/59aa8e259e776a361531f7d21fa2f1ec/plot_compute_raw_data_spectrum.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io, read_proj, read_selection
from mne.datasets im... |
mne-tools/mne-tools.github.io | 0.20/_downloads/d0650bb5ca9f8c789ed4763f3c3f895e/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Romain Trachel <trachelr@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import Vectorizer, get_coef
from sklea... |
p0licat/university | Experiments/Crawling/Jupyter Notebooks/Sanda Avram.ipynb | mit | class HelperMethods:
@staticmethod
def IsDate(text):
# print("text")
# print(text)
for c in text.lstrip():
if c not in "1234567890 ":
return False
return True
import pandas
import requests
page = requests.get('http://www.cs.ubbcluj.ro/~sanda/html/pub... |
mayank-johri/LearnSeleniumUsingPython | Section 1 - Core Python/Chapter 05 - Data Types/Lists.ipynb | gpl-3.0 | fruits = ['Apple', 'Mango', 'Grapes', 'Jackfruit',
'Apple', 'Banana', 'Grapes', [1, "Orange"]]
# processing the entire list
for fruit in fruits:
print(fruit, end=", ")
#
print("*"*30)
fruits.insert(0, "kiwi")
print( fruits)
# help(fruits.insert)
# Including
ft1 = list(fruits)
print(id(ft1))
print(... |
e-koch/FilFinder | examples/Filament2D_tutorial.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import astropy.units as u
# Optional settings for the plots. Comment out if needed.
import seaborn as sb
sb.set_context('poster')
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = (12., 9.6)
"""
Explanation: Filament2D Tutorial
This tutorial demonstrates the... |
MingChen0919/learning-apache-spark | notebooks/03-data-preparation/vector-assembler.ipynb | mit | import pandas as pd
pdf = pd.DataFrame({
'x1': ['a','a','b','b', 'b', 'c'],
'x2': ['apple', 'orange', 'orange','orange', 'peach', 'peach'],
'x3': [1, 1, 2, 2, 2, 4],
'x4': [2.4, 2.5, 3.5, 1.4, 2.1,1.5],
'y1': [1, 0, 1, 0, 0, 1],
'y2': ['yes', 'no', 'no', 'yes', 'yes', 'ye... |
quasars100/Resonance_testing_scripts | python_tutorials/Parallel.ipynb | gpl-3.0 | from IPython.parallel import Client
rc = Client()
print "Cluster size: %d" % len(rc.ids)
lv = rc.load_balanced_view()
lv.block = True
"""
Explanation: Parallel computing using REBOUND and IPython/Jupyter
In this tutorial, we'll use IPython for parallel and distributed REBOUND simulations. With IPython, we can execute ... |
hanezu/cs231n-assignment | assignment1/two_layer_net.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloadi... |
kiwiPhrases/STA-663-Final-Project | data/DataStructureExploration_py2.xx.ipynb | mit | bfile = 'dataset1'
phenoFile = bfile+'.phe'
chromosomes = xrange(1,11)
prevalence = 0.001
bed = Bed(bfile).read().standardize()
causalSNPs = [s for s in bed.sid if 'csnp' in s]
bed.sid[:5]
bed.iid
print "bed matrix shape:", bed.val.shape
print "Size of bed matrix: %4.0fmb" %(bed.val.nbytes/(1024**2))
bed.val[0,:100]... |
PrACiDa/intro_ciencia_de_datos | 02_distribuciones_de_probabilidad.ipynb | gpl-3.0 | distri = stats.randint(1, 7) # límite inferior, límite superior + 1
x = np.arange(0, 8)
x_pmf = distri.pmf(x) # la pmf evaluada para todos los "x"
media, varianza = distri.stats(moments='mv')
plt.vlines(x, 0, x_pmf, colors='C0', lw=5,
label='$\mu$ = {:3.1f}\n$\sigma$ = {:3.1f}'.format(float(media),
... |
tjhunter/karps | python/notebooks/Demo 2-details.ipynb | apache-2.0 | import pandas as pd
import karps as ks
import karps.functions as f
from karps.display import show_phase
# Make a session at the top, although it is not required immediately.
s = ks.session("demo2")
"""
Explanation: Bringing modularity and code reuse to Spark
Spark does not let one define arbitrary functions and reuse... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day08-modeling-viral-load-day1/viral_load_model_INSTRUCTOR.ipynb | agpl-3.0 | # some code to set up the problem.
# Make plots inline
%matplotlib inline
# Make inline plots vector graphics instead of raster graphics
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'svg')
# import modules for plotting and data analysis
import matplotlib.pyplot as plt
import numpy... |
mne-tools/mne-tools.github.io | 0.20/_downloads/5514ea6c90dde531f8026904a417527e/plot_10_evoked_overview.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: The Evoked data structure: evoked/averaged data
This tutorial covers the basics of creating and working with :term:evoked
data. It introduces the :class:~mne.Evoked data structure in detail,
including how to load, query, subselect, export, and plot data from an
:class:~mne.Evoked ... |
alexvmarch/exa | docs/source/notebooks/exa.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import exa
"""
Explanation: Welcome to exa! Let's get started
End of explanation
"""
x = np.linspace(0, 10, 11)
y = np.random.rand(11)
df1 = pd.DataFrame.from_dict({'x': x, 'y': y})
df1.head()
"""
Explanation: You might be familiar with pandas
End of explanation
"""
df1 = pd... |
mne-tools/mne-tools.github.io | 0.23/_downloads/a179627fc73cce931ace004638e9685c/read_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator
from mne.viz import set_3d_view
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
fname_trans = data... |
IS-ENES-Data/submission_forms | test/forms/test/form_retrieval.ipynb | apache-2.0 | from dkrz_forms import form_widgets
form_widgets.show_status('form-retrieval')
"""
Explanation: Retrieve your DKRZ data form
Via this form you can retrieve previously generated data forms and make them accessible via the Web again for completion.
Additionally you can get information on the data ingest process status r... |
shvjds/Bayesian_notebooks | det_change_in_timeseries.ipynb | mit | import numpy as np
import scipy.stats as stats
import pymc3 as pm
import matplotlib.pyplot as plt
plt.style.use(['ggplot', 'seaborn-talk'])
%matplotlib inline
#loading the data
NIRS_vals = []
with open("NIRS_data.txt", "r") as spfile:
for line in spfile:
NIRS_vals.append(np.float(line))
NIRS_vals = np.... |
xusk/dm | ch3/basketball-result.ipynb | apache-2.0 | last_match_winner = defaultdict(int)
dataset['HomeTeamWonLast'] = 0
for index,row in dataset.iterrows():
home_team = row['home']
visitor_team = row['visitor']
teams = tuple(sorted([home_team,visitor_team]))
row['HomeTeamWonLast'] = 1 if last_match_winner[teams] == home_team else 0
dataset.ix[index] ... |
MChehadeh/CarND-term1-P1 | .ipynb_checkpoints/P1-checkpoint.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
#reading in an image
image = mpimg.imread('test_images/solidWhiteRight.jpg')
#printing out some stats and plotting
print('This image is:', type(image), 'with dimesions:', im... |
Hash--/documents | notebooks/TP Master Fusion/LH-Hands-on-mode-converter.ipynb | mit | # This line configures matplotlib to show figures embedded in the notebook,
# and also import the numpy library
%pylab
%matplotlib inline
"""
Explanation: Hands-on LH1: the $\mathrm{TE}{10}$-$\mathrm{TE}{30}$ Mode Converter
Introduction
The Tore Supra Lower Hybrid Launchers are equiped by $\mathrm{TE}{10}$-$\mathr... |
KaiSzuttor/espresso | doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb | gpl-3.0 | import espressomd
espressomd.assert_features(["ELECTROSTATICS", "ROTATION", "ROTATIONAL_INERTIA", "EXTERNAL_FORCES",
"MASS", "VIRTUAL_SITES_RELATIVE", "CUDA", "LENNARD_JONES"])
from espressomd import interactions
from espressomd import electrostatics
from espressomd import lb
from espressomd... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/GUI/6 - Custom Widget.ipynb | apache-2.0 | %matplotlib inline
from ipywidgets import interact, interactive
from IPython.display import clear_output, display, HTML
import numpy as np
from scipy import integrate
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import cnames
from matplotlib import animation
"... |
mroberge/hydrofunctions | docs/notebooks/Hysteresis.ipynb | mit | import hydrofunctions as hf
print(hf.__version__)
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('seaborn-notebook')
%matplotlib inline
"""
Explanation: Hysteresis in River Systems
Hysteresis is a condition where a dependent variable is controlled not only by the value of an independent variabl... |
booya-at/paraBEM | doc/tutorial/tutorial.ipynb | gpl-3.0 | import os # operating system functionality
import numpy as np # arrays and math
import matplotlib.pyplot as plt # plotting
import matplotlib
from IPython.display import SVG # showing svg
import parabem # python panel methode package
... |
kit-cel/wt | sigNT/spectral_estimation/psd_estimation_variance.ipynb | gpl-2.0 | # importing
import numpy as np
from scipy import signal
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 30}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(30, 8) )
"""
Explan... |
HumaRobotics/poppy-walk | poppy-walk.ipynb | gpl-2.0 | from poppy_humanoid import PoppyHumanoid
try:
poppy = PoppyHumanoid()
except Exception,e:
print "could not create poppy object"
print e
"""
Explanation: Poppy-walk
Take the hands of Poppy and it will follow you anywhere!
Poppy wait for its arms to be lifted, then generates walk moves from sinusoidal signal... |
erayon/India-Australia-Cricket-Analysis | India’s_batting_performance_2016.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
import plotly.plotly as py
import plotly.graph_objs as go
%matplotlib notebook
"""
Explanation: Visualize the performance of India’s batti... |
seblabbe/MATH2010-Logiciels-mathematiques | NotesDeCours/07-limites-calcul-diff.ipynb | gpl-3.0 | from __future__ import division, print_function # Python 3
from sympy import init_printing
init_printing(use_latex='mathjax',use_unicode=False) # Affichage des résultats
"""
Explanation: $$
\def\CC{\bf C}
\def\QQ{\bf Q}
\def\RR{\bf R}
\def\ZZ{\bf Z}
\def\NN{\bf N}
$$
Calcul différentiel et intégral
End of explanati... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-dir_ex_aa-fit-out-all-ph-22d.ipynb | mit | ph_sel_name = "all-ph"
data_id = "22d"
# ph_sel_name = "all-ph"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:37:34 2017
Duration: 9 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
fr... |
Azure/azure-sdk-for-python | sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb | mit | from azure.identity import AzureCliCredential
from azure.digitaltwins.core import DigitalTwinsClient
# using yaml instead of
import yaml
import uuid
# using altair instead of matplotlib for vizuals
import numpy as np
import pandas as pd
# you will get this from the ADT resource at portal.azure.com
your_digital_twin... |
valentina-s/GLM_PythonModules | notebooks/.ipynb_checkpoints/MLE_multipleNeuronsWeights-checkpoint.ipynb | bsd-2-clause | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import random
import csv
%matplotlib inline
import os
import sys
sys.path.append(os.path.join(os.getcwd(),'..'))
sys.path.append(os.path.join(os.getcwd(),'..','code'))
sys.path.append(os.path.join(os.getcwd(),'..','data'))
import filters
import li... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_ml/td2a_correction_session_3B.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.ml - Arbres de décision / Random Forest - correction
Méthodes ensemblistes, features importance, correction.
End of explanation
"""
import os
if not os.path.exists("salaries2010.db... |
crystalzhaizhai/cs207_yi_zhai | lectures/L7/L7.ipynb | mit | def quad_roots(a=1.0, b=2.0, c=0.0):
"""Returns the roots of a quadratic equation: ax^2 + bx + c = 0.
INPUTS
=======
a: float, optional, default value is 1
Coefficient of quadratic term
b: float, optional, default value is 2
Coefficient of linear term
c: float, optional, defau... |
samuelsinayoko/kaggle-housing-prices | research/dataset_structure.ipynb | mit | import sys
import os
import pandas as pd
import seaborn as sns
sys.path.insert(1, os.path.join(sys.path[0], '..')) # add parent directory to path
import samlib
"""
Explanation: Exploring datastructures for dataset
A Pandas exploration. Find the best datastructure to explore and transform the dataset (both training ... |
catalystcomputing/DSIoT-Python-sessions | Session1/code/04 Pandas.ipynb | apache-2.0 | import pandas as pd
import numpy as np
"""
Explanation: Pandas
Fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python.
pandas is ... |
GoogleCloudPlatform/ai-platform-samples | notebooks/samples/tensorflow/prediction_logging/covertype_training_serving_logging_bq.ipynb | apache-2.0 | !pip install -q -U tensorflow==2.1
!pip install -U -q google-api-python-client
!pip install -U -q pandas
# Automatically restart kernel after installs
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(True)
"""
Explanation: <table align="left">
<td>
<a href="https://colab.research.googl... |
wdbm/abstraction | bonhomie_ttH_ttbb_classification_variables_preparation.ipynb | gpl-3.0 | import datetime
import keras
from keras import activations
from keras.datasets import mnist
from keras.layers import Dense, Flatten
from keras.layers import Conv1D, Conv2D, MaxPooling1D, MaxPooling2D, Dropout
from keras.models import Sequential
from keras.utils import plot_model
from matplotlib import gridspec
import m... |
Danghor/Formal-Languages | ANTLR4-Python/LR-Parser-Generator/LR-Table-Generator.ipynb | gpl-2.0 | !cat Examples/c-fragment.g
"""
Explanation: Implementing an LR-Table-Generator
A Grammar for Grammars
As the goal is to generate an LR-table-generator we first need to implement a parser for context free grammars.
The file arith.g contains an example grammar that describes arithmetic expressions.
End of explanation
""... |
TeamLab/Gachon_CS50_OR_KMOOC | assignment/ps3/gachon_lp_solver.ipynb | mit | from gachon_lp_solver import GachonLPSolver # gachon_lp_solver 파일(모듈)에서 GachonLPSolver class를 import
lpsover = GachonLPSolver("test_example") #GachonLPSolver class의 첫 번째 argument인 model_name에 "test_example" 를 할당함
lpsover.model_name
"""
Explanation: Lab #3 - Your own linear programming solver with Python
Copyright 2... |
ellisonbg/leafletwidget | examples/Video.ipynb | mit | import ftplib
import os
from tqdm import tqdm
import rasterio
from rasterio.warp import reproject, Resampling
from affine import Affine
import matplotlib.pyplot as plt
import numpy as np
import subprocess
from base64 import b64encode
from ipyleaflet import Map, VideoOverlay
try:
from StringIO import StringIO
py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.