repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
folivetti/BIGDATA | Spark/Lab01.ipynb | mit | ListaPalavras = ['gato', 'elefante', 'rato', 'rato', 'gato']
palavrasRDD = sc.parallelize(ListaPalavras, 4)
print(type(palavrasRDD))
"""
Explanation: Spark + Python = PySpark
Esse notebook introduz os conceitos básicos do Spark através de sua interface com a linguagem Python. Como aplicação inicial faremos o clássico ... |
james-prior/cohpy | 20141011-dojo-csv-excel-dialect-with-tab-20170215.ipynb | mit | with open('eggs.csv', 'w') as csvfile:
writer = csv.DictWriter(csvfile, columns, dialect='excel-tab')
for row in mesa:
writer.writerow(row)
!ls -l eggs.csv
!cat eggs.csv
print(repr(open('eggs.csv').read()))
"""
Explanation: So do not write in binary mode.
That is a difference between
the csv module
... |
empet/geom_modeling | Spherical-Voronoi.ipynb | bsd-2-clause | import scipy
scipy. __version__
from scipy.spatial import SphericalVoronoi
from scipy.interpolate import splev, splprep
import numpy as np
import plotly.plotly as py
from plotly.graph_objs import *
"""
Explanation: Plotly interactive spherical Voronoi diagram
Starting with version 0.18.0, scipy provides the class s... |
hershaw/data-science-101 | course/class1/pca/examples/00 - PCA on 2 dimensions.ipynb | mit | import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
from codefiles.datagen import random_xy, x_plus_noise, data_3d
from codefiles.dataplot import plot_principal_components, plot_3d, plot_2d
# %matplot... |
ES-DOC/esdoc-jupyterhub | notebooks/bnu/cmip6/models/sandbox-2/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: BNU
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance... |
mfem/PyMFEM | examples/jupyter/plot_DOFs_and_qpts.ipynb | bsd-3-clause | import mfem.ser as mfem
import numpy as np
import os
import math
%matplotlib inline
import matplotlib.pyplot as plt
%config InlineBackend.figure_formats = ['svg']
# Create some output directories for images
for d in ["figs", "figs/dofs", "figs/qpts",
"figs/dofs/svg", "figs/dofs/pdf", "figs/dofs/png",
... |
mlosch/nnadapter | examples/summary_statistics.ipynb | mit | import sys
import os
import numpy as np
from collections import OrderedDict
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Gather summary statistics from network outputs
This example script displays the use of emu to
estimate normal distribution parameters from the output of each convolutional la... |
sibirbil/HesKit | Ornek_Uygulama_Rassal.ipynb | gpl-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Noktaların Ağırlık Merkezi
Bu örnekte bir grup kütlenin iki boyutlu uzayda ağırlık merkezini bulacağız. Önce hızlıca bir hatırlatma. Diyelim ki elimizde üç nesne var. Bu nesnelerin kütleleri ve koordinatları şu şekilde verilmiş olsu... |
liumengjun/cn-deep-learning | tutorials/intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
BrainIntensive/OnlineBrainIntensive | resources/nipype/nipype_tutorial/notebooks/example_metaflow.ipynb | mit | %pylab inline
from os.path import join as opj
from nipype.pipeline.engine import Workflow, Node, MapNode
from nipype.interfaces.utility import Function, IdentityInterface
from nipype.algorithms.misc import Gunzip
from nipype.algorithms.modelgen import SpecifySPMModel
from nipype.interfaces.afni import Resample
from nip... |
tensorflow/docs-l10n | site/ko/hub/tutorials/cross_lingual_similarity_with_tf_hub_multilingual_universal_encoder.ipynb | apache-2.0 | # Copyright 2019 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... |
telescopeuser/workshop_blog | wechat_tool_py3_local/lesson_1_py3_local.ipynb | mit | # from __future__ import unicode_literals, division
import time, datetime, requests, itchat
from itchat.content import *
"""
Explanation: 如何使用和开发微信聊天机器人的系列教程
A workshop to develop & use an intelligent and interactive chat-bot in WeChat
WeChat is a popular social media app, which has more than 800 million monthly activ... |
texib/deeplearning_homework | XOR_Gate.ipynb | mit | import theano
import theano.tensor as T
import numpy as np
import numpy
x = T.vector()
w1 = theano.shared(np.random.randn(2))
b1 = theano.shared(np.random.randn(1))
w2 = theano.shared(np.random.randn(2))
b2 = theano.shared(np.random.randn(1))
w = theano.shared(np.random.randn(2))
b = theano.shared(np.random.randn(1... |
jeancochrane/learning | python-machine-learning/code/ch04exercises.ipynb | mit | import pandas
names = ['num_times_pregnant', 'glucose_concentration',
'blood_pressure', 'skin_fold_thickness', 'insulin',
'bmi', 'diabetes_pedigree', 'age', 'target']
data_url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/' +\
'pima-indians-diabetes/pima-indians-diabetes.d... |
pyconsk/meetup | Bratislava/201507/enigma.ipynb | cc0-1.0 | ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SUBSTITUTE = 'DEFGHIJKLMNOPQRSTUVWXYZABC'
secret_message = 'Tento text je zasifrovany substitucnou sifrou avsak rozlustit ho nie je vobec zlozite'
"""
Explanation: Enigma
Enigma bola prenosným elektromechanickým šifrovacím strojom pracujúcim na princípe otáčajúcich sa rotoro... |
charlesll/RamPy | examples/Machine Learning Exploration.ipynb | gpl-2.0 | %matplotlib inline
import numpy as np
np.random.seed(42) # fixing the seed
import matplotlib
import matplotlib.pyplot as plt
import rampy as rp
from scipy.stats import norm
from sklearn.decomposition import PCA, NMF
import sklearn
x = np.arange(0,600,10.0)
nb_samples = 40 # number of samples in our dataset
S_1 = nor... |
phoebe-project/phoebe2-docs | 2.2/tutorials/building_a_system.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Building a System
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
"""
import phoebe
from pho... |
tokuda109/tensorflow-docker-skeleton | notebooks/playground_ja/tensorflow/00_tensorflow_loss_functions.ipynb | mit | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
sess = tf.Session()
zero_values_op = tf.zeros([300])
one_values_op = tf.ones([300])
predictions_op = tf.linspace(-3.0, 3.0, 300)
logits_op = tf.linspace(-3.0, 5.0, 300)
predictions = sess.run(predictions_op)
logits = sess.run(logits_op)
"""... |
tuanavu/coursera-university-of-washington | machine_learning/1_machine_learning_foundations/assignment/week3/ipynb_checkpoints/Analyzing product sentiment-Exercise-checkpoint.ipynb | mit | import graphlab
"""
Explanation: Predicting sentiment from product reviews
Fire up GraphLab Create
End of explanation
"""
products = graphlab.SFrame('amazon_baby.gl/')
"""
Explanation: Read some product review data
Loading reviews for a set of baby products.
End of explanation
"""
products.head()
"""
Explanation... |
statsmodels/statsmodels.github.io | v0.12.1/examples/notebooks/generated/ols.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.sandbox.regression.predstd import wls_prediction_std
np.random.seed(9876789)
"""
Explanation: Ordinary Least Squares
End of explanation
"""
nsample = 100
x = np.linspace(0, 10, 1... |
adukic/nd101 | seq2seq/sequence_to_sequence_implementation.ipynb | mit | import helper
source_path = 'data/letters_source.txt'
target_path = 'data/letters_target.txt'
source_sentences = helper.load_data(source_path)
target_sentences = helper.load_data(target_path)
"""
Explanation: Character Sequence to Sequence
In this notebook, we'll build a model that takes in a sequence of letters, an... |
mjabri/holoviews | doc/Tutorials/Exploring_Data.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
%reload_ext holoviews.ipython
%output holomap='auto'
%timer start
"""
Explanation: In the Introductory Tutorial and the Element and Container overviews you can see how HoloViews allows you to wrap your data into annotated Elements that can be composed easily into complex visua... |
SvenKratz/CarND-Traffic-Sign-Classifier-Project | Traffic_Sign_Classifier.ipynb | unlicense |
# Load pickled data
import pickle
# TODO: Fill this in based on where you saved the training and testing data
DATA_DIR = './traffic-signs-data/'
training_file = DATA_DIR + 'train.p'
validation_file= DATA_DIR + 'valid.p'
testing_file = DATA_DIR + 'test.p'
with open(training_file, mode='rb') as f:
train = pickle.... |
hagne/atm-py | examples/instruments_POPS_peak.ipynb | mit | from atmPy.aerosols.instruments.POPS import peaks,calibration
import matplotlib.pylab as plt
from atmPy.tools import plt_tools
import numpy as np
%matplotlib inline
plt_tools.setRcParams(plt)
"""
Explanation: Introduction
The main function of this module is to convert recored peak intensities to particle sizes and cr... |
astroumd/GradMap | notebooks/Lectures2018/Lecture1/GradMap_L1.ipynb | gpl-3.0 | #test cell
"""
Explanation: Introduction to "Doing Science" in Python for REAL Beginners
Python is one of many languages you can use for research and HW purposes. In the next few days, we will work through many of the tool, tips, and tricks that we as graduate students (and PhD researchers) use on a daily basis. We wi... |
mne-tools/mne-tools.github.io | 0.21/_downloads/ef81cbafce45c79dbfcdf37970a37c57/plot_source_space_snr.ipynb | bsd-3-clause | # Author: Padma Sundaram <tottochan@gmail.com>
# Kaisu Lankinen <klankinen@mgh.harvard.edu>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
import numpy as np
import matplotlib.pyplot as plt
print(__doc__)
data_path = s... |
paulcon/active_subspaces | tutorials/test_functions/robot/robot_example.ipynb | mit | import active_subspaces as ac
import numpy as np
%matplotlib inline
# The robot_functions.py file contains two functions: the robot function (robot(xx))
# and its gradient (robot_grad(xx)). Each takes an Mx8 matrix (M is the number of data
# points) with rows being normalized inputs; robot returns a column vector of f... |
probml/pyprobml | notebooks/book2/25/gan_mixture_of_gaussians.ipynb | mit | !pip install -q flax
from typing import Sequence
import matplotlib.pyplot as plt
import jax
import jax.numpy as jnp
try:
import flax.linen as nn
except ModuleNotFoundError:
%pip install -qq flax
import flax.linen as nn
from flax.training import train_state
try:
import optax
except ModuleNotFoundErro... |
jellis18/enterprise | docs/_static/notebooks/.ipynb_checkpoints/usage-checkpoint.ipynb | mit | % matplotlib inline
%config InlineBackend.figure_format = 'retina'
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from enterprise.pulsar import Pulsar
import enterprise.signals.parameter as parameter
from enterprise.signals import utils
from enterprise.signals import signal_base
f... |
xlbaojun/Note-jupyter | 05其他/pandas文档-zh-master/数据结构.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
"""
Explanation: 数据结构
这一节介绍pandas中的数据结构。首先,导入numpy和pandas:
End of explanation
"""
s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])
s
s.index
pd.Series(np.random.randn(5))
"""
Explanation: 我们先对数据结构进行简短的介绍, 然后再详细说明各个数据结构内置的方法。
Series
Series是一个一维带label的数组,元素可以... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_sensor_regression.ipynb | bsd-3-clause | # Authors: Tal Linzen <linzen@nyu.edu>
# Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne.datasets import sample
from mne.stats.regression import linear_regression
print(__doc__)
data_path = sample.data_path()
"""
Explanation: Sensor space lea... |
marcelomiky/PythonCodes | Intro ML Semcomp/semcomp17_ml/.ipynb_checkpoints/semcomp17_ml_answer-checkpoint.ipynb | mit | #essential imports
import sys
sys.path.insert(1,'utils')
import numpy as np
import matplotlib.pyplot as plt
# display plots in this notebook
%matplotlib nbagg
import pandas as pd
import ml_utils
print np.__version__
print np.__file__
"""
Explanation: Introduction to Machine Learning (ML)
This tutorial aims to get you ... |
data-cube/agdc-v2-examples | notebooks/07_hovmoller_space_time_visualisation.ipynb | apache-2.0 | %pylab notebook
from __future__ import print_function
import datacube
import xarray as xr
from datacube.storage import masking
from datacube.storage.masking import mask_to_dict
from matplotlib import pyplot as plt
from IPython.display import display
import ipywidgets as widgets
dc = datacube.Datacube(app='linear extra... |
xmacex/legacySoftwareACMDLexploration | ACM DL bibliometry of legacy.ipynb | gpl-3.0 | import pandas as pd
import networkx as nx
import community
import itertools
import matplotlib.pyplot as plt
import numpy as np
import re
%matplotlib inline
"""
Explanation: ACM Digital Library bibliometric analysis of legacy software
An incomplete bibliographical inquiry into what the ACM Digital Library has to say a... |
Bolt64/my_code | jupyter_notebooks/quanta_2_sexes/quanta_2_sexes.ipynb | mit | sexual_mean, sexual_standard_deviation = 1.1, 0.15
asexual_mean, asexual_standard_deviation = 1.2, 0.3
"""
Explanation: We have the following constants for the two lizard species.
End of explanation
"""
pod_sexual = norm.cdf(0, loc=sexual_mean, scale=sexual_standard_deviation)
pod_asexual = norm.cdf(0, loc=asexual_m... |
ClementPhil/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from sklearn import preprocessing
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'
class DLProgress(tqdm... |
uberwach/leveling-up-jupyter | notebooks/1_Simple.ipynb | mit | !ls
!pip install --user pandas matplotlib sklearn seaborn
!pip install version_information
%load_ext version_information
%version_information pandas, sklearn
!pip install watermark
%load_ext watermark
%watermark -a "Gerrit Gruben" -d -t -v -p numpy,pandas -g
"""
Explanation: Simple start to Jupyter notebooks
A: ... |
lukechen526/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
mbway/Bayesian-Optimisation | demos/Exploration-Exploitation.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
import numpy as np
import sklearn.gaussian_process as gp
import matplotlib.pyplot as plt
import seaborn as sns; sns.set() # prettify matplotlib
# local modules
import turbo as tb
import turbo.modules as tm
import turbo.g... |
poldrack/fmri-analysis-vm | analysis/connectivity/BayesNet.ipynb | mit | import os,sys
import numpy
%matplotlib inline
import matplotlib.pyplot as plt
sys.path.insert(0,'../')
from utils.mkdesign import create_design_singlecondition
from nipy.modalities.fmri.hemodynamic_models import spm_hrf,compute_regressor
from utils.make_data import make_continuous_data
from utils.graph_utils import sho... |
kit-cel/wt | nt1/vorlesung/8_ofdm/ofdm.ipynb | gpl-2.0 | # importing
import numpy as np
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=matplotlib.checkdep_usetex(True))
matplotlib.rc('figure', figsize=(18, 6) )
"""
Explanation: Content a... |
DrSkippy/Data-Science-45min-Intros | count-min-101/CountMinSketch.ipynb | unlicense | # define a function to return a list of the exact top users, sorted by count
def exact_top_users(f, top_n = 10):
import operator
counts = {}
for user in f:
user = user.rstrip('\n')
try:
if user not in counts:
counts[user] = 1
else:
coun... |
pligor/predicting-future-product-prices | 04_time_series_prediction/30_price_history_dataset_per_mobile_phone-arima.ipynb | agpl-3.0 | input_len = 60
target_len = 30
batch_size = 50
with_EOS = False
csv_in = '../price_history_03_seq_start_suddens_trimmed.csv'
"""
Explanation: Step 0 - hyperparams
vocab_size is all the potential words you could have (classification for translation case)
and max sequence length are the SAME thing
decoder RNN hidden un... |
AllenDowney/ModSimPy | soln/chap24soln.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
michalkurka/h2o-3 | h2o-py/demos/turbofan_phm_gtkerror_NOPASS.ipynb | apache-2.0 | import sys
import h2o
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.utils.shared_utils import _locate
import numpy as np
import pandas as pd
import seaborn as sns
import pykalman as pyk
sns.set()
doGridSearch = True
doKalmanSmoothing... |
sujitpal/polydlot | src/tf-serving/02a-model-serializer.ipynb | apache-2.0 | from __future__ import division, print_function
from sklearn.preprocessing import OneHotEncoder
from sklearn.metrics import accuracy_score, confusion_matrix
import numpy
import os
import shutil
import tensorflow as tf
DATA_DIR = "../../data"
TEST_FILE = os.path.join(DATA_DIR, "mnist_test.csv")
IMG_SIZE = 28
BATCH_SIZ... |
robertoneil/coursera_images | Week2_Part1.ipynb | mit | %matplotlib inline
#import typical packages I'll be using
import cv2
import numpy as np
import matplotlib.pyplot as plt
from pylab import rcParams
rcParams['figure.figsize'] = 10, 10 #boiler plate to set the size of the figures
plt.gray() #start with gray scale image
#Load a test image - convert to a single channel... |
holla2040/valvestudio | experiments/02-modeling/pentode/pentode-modeling.ipynb | mit | import scipy
from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt
from math import pi,atan,log,pow,exp
"""
Explanation: Pentode Modeling
Model Parameter Extraction
Model Parameter Verification
This experiment uses data extracted from a vacuum tube datasheet and scipy.optimize to c... |
tkurfurst/deep-learning | embeddings/Skip-Gram word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
Naereen/notebooks | Demonstration_of_Pypi_package_OCaml_for_polyglot_notebook_02-2021.ipynb | mit | !pip3 install ocaml
"""
Explanation: Demonstration of Pypi package OCaml for polyglot notebook
TL;DR: this Pypi ocaml package allows to embed a real and complete OCaml runtime (with full standard library) in an IPython console or Jupyter notebook running IPython kernel (Python 3). OCaml functions and tiny programs can... |
karst87/ml | dev/pyml/1001_使用Python进行描述性统计.ipynb | mit | import numpy as np
from numpy import array
from numpy.random import normal, randint
#使用List来创造一组数据
data = [1, 2, 3]
print(data)
#使用ndarray来创造一组数据
data = array([1, 2, 3])
print(data)
#创造一组服从正态分布的定量数据
data = normal(0, 10, size=10)
print(data)
#创造一组服从均匀分布的定性数据
data = randint(0, 10, size=10)
print(data)
"""
Explanatio... |
zklgame/CatEyeNets | test/StyleTransfer-TensorFlow.ipynb | mit |
%load_ext autoreload
%autoreload 2
from scipy.misc import imread, imresize
import numpy as np
from scipy.misc import imread
import matplotlib.pyplot as plt
# Helper functions to deal with image preprocessing
from cs231n.image_utils import load_image, preprocess_image, deprocess_image
%matplotlib inline
def get_ses... |
tensorflow/docs-l10n | site/ja/lite/examples/style_transfer/overview.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... |
theandygross/HIV_Methylation | PreProcessing/BMIQ_Normalization_script.ipynb | mit | import pandas as pd
import rpy2.robjects as robjects
from pandas.rpy.common import convert_to_r_dataframe
from pandas.rpy.common import convert_robj
from IPython.display import clear_output
"""
Explanation: BMIQ Normalization
Here we are running BMIQ normalization on all of our quantile-normalized data together. I ... |
Alex-Ian-Hamilton/solarbextrapolation | docs/auto_examples/plot_potential_extrapolation_of_example_data_gal.ipynb | mit | # Module imports
from solarbextrapolation.map3dclasses import Map3D
#from solarbextrapolation.potential_field_extrapolator import PotentialExtrapolator
from solarbextrapolation.extrapolators import PotentialExtrapolator
from solarbextrapolation.example_data_generator import generate_example_data, dummyDataToMap
from so... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/01-PyTorch-Basics/00-Tensor-Basics.ipynb | apache-2.0 | import torch
import numpy as np
"""
Explanation: <img src="../Pierian-Data-Logo.PNG">
<br>
<strong><center>Copyright 2019. Created by Jose Marcial Portilla.</center></strong>
Tensor Basics
This section covers:
* Converting NumPy arrays to PyTorch tensors
* Creating tensors from scratch
Perform standard imports
End of ... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
ctools/ctools | doc/source/users/tutorials/cta/howto/howto_scs.ipynb | gpl-3.0 | import gammalib
import ctools
import cscripts
"""
Explanation: How to perform spectral component separation?
In this tutorial you will learn how to use spectral component separation to disentangle the morphological properties of overlapping sources.
As usual we start by importing the gammalib, ctools, and cscripts Pyt... |
QuentinAndre/John-Rust-1987-Python | .ipynb_checkpoints/Data Generation and Likelihood Fit-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
import random as rnd
import scipy.stats as stats
import scipy.optimize as opt
import json as json
import matplotlib as mpl
from math import exp
from matplotlib import pyplot as plt
from IPython.core.pylabtools import figsize
from IPython.display import display
from IPython.core.di... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/ciesm/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'ciesm', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: THU
Source ID: CIESM
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balance, Carbon... |
superbobry/pymc3 | pymc3/examples/GLM-robust-with-outlier-detection.ipynb | apache-2.0 | %matplotlib inline
%qtconsole --colors=linux
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import optimize
import pymc3 as pm
import theano as thno
import theano.tensor as T
# configure some basic options
sn... |
tensorflow/docs-l10n | site/ja/tutorials/images/segmentation.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... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/launching_into_ml/labs/bigquery.ipynb | apache-2.0 | try:
# Use the Colab's preinstalled TensorFlow 2.x
%tensorflow_version 2.x
except:
pass
# Install the required packages
!pip install fastavro
!pip install tensorflow-io==0.9.0
"""
Explanation: End-to-End Example for BigQuery TensorFlow Reader
Overview
In this lab, you will use BigQuery TensorFlow reader and Ke... |
throx66/deep-learning | transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
xmnlab/notebooks | probability/Bayesian Networks.ipynb | mit | from IPython.display import HTML, display
from nxpd import draw
from functools import wraps
from itertools import permutations
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
import re
%matplotlib inline
Σ = sum
def auto_display(f):
@wraps(f)
def _f(self, *args, **kwargs):
v... |
google/flax | examples/seq2seq/seq2seq.ipynb | apache-2.0 | # Install CLU & Flax.
!pip install -q clu flax
example_directory = 'examples/seq2seq'
editor_relpaths = ('train.py', 'input_pipeline.py', 'models.py')
repo, branch = 'https://github.com/google/flax', 'main'
# (If you run this code in Jupyter[lab], then you're already in the
# example directory and nothing needs to ... |
Nasdin/ReinforcementLearning-AtariGame | OpenAI Reinforcement Learning Agent Plays Atari Games.ipynb | bsd-3-clause | from __future__ import print_function, division
import numpy as np
import json
import logging
from cv2 import resize
from skimage.color import rgb2gray
import os
os.environ["OMP_NUM_THREADS"] = "1" #should be set to 1 to prevent conflicts
import time
from torch.autograd import Variable
"""
Explanation: Open AI A... |
arcyfelix/Courses | 17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/04-Visualization-Matplotlib-Pandas/04b-Pandas Visualization/.ipynb_checkpoints/Pandas Built-in Data Visualization-checkpoint.ipynb | apache-2.0 | import numpy as np
import pandas as pd
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../../Pierian_Data_Logo.png' /></a>
Pandas Built-in Data Visualization
In this lecture we will learn about pandas built-in capabilities for data visualization! It's built-off of matplotlib, but i... |
Upward-Spiral-Science/team1 | code/GMM_vs_KMeans.ipynb | apache-2.0 | from sklearn import cluster
kmeans1 = cluster.KMeans(4)
kmeans1.fit_predict(data)
print kmeans1.cluster_centers_
"""
Explanation: Bock 2011 paper claims they cut 4 different layers, so we will do k-means w/ 4 clusters.
End of explanation
"""
data_yd = data[:, (1, 3)]
kmeans2 = cluster.KMeans(4)
kmeans2.fit_predic... |
ageron/tensorflow-safari-course | 11_convolutional_neural_networks_ex10.ipynb | apache-2.0 | from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
tf.__version__
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("tmp/data/")
def get_model_param... |
BadWizard/Inflation | SPF/develop/get_Individ_Uncert.ipynb | mit | def fit_normal_to_hist(h):
if not all(h==0):
bins =np.array([-2.0,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,5.0])
orig_hist = np.array(h).astype(float)
norm_hist = orig_hist/float(sum(orig_hist))
mid_points = (bins[1:] + bins[:-1])/2
popt,pcov = opt.curve_fit(lambda x,m... |
mintcloud/deep-learning | Project 1 -DLND-your-first-network/dlnd-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... |
ocefpaf/sscsw | IOOS_data_demo.ipynb | mit | bbox = [-127, 43, -123.75, 48]
"""
Explanation: Can we get data near the Coastal Endurance array?
This notebook uses a searches the csw NGDC catalog filtering the results with:
- (a) bounding box for the Coastal Endurance array;
- (b) time span of "today ± 5 days";
- (c) variable: temperature
This approach is v... |
hjelmj/electrochem | notebooks/DoubleLayerCapacitance.ipynb | mit | def cap_helmholtz(epsilon_H=6.8, x=0.2e-9, A=1e-4):
"""
*input*
epsilon_H - the relative permittivity of the Helmholtz layer, default is 6.8
x, the thickness of the Helmholtz layer [m], default is 0.2 nm, i.e. 0.2e-9 cm.
A, electrode area [m²], default is 1 cm², i.e. 1e-4
*output*
C, [F]
... |
freedomtan/tensorflow | tensorflow/lite/g3doc/performance/post_training_integer_quant_16x8.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... |
benvanwerkhoven/kernel_tuner | tutorial/grid3d.ipynb | apache-2.0 | import numpy as np
import numpy.linalg as la
from time import time
def compute_grid(center,xgrid,ygrid,zgrid):
x0,y0,z0 = center
beta = -0.1
f = np.sqrt( (xgrid-x0)**2 + (ygrid-y0)**2 + (zgrid-z0)**2 )
f = np.exp(beta*f)
return f
"""
Explanation: 3D Grid on GPU with Kernel Tuner
In this tutorial w... |
statsmaths/stat665 | lectures/lec22/.ipynb_checkpoints/notebook22-checkpoint.ipynb | gpl-2.0 | %pylab inline
import copy
import numpy as np
import pandas as pd
import sys
import os
import re
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, RMSprop
from keras.layers.normalization import BatchNormalization
from keras.layers.wrappers i... |
mdiaz236/DeepLearningFoundations | sentiment_network/Sentiment Classification - Mini Project 3.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
ljishen/kividry | experiments/benchmarking/visualize_1.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import random
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
pd.set_option("display.max_rows", 8)
"""
Explanation: Performance Benchmarking for KV Drive
The goal of these set of experiments is to characterize the variability across platforms in a system... |
austinjalexander/sandbox | python/py/nanodegree/intro_ml/EnronPOI-Copy1.ipynb | mit | ### Task 1: Select what features you'll use.
### features_list is a list of strings, each of which is a feature name.
### The first feature must be "poi".
features_list = my_dataset.itervalues().next().keys()
features_list.sort()
features_list.remove('poi')
features_list.insert(0, 'poi')
features_list.remove('email_ad... |
tensorflow/docs-l10n | site/zh-cn/guide/eager.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... |
ericmjl/data-testing-tutorial | 3-data-checks.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
"""
Explanation: Data Checks
Schema checks: Making sure that only the columns that are expected are provided.
Datum checks:
Looking for missing values
Ensuring that expected value ranges are correct
Statistical... |
preigemufc/1.2016.1.notebooks | Minicurso_programação_modelagem_1.2016.1.3.5.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import pylab as py
v1 = np.array([3,2,1])
v1
v1.sort()
v1
v2 = np.empty([2,2])
v2
"""
Explanation: Parte 1 - Programação
Exemplo 1
O código a seguir inicia nosso script para a aula. Ele carrega os pacotes que iremos utilizar.
Antes de mais nada, carregamos o pacote de funções m... |
renecnielsen/twitter-diy | ipynb/01b Fetch Tweets by User.ipynb | mit | from IPython.core.display import HTML
styles = open("../css/custom.css", "r").read()
HTML(styles)
"""
Explanation: Fetch Tweets by User
NOTE: You must have Python Twitter Tools installed on the machine to run this script. You can install it by running the below cell (change the cell type in the toolbar above to Code i... |
mikekestemont/lot2016 | Chapter 5 - Functions and Files.ipynb | mit | f = open('data/austen-emma-excerpt.txt', 'rt', 'utf-8')
text = f.read()
f.close()
print(text)
"""
Explanation: Chapter 5: Functions and Files
File Input/Output
Input for your programs often comes from files on your disk, such as 'corpora' (a 'corpus' is what we call a large collection of digital text in linguistics). ... |
AllenDowney/ThinkBayes2 | examples/hospital4.ipynb | mit | # If we're running on Colab, install libraries
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install pymc3
!pip install arviz
!pip install empiricaldist
# PyMC generates a FutureWarning we don't need to deal with yet
import warnings
warnings.filterwarnings("ignore", category=Futur... |
JAmarel/QLab | MillikanOilDrop/.ipynb_checkpoints/Analysis-checkpoint.ipynb | mit | df = pd.read_excel('Data.xlsx', sheetname=None)
df['Run 1']
keys = ['Run 1', 'Run 2', 'Run 3', 'Run 4']
# Fall time in seconds when V = 0
tf = np.array([df[key]['t_f (s)'] for key in keys])
tf
# Average Fall times for each run (seconds)
avg_tf = np.array([np.mean(tf[i]) for i in np.arange(4)])
avg_tf
# Standard D... |
GoogleCloudPlatform/training-data-analyst | self-paced-labs/tfx/tfx-ai-platform/labs/lab_exercise.ipynb | apache-2.0 | import yaml
# Set `PATH` to include the directory containing TFX CLI and skaffold.
PATH=%env PATH
%env PATH=/home/jupyter/.local/bin:{PATH}
"""
Explanation: Continuous training with TFX and Google Cloud AI Platform
Learning Objectives
Use the TFX CLI to build a TFX pipeline.
Deploy a TFX pipeline version with tuning... |
ebommes/breweries | examples/text_classification.ipynb | mit | import os
import pickle
# visualization
import matplotlib.pyplot as plt
# pandas
import pandas as pd
# sklearnlinter
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.svm import SVC
# nlp
import spacy
import texta... |
wangyu16/Introduction-to-Polymer-Science | .ipynb_checkpoints/RDRP_Kinetic_Simulator_Moments-checkpoint.ipynb | cc0-1.0 | from chempy import ReactionSystem, Substance
from chempy.kinetics.ode import get_odesys
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
import datetime
import csv
"""
Explanation: <center>RDRP Kinetic Simulator - by the Method of Moments </center>
... |
shikhar413/openmc | examples/jupyter/mgxs-part-i.ipynb | mit | from IPython.display import Image
Image(filename='images/mgxs.png', width=350)
"""
Explanation: Multigroup Cross Section Generation Part I: Introduction
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 Not... |
alantian/polyglot | notebooks/Detection.ipynb | gpl-3.0 | from polyglot.detect import Detector
"""
Explanation: Language Detection
Polyglot depends on pycld2 library which in turn depends on cld2 library for detecting language(s) used in plain text.
End of explanation
"""
arabic_text = u"""
أفاد مصدر امني في قيادة عمليات صلاح الدين في العراق بأن " القوات الامنية تتوقف لليو... |
anilcs13m/MachineLearning_Mastering | polynomial-regression-assignment.ipynb | gpl-2.0 | import graphlab
"""
Explanation: Regression Week 3: Assessing Fit (polynomial regression)
In this notebook you will compare different regression models in order to assess which model fits best. We will be using polynomial regression as a means to examine this topic. In particular you will:
* Write a function to take a... |
RicardoArauj0/TitanicKaggleML | Machine Learning - Titanic Disaster Solutions.ipynb | apache-2.0 | #import libraries
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
#Get data
train = pd.read_csv('TRAIN.csv')
test = pd.read_csv('TEST.csv')
"""
Explanation: Import libraries and get data
Solution from Kaggle Titanic
Data... |
grfiv/MNIST | vw/VW_benchmark_nn.ipynb | mit | from __future__ import division
import re
import numpy as np
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
%matplotlib inline
#%qtconsole
"""
Explanation: MNIST classification with Vowpal Wabbit
Neural Net
End of explanation
"""
!rm train.vw.cache
!rm mnist_train_nn.model
!vw -d d... |
initialkommit/kookmin | midterm/kookmin_midterm_이주경_week_to_day.ipynb | mit | ##1년은 52주로 구성됨
week = list(range(1, 53)) #range 함수의 첫 번째 파라매터에는 시작할 숫자, 두 번째 파라매터에는 끝나는 숫자보다 1 큰 수를 넣어줌
week
len(week)
"""
Explanation: 주 단위 데이터를 일 단위 데이터로 늘리기
네이버 검색 트렌드는 주 단위로 특정 검색어에 대한 검색량을 제공하고 있음
주별 검색량을 검색 기간 사이의 최소검색량, 최대검색량을 기준으로 0~100 사이의 수로 scaling하여 보여줌
이 주 단위의 데이터를 차후 데이터 분석 프로젝트(종속변수 예측)에서 입력변수로 사용할 때 ... |
google/tensorflow-recorder | samples/Using-TFRecorder-with-Google-Cloud-Dataflow.ipynb | apache-2.0 | import pandas as pd
import tfrecorder
import os
!pip download tfrecorder --no-deps
!cp tfrecorder* /tmp
BUCKET="" # ADD YOUR BUCKET HERE, E.G. "GS://MYBUCKET/"
PROJECT="" # ADD YOUR PROJECT NAME HERE
REGION="" # ADD A COMPUTE REGION HERE
OUTPUT_PATH = "results/"
TFRECORDER_WHEEL = "/tmp/tfrecorder-0.1.1-py3-none-any.... |
taliamo/Final_Project | organ_pitch/Scripts/main_script.ipynb | mit | # I import useful libraries (with functions) so I can visualize my data
# I use Pandas because this dataset has word/string column titles and I like the readability features of commands and finish visual products that Pandas offers
import pandas as pd
import matplotlib.pyplot as plt
import re
import numpy as np
%matp... |
icrtiou/coursera-ML | ex7-kmeans and PCA/4- 2D PCA.ipynb | mit | mat = sio.loadmat('./data/ex7data1.mat')
X = mat.get('X')
# visualize raw data
print(X.shape)
sns.lmplot('X1', 'X2',
data=pd.DataFrame(X, columns=['X1', 'X2']),
fit_reg=False)
"""
Explanation: load data
End of explanation
"""
X_norm = pca.normalize(X)
sns.lmplot('X1', 'X2',
data... |
ajrichards/bayesian-examples | munging/regular_expression_challanges.ipynb | bsd-3-clause | import re
my_str = "This (frodo@gmail.com) is what you are looking for, but here is my other address: samwise@minis-tirith.edu"
pattern = r"[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*"
print(re.findall(pattern, my_str))
"""
Explanation: Regular Expressions
Whether it is a refresher, a primer or simply more reps. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.