repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tumi8/siblings | src/eval/siblings_ml.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import precision_score
from sklearn.metrics import f1_score
f... |
zzsza/Datascience_School | 15. 선형 회귀 분석/03. 레버리지와 아웃라이어.ipynb | mit | from sklearn.datasets import make_regression
X0, y, coef = make_regression(n_samples=100, n_features=1, noise=20, coef=True, random_state=1)
# add high-leverage points
X0 = np.vstack([X0, np.array([[4],[3]])])
X = sm.add_constant(X0)
y = np.hstack([y, [300, 150]])
plt.scatter(X0, y)
plt.show()
model = sm.OLS(pd.Data... |
keras-team/keras-io | examples/vision/ipynb/learnable_resizer.ipynb | apache-2.0 | from tensorflow.keras import layers
from tensorflow import keras
import tensorflow as tf
import tensorflow_datasets as tfds
tfds.disable_progress_bar()
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Learning to Resize in Computer Vision
Author: Sayak Paul<br>
Date created: 2021/04/30<br>
Last m... |
RicardoGranados/Test | FFT Test.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
# First give the parameters for the sinusoidal wave to evaluate in the FFT
f = 1 # Frequency
Fs = 100 # Sampling frequency
Ts = 1.0/Fs # Sampling period
phi = 0 # Phase in degrees
endTime = 1 # Total time of the signal
# Remember to have a complete number... |
tensorflow/docs-l10n | site/ja/hub/tutorials/image_enhancing.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... |
diging/networks | 1. First steps with Python.ipynb | gpl-3.0 | 1 + 1
"""
Explanation: Programming for Network Research
Erick Peirson, PhD | erick.peirson@asu.edu | @captbarberousse
Last updated 21 January, 2016
0. Introduction.
1. First steps with Python.
2. Objects and types.
3. Flow control: if, elif, else, and friends.
4. First steps with NetworkX.
5: I/O: working with data! ... |
JaeGyu/PythonEx_1 | 파이썬 함수연습.ipynb | mit | def swap(a,b):
return b,a #튜플이 반환된다.
a = 1
b = 2
a,b = swap(a,b)
print(a,b)
print(swap)
"""
Explanation: <pre>
함수의 return은 오직 한개의 객체만 리턴한다.
보통 튜플로 리턴을 할 경우 여러개의 변수로 한번에 받게 할 수 있어 마치 return이 여러개의 값을 동시에 리턴하는 것처럼 보이지만
튜플이라는 객체 하나를 리턴하는 것이다.
</pre>
End of explanation
"""
def intersect(prelist, postlist):
... |
avallarino-ar/MCDatos | Notas/Notas-Python/01_Estructuras.ipynb | mit | x = (1,2,3,0,2,1) # Declaración de una tupla con valores numéricos
x # Imprimo tupla
x = (0, 'Hola', (1,2)) # Declaración de una tupla con diferentes tipos de datos
x[1] # Imprimo contenido de la posición 1
"""
Explanation: Resumen de estructuras de datos en Python
Tuplas, List... |
mne-tools/mne-tools.github.io | 0.19/_downloads/5896a1084085b2a4929647fc8cbaf675/plot_movement_compensation.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from os import path as op
import mne
from mne.preprocessing import maxwell_filter
print(__doc__)
data_path = op.join(mne.datasets.misc.data_path(verbose=True), 'movement')
head_pos = mne.chpi.read_head_pos(op.join(data_path, 'simulated_qu... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Programming/Python/Python3Espanol/1_Introduccion/09. Estructuras de Control.ipynb | gpl-3.0 | def mayor_o_menor(x, y):
if x < y:
print(x, "es menor que", y)
elif x > y:
print(x, "es mayor que", y)
else:
print(x, "y", y, "son iguales")
"""
Explanation: El condicional (if)
Es quizá la estructura de control más utilizada. A continuación presentamos un sencillo ejemplo para obse... |
jxchen01/jxchen01.github.io | notebook/basic_image_operations.ipynb | mit | from PIL import Image
from numpy import *
from scipy.ndimage import measurements, filters
from pylab import *
"""
Explanation: Basic Image Operations in Python
This is the reading note of chapter 1 (BOOK Link). Part of the contents are adopted from this tutorial.
Official python documentation: LINK
End of explanation
... |
quantopian/research_public | notebooks/tutorials/1_getting_started_lesson2/notebook.ipynb | apache-2.0 | # Research environment functions
from quantopian.research import returns, symbols
# Select a time range to inspect
period_start = '2014-01-01'
period_end = '2017-1-1'
# Query returns data for AAPL
# over the selected time range
aapl_returns = returns(
assets=symbols('AAPL'),
start=period_start,
end=period... |
rigginscallen/machine-learning-public | boston_housing/boston_housing.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
import visuals as vs # Supplementary code
from sklearn.cross_validation import ShuffleSplit
# Pretty display for notebooks
%matplotlib inline
# Load the Boston housing dataset
data = pd.read_csv('housing.csv')
prices = data['MEDV']
f... |
JeffAbrahamson/MLWeek | practicum/05_regression/regression-lineaire.ipynb | gpl-3.0 | Diametre = [[6], [9], [12], [15], [18], [30]]
prix = [[7], [9], [13], [17.5], [18], [24]]
plt.figure()
plt.title('Pizza v diametre')
plt.xlabel('Diametre (cm)')
plt.ylabel(u'Prix (€)')
plt.plot(Diametre, prix, 'k.')
plt.axis([0, 32, 0, 25])
plt.grid(True)
plt.show()
"""
Explanation: La pizza
Prenons comme exemple le p... |
mercybenzaquen/foundations-homework | foundations_hw/05/Homework5_NYT.ipynb | mit | #my IPA key b577eb5b46ad4bec8ee159c89208e220
#base url http://api.nytimes.com/svc/books/{version}/lists
import requests
response = requests.get("http://api.nytimes.com/svc/books/v2/lists.json?list=hardcover-fiction&published-date=2009-05-10&api-key=b577eb5b46ad4bec8ee159c89208e220")
best_seller = response.json()
print... |
bloomberg/bqplot | examples/Marks/Object Model/Market Map.ipynb | apache-2.0 | data = pd.read_csv("../../data_files/country_codes.csv", index_col=[0])
country_codes = data.index.values
country_names = data["Name"]
"""
Explanation: Get Data
End of explanation
"""
market_map = MarketMap(
names=country_codes,
# basic data which needs to set for each map
ref_data=data,
# Data frame... |
IEEE-NITK/DeepNLP | Project-Code/thrones2vec/GoT_vectors.ipynb | mit | def best_avgs(words, all_vecs,k=10):
from operator import itemgetter
## get word embeddings for the words in our input array
embs = np.array([thrones2vec[word] for word in words])
#calculate its average
avg = np.sum(embs,axis=0)/len(words)
# Cosine Similarity with every word ... |
explosion/thinc | examples/04_configure_gpu_memory.ipynb | mit | !pip install "thinc>=8.0.0" torch "tensorflow>=2.0"
from thinc.api import require_gpu
require_gpu()
"""
Explanation: Using a single memory pool for Cupy and PyTorch or TensorFlow
Requesting memory from a GPU device directly is expensive, so most deep learning libraries will over-allocate, and maintain an internal p... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session01/Day4/StarGalaxyRandomForest.ipynb | mit | import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Supervised Machine Learning Break Out:
Separating Stars and Galaxies from SDSS
Version 0.1
Many (nearly all?) of the science applications for LSST data will rely on the accurate separation of stars an... |
sthuggins/phys202-2015-work | assignments/assignment04/MatplotlibEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo... |
tensorflow/docs-l10n | site/pt-br/tutorials/load_data/pandas_dataframe.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... |
JohnSnowLabs/spark-nlp | python/tensorflow/ner/create_models.ipynb | apache-2.0 | import numpy as np
import os
import logging
import tensorflow.compat.v1 as tf
import string
import random
import math
import sys
import shutil
sys.path.append('../lib/ner')
from ner_model import NerModel
from dataset_encoder import DatasetEncoder
from ner_model_saver import NerModelSaver
from pathlib import Path
pri... |
hanezu/cs231n-assignment | assignment2/ConvolutionalNetworks.ipynb | mit | # As usual, a bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.cnn import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
from cs231n.fast_layers import *
from cs... |
leopardbruce/FileFun | Course_1_Part_4_Lesson_2_Notebook.ipynb | mit | import tensorflow as tf
print(tf.__version__)
"""
Explanation: <a href="https://colab.research.google.com/github/leopardbruce/FileFun/blob/master/%E2%80%9CCourse_1_Part_4_Lesson_2_Notebook_ipynb%E2%80%9D.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></... |
tuanavu/coursera-university-of-washington | machine_learning/2_regression/assignment/week1/week-1-simple-regression-assignment-sklearn.ipynb | mit | import pandas as pd
import numpy as np
dtype_dict = {'bathrooms':float, 'waterfront':int, 'sqft_above':int, 'sqft_living15':float,
'grade':int, 'yr_renovated':int, 'price':float, 'bedrooms':float, 'zipcode':str,
'long':float, 'sqft_lot15':float, 'sqft_living':float, 'floors':str, 'conditi... |
phoebe-project/phoebe2-docs | 2.3/tutorials/settings.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Advanced: Settings
The Bundle also contains a few Parameters that provide settings for that Bundle. Note that these are not system-wide and only apply to the current Bundle. They are however maintained when saving and loading a Bundle.
Setup
Let's first make sure ... |
jenshnielsen/HJCFIT | exploration/Distribution_histograms_and_individual_benchmark.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: Distribution histograms and individual benchmarks
End of explanation
"""
import os
os.environ['OMP_NUM_THREADS'] = '1'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.text as mtext
import time
import math
import sys
import numpy as np
from scipy.optimize imp... |
Vvkmnn/books | TensorFlowForMachineIntelligence/chapters/05_object_recognition_and_classification/Chapter 5 - 04 Working with Images.ipynb | gpl-3.0 | red = tf.constant([255, 0, 0])
"""
Explanation: Images and TensorFlow
TensorFlow is designed to support working with images as input to neural networks. TensorFlow supports loading common file formats (JPG, PNG), working in different color spaces (RGB, RGBA) and common image manipulation tasks. TensorFlow makes it eas... |
CalebBell/fluids | docs/Examples/Crane TP 410 Solved Problems/7.24 Laminar Flow.ipynb | mit | from fluids.units import *
from math import pi
NPS, Di, Do, t = nearest_pipe(NPS=3, schedule='40')
A = 0.25*pi*Di*Di
D2 = 2.15*u.inch
mu = 40*u.cP # given
rho = 53.6*u.lb/u.ft**3
# Assume an absolute pressure of 5 bar.
dP = 0.4*u.psi
P1 = 5*u.bar
P2 = P1-dP
k = 1.3 # assumed
# First calculate the orifice with the s... |
moranconnorj/code_guild | wk0/notebooks/challenges/reverse_string/reverse_string_challenge.ipynb | mit |
def list_of_chars(list_chars):
"""Returns a list of characters in reverse order.
Takes a list of characters, if the list is not None, returns the list in
reverse order
Parameters
--------------
Input:
list_chars: list
a list of single character strings
Output:
lis... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-2/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-2', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-2
Topic: Ocnbgchem
Sub-Topics: Tracers.
P... |
UWSEDS-aut17/uwseds-group-city-fynders | cityfynders/city_fynder.ipynb | mit | import pandas as pd
import numpy as np
import data_processing as dp
(natural, human, economy, tertiary) = dp.read_data()
"""
Explanation: Which city would you like to live in?
Created by City Fynders
1. Import data
End of explanation
"""
#natural
natural['Air'] = natural['Air'].rank(ascending=0)
natural['Water_qu... |
watsonyanghx/CS231n | assignment2/.ipynb_checkpoints/BatchNormalization-checkpoint.ipynb | mit | # As usual, a bit of setup
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.solver import Solver
%matplotlib inline
... |
nicolas998/Radar | Examples/Ejemplo_Uso_radar.ipynb | gpl-3.0 | %matplotlib inline
from radar import radar
# Inicio del objeto tipo radar y lectura de un binario
rad = radar.radar_process()
rad.read_bin('../radar/20150518/201505180155_010_120.bin')
"""
Explanation: Ejemplo para usar el paquete Radar
a continuación se presenta de manera rápida como se puede leer un binario, y obt... |
cni/psych204a | mrVisualization.ipynb | gpl-2.0 | # set up plotting, numpy/matplotlib, etc.
%pylab inline
import matplotlib as mpl
mpl.rcParams["figure.figsize"] = (8, 6)
mpl.rcParams["axes.grid"] = True
from mpl_toolkits.axes_grid1 import make_axes_locatable
from IPython.display import display
"""
Explanation: Visualization
Class: Psych 204a
Tutorial: Visualiza... |
apmechev/GRID_LRT | GRID_LRT/tutorials/LRT_demo.ipynb | gpl-3.0 | import os
import GRID_LRT
print(GRID_LRT.__file__)
import subprocess
from GRID_LRT.get_picas_credentials import picas_cred
from GRID_LRT.Staging import stage_all_LTA
from GRID_LRT.Staging import state_all
from GRID_LRT.Staging import stager_access
from GRID_LRT.Staging.srmlist import srmlist
from GRID_LRT import token
... |
iAInNet/tensorflow_in_action | _transfer_learning.ipynb | gpl-3.0 | Image('data/08_transfer_learning_flowchart.png')
%matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import time
import os
import inception
import prettytensor as pt
import matplotlib.cm as cm
import cifar10
from cifar10 import num_classes
cifar10.maybe_download_and_extrac... |
heprom/pymicro | examples/SampleDataUserGuide/1_Getting_Information_from_SampleData_datasets.ipynb | mit | from pymicro.core.samples import SampleData as SD
"""
Explanation: 2 - Getting started with SampleData : Exploring dataset contents
This second User Guide tutorial will introduce you to:
create and open datasets with the SampleData class
the SampleData Naming System
how to get informations on a dataset content intera... |
IACS-CS-207/cs207-F17 | homeworks/HW8/HW8.ipynb | mit | #Load CSV file -- hint: you can use np.genfromtxt()
"""
Explanation: Homework 8
Due Date: Tuesday, October 31st at 11:59 PM
Problem 1: BST Traversal
This problem builds on Problem 1 of Homework 7 in which you wrote a binary search tree.
Part 1
As discussed in lecture, three different types to do a depth-first traver... |
quantumlib/Cirq | docs/start.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... |
msschwartz21/craniumPy | experiments/templates/TEMP-alignment.ipynb | gpl-3.0 | import deltascope.alignment as ut
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import h5py
import os
import re
import time
import tqdm
"""
Explanation: Introduction
This notebook facilitates the manual curation of sample alignment.
End of explanation
"""
# --------------------------------... |
ES-DOC/esdoc-jupyterhub | notebooks/cas/cmip6/models/fgoals-f3-l/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cas', 'fgoals-f3-l', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CAS
Source ID: FGOALS-F3-L
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turb... |
pvchaumier/ml_by_example | src/KMeans.ipynb | isc | import random
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from fct import normalize_min_max, plot_2d, plot_clusters
"""
Explanation: K-Means
Goal
Unsupervised learning algorithms look for structure in unlabelled data. One of the common objective is to find clusters. Clusters ar... |
patrickmineault/xcorr-notebooks | notebooks/Q-Learning & OpenAI gym.ipynb | mit | %matplotlib inline
# Standard imports.
import numpy as np
import pylab
import scipy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Resize plots.
pylab.rcParams['figure.figsize'] = 12, 7
def qlearning(reward_transition_function,
policy_function,
gamma,
... |
nick-youngblut/SIPSim | ipynb/theory/Gaussian_diff_limits.ipynb | mit | %load_ext rpy2.ipython
workDir = '/home/nick/notebook/SIPSim/dev/fullCyc/frag_norm_9_2.5_n5/default_run/'
%%R
sigmas = seq(1, 50, 1)
means = seq(25, 100, 1) # mean GC content of 30 to 70%
## max 13C shift
max_13C_shift_in_BD = 0.036
## min BD (that we care about)
min_GC = 13.5
min_BD = min_GC/100.0 * 0.098 + 1.6... |
daniel-koehn/Theory-of-seismic-waves-II | 06_2D_SH_Love_wave_modelling/2_From_2D_acoustic_to_SH_FD_modelling_final.ipynb | gpl-3.0 | # Execute this cell to load the notebook's style sheet, then ignore it
from IPython.core.display import HTML
css_file = '../style/custom.css'
HTML(open(css_file, "r").read())
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 by D. Koehn, notebook styl... |
HarshaDevulapalli/foundations-homework | 07/07 Homework Part 2.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_excel("richpeople.xlsx")
rich = df[df['year'] == 2014] #Getting only the latest list.
rich.head(5)
rich.columns
"""
Explanation: BILLIONAIRES
Let us first import the database.
End of explanation
"""
numberofbillionaires=rich['c... |
ajaykumar-bollepalli/pythontraining | PrintFormatting.ipynb | apache-2.0 | print("My number %s" %("hello"))
s=13.4576
print('Floating point: %1.3f' %(s))
print('FLoating point value appending zeros: %1.8f' %(s))
print('Floating point with filled in spaces: %25.4f' %(s))
"""
Explanation: Print Formatting Practice (Numbers and Strings)
End of explanation
"""
print('First: %s, Second: %1.1... |
d-k-b/udacity-deep-learning | batch-norm/Batch_Normalization_Solutions.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Solutions
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a co... |
hankcs/HanLP | plugins/hanlp_demo/hanlp_demo/zh/amr_restful.ipynb | apache-2.0 | !pip install hanlp_restful -U
"""
Explanation: <h2 align="center">点击下列图标在线运行HanLP</h2>
<div align="center">
<a href="https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/amr_restful.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.s... |
hongguangguo/shogun | doc/ipython-notebooks/intro/Introduction.ipynb | gpl-3.0 | %pylab inline
%matplotlib inline
#To import all Shogun classes
from modshogun import *
"""
Explanation: Machine Learning with Shogun
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> as a part of <a href="http://www.google-melange.com/gsoc/project/details/google/gsoc2014/saurabh7/5750... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/mpi-esm-1-2-lr/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'mpi-esm-1-2-lr', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: MPI-M
Source ID: MPI-ESM-1-2-LR
Topic: Landice
Sub-Topics: Glaciers, Ice. ... |
nikbearbrown/Deep_Learning | NEU/Sai_Raghuram_Kothapalli_DL/TF on MNIST with Multilayer Perception.ipynb | mit | # Import MINST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
"""
Explanation: Get the Data
We will be using the famous MNIST data set of handwritten digits.
The images which we will be working with are black and white images of size 28 x ... |
michaelaye/iuvs | notebooks/Very lighty dark.ipynb | isc | from iuvs import io
%autocall 1
import os
files = !ls ~/data/iuvs/level1b/*.gz
for file in files:
print(os.path.basename(file))
"""
Explanation: Loading data
End of explanation
"""
l1b = io.L1BReader(files[-1])
"""
Explanation: loading file with very lighty dark
It's the last MUV file that has the very bright ... |
atlury/deep-opencl | DL0110EN/4.1.2xor.ipynb | lgpl-3.0 | !conda install -y torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
"""
Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px">
<a href="http://cocl.us/pytorch_link_to... |
Unidata/unidata-python-workshop | notebooks/Declarative_Plotting/Satellite_Declarative.ipynb | mit | from siphon.catalog import TDSCatalog
from datetime import datetime
# Create variables for URL generation
image_date = datetime.utcnow().date()
region = 'Mesoscale-1'
channel = 8
# Create the URL to provide to siphon
data_url = ('https://thredds.ucar.edu/thredds/catalog/satellite/goes/east/products/'
f'C... |
cdawei/digbeta | dchen/music/baseline_plgen_cold.ipynb | gpl-3.0 | %matplotlib inline
import os, sys, time, gzip
import pickle as pkl
import numpy as np
import pandas as pd
from scipy.sparse import lil_matrix, issparse, csc_matrix, csr_matrix
import torch
from tqdm import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
# from tools import calc_RPrecision_HitRate
from tool... |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/tensorflow/optimize/06_Train_Model_XLA_CPU.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow.python.client import timeline
import pylab
import numpy as np
import os
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
tf.logging.set_verbosity(tf.logging.INFO)
"""
Explanation: Train Model with XLA_CPU (and CPU*)
Some operations do not have XLA_CPU equivale... |
udacity/deep-learning | intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
mne-tools/mne-tools.github.io | 0.21/_downloads/bf3ad991f7c7776e245520709f49cb04/plot_cwt_sensor_connectivity.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne import io
from mne.connectivity import spectral_connectivity, seed_target_indices
from mne.datasets import sample
from mne.time_frequency import AverageTFR
print(__doc__)
"""
Explanation: Compute... |
gwtsa/gwtsa | examples/notebooks/7_ well_example.ipynb | mit | import pandas as pd
import pastas as ps
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Drawdown caused by groundwater extraction
Developed by R.A. Collenteur & M. Bakker
In this example notebook it is shown how to simulate the effect of a pumping well on the groundwater levels. We will first creat... |
GiannaJo/stat215a-journal-review | notebooks/PittHill_table1.ipynb | mit | # some programmatic housekeeping
import os
import sys
import numpy as np
import pandas as pd
from scipy.stats import poisson
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
np.random.seed(215)
%matplotlib inline
notebook = "PittHill_table1.ipynb" # replace with FILENAME
sys.path.append(os.path.abspath... |
DSSatPitt/katz-python-workshop | data-science-demo/pgh-311.ipynb | cc0-1.0 | # use the %ls magic to list the files in the current directory.
%ls
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sms
%matplotlib inline
three11s = pd.read_csv("data/pgh-311.csv", parse_dates=['CREATED_ON'])
three11s.dtypes
three11s.head()
three11s.loc[0]
"""
Explanation: Playing around wi... |
peterwittek/open_science_tutorial | Linear algebra and numerical calculations.ipynb | gpl-3.0 | from __future__ import print_function, division
from sympy.interactive import printing
printing.init_printing(use_latex='mathjax')
"""
Explanation: Basics of lists and arrays
Let us start with the same boilerplate code:
End of explanation
"""
from numpy import *
"""
Explanation: The default solution for doing numer... |
vrbala/vrbala.github.io | machine-learning-nanodegree/customer_segments/customer_segments/customer_segments.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
# Import libraries: NumPy, pandas, matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Tell iPython to include plots inline in the notebook
%matplotlib inline
# Read dataset
data = pd.read_csv("wholesale-customers.csv")
print "Dataset ... |
anandha2017/udacity | nd101 Deep Learning Nanodegree Foundation/DockerImages/25_sentiment_prediction_rnn/notebooks/02-sentiment-rnn/Sentiment_RNN_Solution.ipynb | mit | import numpy as np
import tensorflow as tf
with open('./reviews.txt', 'r') as f:
reviews = f.read()
with open('./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 network that performs sentiment analy... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/wls.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.api as sm
from scipy import stats
from statsmodels.iolib.table import SimpleTable, default_txt_fmt
np.random.seed(1024)
"""
Explanation: Weighted Least Squares
End of explanation
"""
nsample = 50
x = np.linspace(0, 20, nsample... |
tensorflow/tensorrt | tftrt/examples/presentations/GTC-April2021-Dynamic-shape-UNet.ipynb | apache-2.0 | import os
os.environ["TF_CPP_VMODULE"]="trt_engine_utils=2,segment=2" # verbose output
os.environ["TF_TRT_OP_DENYLIST"] = "Shape" # workaround for shape output memory error
!pip install pillow matplotlib
import tensorflow as tf
from tensorflow.python.compiler.tensorrt import trt_convert as trt
import... |
kaushik94/tardis | docs/running/interaction/hdf_writer.ipynb | bsd-3-clause | from tardis.io.util import HDFWriterMixin
class ExampleClass(HDFWriterMixin):
hdf_properties = ['property1', 'property2']
hdf_name = 'mock_setup'
def __init__(self, property1, property2):
self.property1 = property1
self.property2 = property2
import numpy as np
import pandas as pd
... |
tensorflow/docs-l10n | site/ja/lattice/tutorials/canned_estimators.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
beangoben/HistoriaDatos_Higgs | Dia3/.ipynb_checkpoints/5_Datos_Iris-checkpoint.ipynb | gpl-2.0 | import pandas as pd
import numpy as np # modulo de computo numerico
import matplotlib.pyplot as plt # modulo de graficas
# esta linea hace que las graficas salgan en el notebook
import seaborn as sns
%matplotlib inline
"""
Explanation: A explorar los datos del LHC
Hoy vamos a combinar dos conceptos que vimos ayer:
A... |
ceholden/glmnet-python | examples/glmnet_demo.ipynb | gpl-2.0 | import numpy as np
from sklearn.datasets import load_boston, load_diabetes
from sklearn.linear_model import coordinate_descent as cd
import matplotlib.pyplot as plt
import glmnet
boston = load_boston()
diabetes = load_diabetes()
X, y = boston['data'], boston['target']
# X, y = diabetes['data'], diabetes['target']
l... |
sgkang/DamGeophysics | notebook/FFT Filters.ipynb | mit | from SimPEG import *
%pylab inline
# Import a Kalman filter and other useful libraries
from pykalman import KalmanFilter
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import poly1d
"""
Explanation: Filters
By Evgenia "Jenny" Nitishinskaya, Dr. Aidan O'Mahony, and Delaney Granizo-Mac... |
googledatalab/notebooks | tutorials/Stackdriver Monitoring/Getting started.ipynb | apache-2.0 | # set_datalab_project_id('my-project-id')
"""
Explanation: Getting started with the Stackdriver Monitoring API
Cloud Datalab provides an environment for working with your data. This includes data that is being managed within the Stackdriver Monitoring API. This notebook introduces some of the APIs that Cloud Datalab p... |
AllenDowney/ThinkBayes2 | examples/skeet2_soln.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 classes from thinkbayes2
from thinkbayes2 import Hist, Pmf, Suite, Beta
import thinkplot
import... |
DB2-Samples/db2jupyter | Advanced Db2 JSON Techniques.ipynb | apache-2.0 | %run db2.ipynb
"""
Explanation: Advanced JSON Techniques
The basics of using JSON within DB2 were covered in a previous notebook. This notebook will cover some of the advanced techniques that are required to access arrays and structures that may be nested within a JSON document. The first step (as with any notebook!) ... |
ethanrowe/flowz | userguide/03. KeyedArtifacts and Joining.ipynb | mit | def lame_deriver(num):
return num * 100
chan = IterChannel(KeyedArtifact(i, DerivedArtifact(lame_deriver, i)) for i in range(3))
tee = chan.tee()
app.Flo([chan.map(lambda a: print('key =', a.key, '; [0] =', a[0], '; [1] =', a[1]))]).run()
print('----')
print_chans(tee)
"""
Explanation: KeyedArtifacts and Joining
... |
seg/2016-ml-contest | dagrha/RFC_submission_5.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... |
obulpathi/datascience | scikit/titanic/notebooks/Section 1-0 - First Cut.ipynb | apache-2.0 | import pandas as pd
import numpy as np
df = pd.read_csv('../data/train.csv')
"""
Explanation: Pandas and Scikit-learn
Pandas is a Python library that contains high-level data structures and manipulation tools designed for data analysis. Think of Pandas as a Python version of Excel. Scikit-learn, on the other hand, is... |
bayesimpact/bob-emploi | data_analysis/notebooks/datasets/rome/update_from_v341_to_v342.ipynb | gpl-3.0 | import collections
import glob
import os
from os import path
import matplotlib_venn
import pandas as pd
rome_path = path.join(os.getenv('DATA_FOLDER'), 'rome/csv')
OLD_VERSION = '341'
NEW_VERSION = '342'
old_version_files = frozenset(glob.glob(rome_path + '/*{}*'.format(OLD_VERSION)))
new_version_files = frozenset(... |
squishbug/DataScienceProgramming | DataScienceProgramming/08-Machine-Learning-I/HW5_orig.ipynb | cc0-1.0 | %matplotlib inline
"""
Explanation: <div style="float: right; color: red;">Please, rename this file to <code style="color: red;">HW5.ipynb</code> and save it in <code style="color: red;">MSA8010F16/HW5</code>
</div>
Homework 5: Evaluating Classifiers
End of explanation
"""
print(__doc__)
# Code source: Gaël Varoq... |
tyarkoni/pymc3 | docs/notebooks/getting_started.ipynb | apache-2.0 | import numpy as np
# Intialize random number generator
np.random.seed(123)
# True parameter values
alpha, sigma = 1, 1
beta = [1, 2.5]
# Size of dataset
size = 100
# Predictor variable
X1 = np.linspace(0, 1, size)
X2 = np.linspace(0,.2, size)
# Simulate outcome variable
Y = alpha + beta[0]*X1 + beta[1]*X2 + np.ran... |
ajrichards/bayesian-examples | ml-examples/wine_prediction.ipynb | bsd-3-clause | %matplotlib inline
import os
import numpy as np
import pandas as pd
import scipy as sp
import sklearn
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import RandomForestClassifier
"""
Explanation: Can we predict how well wine will be... |
SolitonScientific/AtomicString | .ipynb_checkpoints/AtomicString1-checkpoint.ipynb | mit | ##########################################################
##This script introduces Atomic Function and Atomic String
##########################################################
import numpy as np
import pylab as pl
################### One Pulse of atomic function
def up1(x: float) -> float:
#Atomic function table
... |
SteveDiamond/cvxpy | examples/notebooks/WWW/parade_route.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import cvxpy as cp
def form_path(points,n):
x, y = [], []
pold = points[0]
for p in points[1:]:
x += list(np.linspace(pold[0],p[0],n))
y += list(np.linspace(pold[1],p[1],n))
pold = p
path = np.array([x,y]).T
return path
de... |
mne-tools/mne-tools.github.io | 0.24/_downloads/4a4a8e5bd5ae7cafea93a04d8c0a0d00/psf_ctf_vertices_lcmv.ipynb | bsd-3-clause | # Author: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk>
#
# License: BSD-3-Clause
import mne
from mne.datasets import sample
from mne.beamformer import make_lcmv, make_lcmv_resolution_matrix
from mne.minimum_norm import get_cross_talk
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects/'
fn... |
DEIB-GECO/PyGMQL | examples/notebooks/03b_GWAS_HDFS.ipynb | apache-2.0 | %%bash
wget -q https://www.ebi.ac.uk/gwas/api/search/downloads/full -O tmp.tsv
cat tmp.tsv | awk 'BEGIN {FS="\t";OFS="\t"} {chrom=$12; gsub(chrom,"chr"chrom,$12)}{print $0}' | sed s/,//g > gwas.tsv
rm tmp.tsv
"""
Explanation: Finding the most representative GWAS associated with cell-specific enhancers
(Execution on H... |
hasadna/knesset-data-pipelines | jupyter-notebooks/Mk_connections/Mk_connections-data_aggregation.ipynb | mit | import pandas as pd
import networkx as nx
rows = []
protocol_rows = []
"""
Explanation: Connections between MKs
**MK = Member of the knesset (חבר כנסת)
Based on transcripts of the knesset committees.<br/>
The work was done in the 'public knowledge workshop' hackathon and won 3rd place prize.
End of explanation
"""
... |
carltoews/tennis | notebooks/merge_datasets.ipynb | gpl-3.0 | import IPython as IP
IP.display.Image("example_of_name_matching_problems_mod.png",width=400,height=200,embed=True)
"""
Explanation: <p style="text-align: center"> Merging "odds" and "player" data</p>
Author: Carl Toews
File: merge_datasets.ipynb
Description:
An obvious metric for assessing the quality of learn... |
xR86/ml-stuff | kaggle/enron-email/Topic modelling using gensim.ipynb | mit | %%bash
ls | grep .csv
# built-in libs
import email
# processing libs
import pandas as pd
# display libs
from tqdm import tqdm_notebook
"""
Explanation: Topic modelling using gensim <a class="tocSkip">
<!--[kaggle.com/rahulvks/topic-modeling-using-gensim/notebook](https://www.kaggle.com/rahulvks/topic-modeling-using... |
ShiroJean/Breast-cancer-risk-prediction | NB2_ExploratoryDataAnalysis.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
#Load libraries for data processing
import pandas as pd #data processing, CSV file I/O (e.g. pd.read_csv)
import numpy as np
from scipy.stats import norm
import seaborn as sns # visualization
plt.rcParams['figure.figsize'] = (15,8)
plt.rcParams['axes.titlesize'] = ... |
jhillairet/scikit-rf | doc/source/examples/metrology/SOLT.ipynb | bsd-3-clause | import skrf as rf
from skrf.calibration import SOLT
rf.stylely()
"""
Explanation: SOLT
This little example demonstrates how to use scikit-rf for a basic SOLT calibration.
Basic Use
Imports
First we import skrf, the SOLT class, and setup matplotlib plotting.
End of explanation
"""
dut = rf.data.ring_slot
dut.plot_s... |
fastai/course-v3 | zh-nbs/Lesson3_planet.ipynb | apache-2.0 | %reload_ext autoreload
%autoreload 2
%matplotlib inline
from fastai.vision import *
"""
Explanation: Practical Deep Learning for Coders, v3
Lesson3_planet
Multi-label prediction with Planet Amazon dataset
基于Planet Amazon数据集的多标签分类预测
End of explanation
"""
# ! {sys.executable} -m pip install kaggle --upgrade
"""
Exp... |
luizhsda10/Data-Science-Projectcs | Data Visualization/Seaborn/Seaborn Practice - Titanic Data.ipynb | mit | import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_style('whitegrid')
titanic = sns.load_dataset('titanic')
titanic.head()
"""
Explanation: Titanic Dataset
In this project, we will be working with the titanic dataset. A set of data manipulation and visualization techniques will be use... |
metpy/MetPy | v0.12/_downloads/e1a6a28aa03f7e0f88631b525fc7c40d/Hodograph_Inset.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, Hodograph, SkewT
from metpy.units import units
"""
Explanation: Hodograph Inset
Layout a Skew-T plo... |
pastas/pastas | examples/notebooks/04_adding_rivers.ipynb | mit | import pandas as pd
import pastas as ps
import matplotlib.pyplot as plt
ps.show_versions()
ps.set_log_level("INFO")
"""
Explanation: Adding river levels
Developed by R.A. Collenteur & D. Brakenhoff
In this example it is shown how to create a Pastas model that not only includes precipitation and evaporation, but also ... |
sxjscience/mxnet | example/recommenders/demo2-dssm.ipynb | apache-2.0 | import warnings
import mxnet as mx
from mxnet import gluon, nd, autograd, sym
import numpy as np
from sklearn.random_projection import johnson_lindenstrauss_min_dim
# Define some constants
max_user = int(1e5)
title_vocab_size = int(3e4)
query_vocab_size = int(3e4)
num_samples = int(1e4)
hidden_units = 128
epsilon_pr... |
jnarhan/Breast_Cancer | src/models/JN_BC_Threshold_Detection.ipynb | mit | import os
import sys
import time
import numpy as np
from tqdm import tqdm
import sklearn.metrics as skm
from sklearn import metrics
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from skimage import color
import keras.callbacks as cb
import keras.utils.np_utils as np_utils
from ker... |
christophmark/bayesloop | docs/source/tutorials/changepointstudy.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt # plotting
import seaborn as sns # nicer plots
sns.set_style('whitegrid') # plot styling
import bayesloop as bl
import numpy as np
"""
Explanation: Change-point study
Change point analysis or change detection deals with abrupt changes in statistical pr... |
ES-DOC/esdoc-jupyterhub | notebooks/csir-csiro/cmip6/models/vresm-1-0/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csir-csiro', 'vresm-1-0', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: CSIR-CSIRO
Source ID: VRESM-1-0
Topic: Aerosol
Sub-Topics: Transport, Emis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.