repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
sytays/openanalysis | doc/OpenAnalysis/05 - Data Structures.ipynb | gpl-3.0 | from openanalysis.data_structures import DataStructureBase, DataStructureVisualization
import gi.repository.Gtk as gtk # for displaying GUI dialogs
"""
Explanation: Data Structures
Data structures are a concrete implementation of the specification provided by one or more particular abstract data types (ADT), which s... |
irazhur/StatisticalMethods | examples/XrayImage/Summarizing.ipynb | gpl-2.0 | import astropy.io.fits as pyfits
import numpy as np
import astropy.visualization as viz
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 10.0)
targdir = 'a1835_xmm/'
imagefile = targdir+'P0098010101M2U009IMAGE_3000.FTZ'
expmapfile = targdir+'P0098010101M2U009EXPMAP3000.FTZ'
b... |
metpy/MetPy | dev/_downloads/591c50ddf519b58966833b985f7ca28b/Parse_Angles.ipynb | bsd-3-clause | import metpy.calc as mpcalc
"""
Explanation: Parse angles
Demonstrate how to convert direction strings to angles.
The code below shows how to parse directional text into angles.
It also demonstrates the function's flexibility
in handling various string formatting.
End of explanation
"""
dir_str = 'SOUTH SOUTH EAST'... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day14-Schelling-1-dimensional-segregation-day1/Day_14_Pre_Class_Notebook.ipynb | agpl-3.0 | even_numbers = [2, 4, 6, 8, 10, 12, 14]
s1 = even_numbers[1:5] # returns the 2nd through 4th elements
print("s1:", s1)
s2 = even_numbers[2:] # returns the 3rd element thorugh the end
print("s2:", s2)
s3 = even_numbers[:-2] # returns everything but the last two elements
print("s3:", s3)
s4 = even_numbers[1:-2] #... |
mari-linhares/tensorflow-workshop | code_samples/RNN/sentiment_analysis/.ipynb_checkpoints/SentimentAnalysis-Word2Vec-checkpoint.ipynb | apache-2.0 | # Tensorflow
import tensorflow as tf
print('Tested with TensorFlow 1.2.0')
print('Your TensorFlow version:', tf.__version__)
# Feeding function for enqueue data
from tensorflow.python.estimator.inputs.queues import feeding_functions as ff
# Rnn common functions
from tensorflow.contrib.learn.python.learn.estimators i... |
theandygross/HIV_Methylation | Parallel/Init_Parallel.ipynb | mit | k = ti((age < 68) & (age > 25))
dd = logit_adj(df_meth.ix[:, k])
m = dd.mean(1)
s = dd.std(1)
df_norm = dd.subtract(m, axis=0).divide(s, axis=0)
df_norm = df_norm.clip(-7,7)
"""
Explanation: Logit Transform and Normalize Methylation Data
End of explanation
"""
def chunkify_df(df, store, table_name, N=100):
df =... |
facebook/prophet | notebooks/multiplicative_seasonality.ipynb | mit | %%R -w 10 -h 6 -u in
df <- read.csv('../examples/example_air_passengers.csv')
m <- prophet(df)
future <- make_future_dataframe(m, 50, freq = 'm')
forecast <- predict(m, future)
plot(m, forecast)
df = pd.read_csv('../examples/example_air_passengers.csv')
m = Prophet()
m.fit(df)
future = m.make_future_dataframe(50, freq... |
marburg-open-courseware/gmoc | docs/mpg-if_error_continue/notebooks/working-with-text.ipynb | mit | text1 = "Ethics are built right into the ideals and objectives of the United Nations "
len(text1) # The length of text1
text2 = text1.split(' ') # Return a list of the words in text2, separating by ' '.
len(text2)
text2
"""
Explanation: You are currently looking at version 1.0 of this notebook. To download noteboo... |
arnoldlu/lisa | ipynb/tutorial/01_IPythonNotebooksUsage.ipynb | apache-2.0 | a = 1
b = 2
def my_simple_sum(a, b):
"""Simple addition
:param a: fist number
:param b: second number
"""
print "Sum is:", a+b
my_simple_sum(a,b)
# Further down in the code we do some changes
a = 100
# than we can go back and re-execute just the previous cell
"""
Explanation: Command mode vs Edi... |
GoogleCloudPlatform/analytics-componentized-patterns | retail/recommendation-system/bqml-mlops/part_3/vertex_ai_pipeline.ipynb | apache-2.0 | PATH=%env PATH
%env PATH={PATH}:/home/jupyter/.local/bin
# CHANGE the following settings
BASE_IMAGE='gcr.io/your-image-name' #This is the image built from the Dockfile in the same folder
REGION='vertex-ai-region' #For example, us-central1, note that Vertex AI endpoint deployment region must match MODEL_STORAGE bucket ... |
NathanYee/ThinkBayes2 | code/.ipynb_checkpoints/blaster-checkpoint.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from thinkbayes2 import Hist, Pmf, Cdf, Suite, Beta
import thinkplot
"""
Explanation: The Alien Blaster problem
This notebook presents solutions to exercises in Think Bayes.
Copyr... |
mne-tools/mne-tools.github.io | dev/_downloads/27d6cff3f645408158cdf4f3f05a21b6/30_eeg_erp.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import mne
root = mne.datasets.sample.data_path() / 'MEG' / 'sample'
raw_file = root / 'sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(raw_file, preload=False)
events_file = root / 'sample_audvis_filt-0-40_raw-eve.fif'
events = mne.rea... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/04_01/Final/Create.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
"""
Explanation: Creating Data Frames
documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html
DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it
like a spreadsheet or SQL table, o... |
vortex-exoplanet/VIP | docs/source/tutorials/06_fm_disk.ipynb | mit | %matplotlib inline
from hciplot import plot_frames, plot_cubes
from matplotlib.pyplot import *
from matplotlib import pyplot as plt
import numpy as np
from packaging import version
"""
Explanation: 6. ADI forward modeling of disks
Author: Julien Milli
Last update: 23/03/2022
Suitable for VIP v1.0.0 onwards.
Table of... |
wzxiong/DAVIS-Machine-Learning | homeworks/HW1-soln.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import LeaveOneOut
from sklearn import linear_model, neighbors
%matplotlib inline
plt.style.use('ggplot')
# dataset path
data_dir = "."
sample_data = pd.read_csv(data_dir+"/hw1.csv", delimiter=',')
sample_data.head()
... |
Bio204-class/bio204-notebooks | 2016-04-25-Parallels-Regression-and-ANOVA.ipynb | cc0-1.0 | n = 25
x = np.linspace(-5, 5, n) + stats.norm.rvs(loc=0, scale=1, size=n)
a, b = 1, 0.75
# I've chosen values to make yind and ydep have about the same variance
yind = a + stats.norm.rvs(loc=0, scale=np.sqrt(8), size=n)
ydep = a + b*x + stats.norm.rvs(loc=0, scale=1, size=n)
# create two different data frames for e... |
ML4DS/ML4all | U1.KMeans/KMeans_student.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from scipy.spatial.distance import cdist
from fig_code import plot_kmeans_interactive
from sklearn.datasets import make_blobs, load_digits, load_sample_image
from sklearn.decomposition import PCA
from sklearn.metrics import c... |
eblur/AstroHackWeek2015 | day3-machine-learning/07 - Grid Searches for Hyper Parameters.ipynb | gpl-2.0 | from sklearn.grid_search import GridSearchCV
from sklearn.svm import SVC
from sklearn.datasets import load_digits
from sklearn.cross_validation import train_test_split
digits = load_digits()
X_train, X_test, y_train, y_test = train_test_split(digits.data,
digits.targ... |
armandosrz/UdacityNanoMachine | student_intervention/student_intervention.ipynb | apache-2.0 | # Import libraries
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics import f1_score
# Read student data
student_data = pd.read_csv("student-data.csv")
print "Student data read successfully!"
"""
Explanation: Machine Learning Engineer Nanodegree
Supervised Learning
Project: Building a ... |
phoebe-project/phoebe2-docs | 2.1/tutorials/limb_darkening.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Limb Darkening
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 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
impor... |
newworldnewlife/TensorFlow-Tutorials | 18_TFRecords_Dataset_API.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.image import imread
import tensorflow as tf
import numpy as np
import sys
import os
"""
Explanation: TensorFlow Tutorial #18
TFRecords & Dataset API
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
In the previous tutorials we us... |
BartKeulen/drl | notebooks/2-Link arm.ipynb | mit | import numpy as np
from scipy.integrate import ode
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import animation
%matplotlib notebook
"""
Explanation: 2-Link Arm
Implementation of a 2-link arm.
$q = \left[\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2\right] \rightarrow \dot{q} = \left[q_3, ... |
mlhy/ResNet-50-for-Cats.Vs.Dogs | Oxford-Pet/Preprocessing train dataset ox.ipynb | apache-2.0 | from sklearn.model_selection import train_test_split
import seaborn as sns
import os
import shutil
import pandas as pd
%matplotlib inline
df = pd.read_csv('list.txt', sep=' ')
df.ix[2000:2005]
"""
Explanation: Preprocessing train dataset
Divide the train folder into two folders mytrain_ox and myvalid_ox
End of explan... |
jnarhan/Breast_Cancer | src/models/Youqing_SVM_Model2.ipynb | mit | import datetime
import gc
import numpy as np
import os
import random
from scipy import misc
import string
import time
import sys
import sklearn.metrics as skm
import collections
from sklearn.svm import SVC
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from sklearn import metrics
import dw... |
FavioVazquez/Interact.jl | doc/notebooks/01-Introduction.ipynb | mit | using Reactive, Interact
"""
Explanation: Introduction to Interact.jl
End of explanation
"""
s = slider(0:.1:1,label="Slider X:")
signal(s)
"""
Explanation: Interact.jl provides interactive widgets for IJulia. Interaction relies on Reactive.jl reactive programming package. Reactive provides the type Signal which r... |
SimonBiggs/electronfactors | historical_exploration_and_measurement/measurements/101 Measurements 2015-03-26.ipynb | agpl-3.0 | zOnR50 = np.concatenate((np.array([0.02]), np.arange(0.05,1.25,0.05)))
R50of45 = np.array([0.997,1,1.004,1.008,1.012,1.017,1.021,1.026,1.03,
1.035,1.04,1.045,1.051,1.056,1.062,1.067,1.073,1.08,
1.086,1.092,1.099,1.106,1.113,1.120,1.128])
R50of50 = np.array([0.991,0.994,0.998,1.002,1.0... |
JuBra/cobrapy | documentation_builder/deletions.ipynb | lgpl-2.1 | import pandas
from time import time
import cobra.test
from cobra.flux_analysis import \
single_gene_deletion, single_reaction_deletion, \
double_gene_deletion, double_reaction_deletion
cobra_model = cobra.test.create_test_model("textbook")
ecoli_model = cobra.test.create_test_model("ecoli")
"""
Explanation: ... |
desihub/desisim | doc/nb/transient-models.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
from desisim.transients import transients
"""
Explanation: Transient Models
Example of randomly grabbing transient models by type from the desisim.transients module.
Transient models can also be accessed by name, which is demonstrated b... |
peakrisk/peakrisk | posts/weather-station.ipynb | gpl-3.0 | # Tell matplotlib to plot in line
%matplotlib inline
# import pandas
import pandas
# seaborn magically adds a layer of goodness on top of Matplotlib
# mostly this is just changing matplotlib defaults, but it does also
# provide some higher level plotting methods.
import seaborn
# Tell seaborn to set things up
seabor... |
mitchshack/data_analysis_with_python_and_pandas | 4 - pandas Basics/4-3 pandas Series NaNs, Reindexing, filling, mutating and copies, basic mapping.ipynb | apache-2.0 | %matplotlib inline
import sys
print(sys.version)
import numpy as np
print(np.__version__)
import pandas as pd
print(pd.__version__)
import matplotlib.pyplot as plt
"""
Explanation: pandas Series Reindexing, filling, mutating, copying, and maps
End of explanation
"""
np_array = np.array([1,2,3,np.nan])
np_array
np_a... |
quanhua92/learning-notes | libs/pytorch/01_introduction/train neural networks with backpropagation.ipynb | apache-2.0 | # Define a transform to normalize the data
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
])
# Download and load the training data
trainset = datasets.MNIST("MNIST_data/", download=True, train... |
YihaoLu/pyfolio | pyfolio/examples/bayesian.ipynb | apache-2.0 | %matplotlib inline
import pyfolio as pf
"""
Explanation: Bayesian performance analysis example in pyfolio
There are also a few more advanced (and still experimental) analysis methods in pyfolio based on Bayesian statistics.
The main benefit of these methods is uncertainty quantification. All the values you saw above,... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/mpiesm-1-2-ham/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'mpiesm-1-2-ham', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: MPIESM-1-2-HAM
Sub-Topics: Radi... |
nohmapp/acme-for-now | essential_algorithms/Sorting and Searching.ipynb | mit | def sort(array):
if len(array) <= 1:
return array
else:
pivot = len(array) // 2
arr1 = sort(array[:pivot])
arr2 = sort(array[pivot:])
return merge(arr1, arr2)
def merge(left, right):
l_index, r_index = 0, 0
result = []
while l_index < len(left) and r_inde... |
ngautam0/keras-pro-bar | examples/keras_progress_bars.ipynb | mit | from mnist_model import mnist_model
from keras_tqdm import TQDMCallback, TQDMNotebookCallback
"""
Explanation: Keras Progress Bars
The following examples show two different keras_tqdm progress bars.
* TQDM notebook widget
* TQDM console output
To use keras_tqdm progress bars in your own code, just add TQDMCallback or ... |
ShibataLabPrivate/GPyWorkshop | Experiments/Notebook1.ipynb | mit | # import python modules
import GPy
import numpy as np
from matplotlib import pyplot as plt
# call matplotlib with the inline command to make plots appear within the browser
%matplotlib inline
"""
Explanation: Lab session 1: Gaussian Process models with GPy
Source: Gaussian Process Summer School 2015
The aim of this l... |
SylvainCorlay/bqplot | examples/Interactions/Interaction Layer.ipynb | apache-2.0 | ## First we define a Figure
dt_x_fast = DateScale()
lin_y = LinearScale()
x_ax = Axis(label='Index', scale=dt_x_fast)
x_ay = Axis(label=(symbol + ' Price'), scale=lin_y, orientation='vertical')
lc = Lines(x=dates_actual, y=prices, scales={'x': dt_x_fast, 'y': lin_y}, colors=['orange'])
lc_2 = Lines(x=dates_actual[50:]... |
artem-oppermann/Udacity-Data-Analyst-Nanodegree-Projects | Project 2- Data Analysis with Python/titanic_project.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from collections import Counter
titanic=pd.read_csv("titanic-data.csv")
titanic.head()
"""
Explanation: Titanic Data Analysis
1. Introduction
In this project I will perform a data analysis on the sample Titanic dataset. The dataset contains
demogr... |
IIPBC/Material | machine_learning_Nina/Exercise1-3.ipynb | mit |
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
# Criar um array com n números.
# Cada um desses números é um exemplo x
# Em seguida, estender os exemplos: x ---> (1,x)
N = 14
x = np.array([0.2, 0.5, 1, 1.1, 1.2, 1.8, 2, 4.3, 4.4, 5.7, 6.9, 7.5, 8, 8.2])
X = np.vstack(zip(np.ones(N), x))
print... |
dacb/elvizCluster | ipython_notebooks/depreciated/160330 Investigate samples with lots of Order Burkholderiales.ipynb | bsd-3-clause | import matplotlib as mpl
% matplotlib inline
import pandas as pd
import seaborn as sns
from IPython.display import IFrame
import elviz_utils
"""
Explanation: The goal of this notebook is to investigate/justify why some samples "look" weird when summing across contigs.
End of explanation
"""
reduced = pd.read_csv(... |
mne-tools/mne-tools.github.io | 0.20/_downloads/063df3a44a4ac9d23978d7b307e69a4e/plot_read_evoked.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
from mne import read_evokeds
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
# Reading
condition = 'Left Auditory'
evoked = read_evokeds(fname... |
mastertrojan/Udacity | intro-to-rnns/.ipynb_checkpoints/Anna KaRNNa-checkpoint.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
osunderdog/PythonLearning | pandas_timeseries.ipynb | gpl-2.0 | from datetime import datetime, date, time
import sys
sys.version
import pandas as pd
from pandas import Series, DataFrame, Panel
pd.__version__
import numpy as np
np.__version__
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rc('figure', figsize=(10, 8))
mpl.__version__
"""
Explanation: Timeseries wi... |
peastman/deepchem | examples/tutorials/Creating_Models_with_TensorFlow_and_PyTorch.ipynb | mit | !pip install --pre deepchem
"""
Explanation: Creating Models with TensorFlow and PyTorch
In the tutorials so far, we have used standard models provided by DeepChem. This is fine for many applications, but sooner or later you will want to create an entirely new model with an architecture you define yourself. DeepChem... |
llooker/public-datasets-pipelines | samples/tutorial.ipynb | apache-2.0 | %%capture
# Installing the required libraries:
!pip install matplotlib pandas scikit-learn tensorflow pyarrow tqdm
!pip install google-cloud-bigquery google-cloud-bigquery-storage
!pip install flake8 pycodestyle pycodestyle_magic
# Python Builtin Libraries
from datetime import datetime
# Third Party Libraries
from g... |
paulmorio/grusData | basics/SupportVectorMachines.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: Support Vector Machines
Support vector machines (SVMs) are a particularly powerful and flexible class of supervised algorithms for both classi... |
walterst/qiime | examples/ipynb/Fungal-ITS-analysis.ipynb | gpl-2.0 | !(wget ftp://ftp.microbio.me/qiime/tutorial_files/its-soils-tutorial.tgz || curl -O ftp://ftp.microbio.me/qiime/tutorial_files/its-soils-tutorial.tgz)
!(wget ftp://ftp.microbio.me/qiime/tutorial_files/its_12_11_otus.tgz || curl -O ftp://ftp.microbio.me/qiime/tutorial_files/its_12_11_otus.tgz)
"""
Explanation: Fungal ... |
AaronCWong/phys202-2015-work | assignments/midterm/InteractEx06.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import Image
from IPython.html.widgets import interact, interactive, fixed
"""
Explanation: Interact Exercise 6
Imports
Put the standard imports for Matplotlib, Numpy and the IPython widgets in the following cell.
End of explan... |
mne-tools/mne-tools.github.io | dev/_downloads/00ac060e49528fd74fda09b97366af98/3d_to_2d.ipynb | bsd-3-clause | # Authors: Christopher Holdgraf <choldgraf@berkeley.edu>
# Alex Rockhill <aprockhill@mailbox.org>
#
# License: BSD-3-Clause
from mne.io.fiff.raw import read_raw_fif
import numpy as np
from matplotlib import pyplot as plt
from os import path as op
import mne
from mne.viz import ClickableImage # noqa: ... |
GuillaumeDec/machine-learning | Deep Neural Network Application Image Classification/Deep+Neural+Network+-+Application+v3.ipynb | gpl-3.0 | import time
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
from dnn_app_utils_v2 import *
%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams[... |
nslatysheva/data_science_blogging | polished_prediction/scanning_hyperspace.ipynb | gpl-3.0 | import wget
import pandas as pd
# Import the dataset
data_url = 'https://raw.githubusercontent.com/nslatysheva/data_science_blogging/master/datasets/wine/winequality-red.csv'
dataset = wget.download(data_url)
dataset = pd.read_csv(dataset, sep=";")
"""
Explanation: Scanning hyperspace: how to tune machine learning mo... |
tensorflow/probability | tensorflow_probability/python/experimental/nn/examples/vib_dose.ipynb | apache-2.0 | #@title ##### Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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 writin... |
ShubhamDebnath/Coursera-Machine-Learning | Course 4/Residual Networks v2.ipynb | mit | import numpy as np
from keras import layers
from keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D, AveragePooling2D, MaxPooling2D, GlobalMaxPooling2D
from keras.models import Model, load_model
from keras.preprocessing import image
from keras.utils import layer_utils
... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_automl_text_classification_batch.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: AutoML training text classification model for batch prediction
<table align="left">... |
rdempsey/web-scraping-data-mining-course | week7/2_data_exploration/3. Generate Summary Statistics.ipynb | mit | # Import the libraries we need
import pandas as pd
# Import the dataset from the CSV file
accidents_data_file = '/Users/robert.dempsey/Dropbox/Private/Art of Skill Hacking/' \
'Books/Python Business Intelligence Cookbook/Data/Stats19-Data1979-2004/Accidents7904.csv'
accidents = pd.read_csv(accide... |
jasontlam/snorkel | tutorials/cdr/CDR_Tutorial_2.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
from snorkel import SnorkelSession
session = SnorkelSession()
from snorkel.models import candidate_subclass
ChemicalDisease = candidate_subclass('ChemicalDisease', ['chemical', 'disease'])
train_cands = session.query(ChemicalDisease).filter(ChemicalDisease.spli... |
pascal-schetelat/Slope | slopeGraphs.ipynb | mit | from plotSlope import slope
"""
Explanation: E. Tufte Slope Graphs contest
So here is my entry for the slope Graph contest. (You can find the initial bounty description here )
Installation
Dependancies
This script is written in Python and relies on Numpy, Pandas and Matplotlib.
The easiest way to have a clean and robu... |
bigdata-i523/hid335 | project/BDA-Project-Data-Visualization.ipynb | gpl-3.0 | import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv('~/project-data.csv')
df.drop(df.columns[[0,1]], axis=1, inplace=True)
df.shape
"""
Explanation: Big Data Applications and Analytics: Term Project
Sean M. Shiverick Fall 2017
Data Vis... |
fastai/course-v3 | nbs/dl1/lesson2-download.ipynb | apache-2.0 | from fastai.vision import *
"""
Explanation: Creating your own dataset from Google Images
by: Francisco Ingham and Jeremy Howard. Inspired by Adrian Rosebrock
In this tutorial we will see how to easily create an image dataset through Google Images. Note: You will have to repeat these steps for any new category you wan... |
python-control/python-control | examples/pvtol-lqr-nested.ipynb | bsd-3-clause | from numpy import * # Grab all of the NumPy functions
from matplotlib.pyplot import * # Grab MATLAB plotting functions
from control.matlab import * # MATLAB-like functions
%matplotlib inline
"""
Explanation: Vertical takeoff and landing aircraft
This notebook demonstrates the use of the python-control p... |
piyueh/PoissonTest | PetAmgXTest/Report.ipynb | gpl-2.0 | omg=numpy.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1])
tPCG = numpy.array([5.72, 4.54, 3.78, 3.14, 2.71, 2.38, 2.06, 1.95, 2.49, 10.15])
tPCGF = numpy.array([2.48, 2.14, 2.03, 2.6, 10.7])
tPBICGSTAB = numpy.array([2.79, 2.58, 2.48, 3, 12.1])
pyplot.plot(omg, tPCG, label="PCG")
pyplot.plot(omg[5:], tPCGF, la... |
robertoalotufo/ia898 | src/sobel.ipynb | mit | import numpy as np
def sobel(f):
from pconv import pconv
Sx = np.array([[1.,2.,1.],
[0.,0.,0.],
[-1.,-2.,-1.]])
Sy = np.array([[1.,0.,-1.],
[2.,0.,-2.],
[1.,0.,-1.]])
fx = pconv(f, Sx)
fy = pconv(f, Sy)
m... |
cliburn/sta-663-2017 | homework/06_Making_Python_Faster_2_Solutions.ipynb | mit | import requests
from bs4 import BeautifulSoup
def listFD(url, ext=''):
page = requests.get(url).text
soup = BeautifulSoup(page, 'html.parser')
return [url + node.get('href') for node in soup.find_all('a')
if node.get('href').endswith(ext)]
site = 'http://people.duke.edu/~ccc14/misc/'
ext = 'p... |
mne-tools/mne-tools.github.io | 0.19/_downloads/cfc20c17238f93690fc049d714cab718/plot_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... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/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', 'nasa-giss', 'sandbox-2', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-2
Topic: Ocnbgchem
Sub-Topics: Tracers.
P... |
ffmmjj/intro_to_data_science_workshop | 03-Delimitação de grupos de flores.ipynb | apache-2.0 | import pandas as pd
iris = # Carregue o arquivo 'datasets/iris_without_classes.csv'
# Exiba as primeiras cinco linhas usando o método head() para checar que não existe mais a coluna "Class"
"""
Explanation: Suponha que não soubéssemos quantas espécies diferentes estão presentes no dataset iris. Como poderíamos des... |
rdhyee/dlab-finance | basic-taq/Generator examples.ipynb | isc | from glob import glob
import raw_taq
import pandas as pd
import numpy as np
from statistics import mode
def print_stats(chunk):
#find the max bid price
max_price = max(chunk['Bid_Price'])
#find the min bid price
min_price = min(chunk['Bid_Price'])
#find the mean of bid price
avg_price = np.m... |
cesans/mapache | features.ipynb | bsd-3-clause | ciudadanos = mapache.Party('Ciudadanos',
logo_url = 'https://www.ciudadanos-cs.org/var/public/sections/page-imagen-del-partido/logo-ciudadanos.jpg',
short_name = 'C\'s',
full_name = 'Ciudadanos - Partido de la Ciudadanía')
ciudadanos.show()
"""
Explanation: Man... |
PyLCARS/PythonUberHDL | myHDL_DigitalSignalandSystems/ComplexMultiplier.ipynb | bsd-3-clause | from myhdl import *
from myhdlpeek import Peeker
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from sympy import *
init_printing()
import random
"""
Explanation: \title{myHDL Two Word Complex Multiplier}
\author{Steven K Armour}
\maketitle
This notebook/Program is a walkth... |
gabrielusvicente/data-science-playground | develop/gs-ISL_advertising.ipynb | mit | #define numerical examples
true = [100, 50, 30, 20]
pred = [90, 50, 50, 30]
"""
Explanation: Model evaluation metrics for regression
Evalution matrics for classification problems, such as accuracy, are not useful for regression.
Let's create some example numeric predictions, and calculate three common evalution metric... |
statsmodels/statsmodels | examples/notebooks/tsa_arma_1.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from statsmodels.graphics.tsaplots import plot_predict
from statsmodels.tsa.arima_process import arma_generate_sample
from statsmodels.tsa.arima.model import ARIMA
np.random.seed(12345)
"""
Explanation: Autoregressive Moving Average (ARMA): Artificial data
E... |
shareactorIO/pipeline | gpu.ml/notebooks/08_Optimize_Model_CPU.ipynb | apache-2.0 | %%bash
which summarize_graph
%%bash
## TODO: /root/models/linear/cpu/metagraph
## ls -l /root/models/optimize_me/
ls -l /root/models/linear/cpu/unoptimized
%%bash
freeze_graph
from tensorflow.python.tools import freeze_graph
checkpoint_prefix = os.path.join(self.get_temp_dir(), "saved_checkpoint")
checkpoint_s... |
duncanwp/python_for_climate_scientists | course_content/notebooks/exception_handling.ipynb | gpl-3.0 | n = int(input("Enter an integer: "))
print("Hello " * n)
"""
Explanation: Exception handling
You will have noticed that when something goes wrong in a Python program you see an error message. This is called an exception, and you can handle them explicitly to prevent your program from aborting and printing an unhelpful... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Functions and Methods Homework.ipynb | apache-2.0 | def vol(rad):
pass
"""
Explanation: Functions and Methods Homework
Complete the following questions:
Write a function that computes the volume of a sphere given its radius.
End of explanation
"""
def ran_check(num,low,high):
pass
"""
Explanation: Write a function that checks whether a number is in a given ... |
thempel/adaptivemd | examples/rp/3_example_adaptive.ipynb | lgpl-2.1 | import sys, os
# stop RP from printing logs until severe
# verbose = os.environ.get('RADICAL_PILOT_VERBOSE', 'REPORT')
os.environ['RADICAL_PILOT_VERBOSE'] = 'ERROR'
from adaptivemd import (
Project,
Event, FunctionalEvent,
File
)
# We need this to be part of the imports. You can only restore known object... |
Brunel-Visualization/Brunel | python/examples/Brunel Cars.ipynb | apache-2.0 | import pandas as pd
import brunel
cars = pd.read_csv("data/cars.csv")
cars.head(6)
"""
Explanation: Demo of Brunel on Cars Data
The Data
We read the data into a pandas data frame. In this case we are grabbing some data that represents cars.
We read it in and call the brunel use method to ensure the names are usable
... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/Expressions.ipynb | gpl-3.0 | import vcsn
import pandas as pd
pd.options.display.max_colwidth = 0
"""
Explanation: Expressions
Rational expressions, or expressions for short, denote (rational) languages in a compact way. Since Vcsn supports weighted expressions, they actually can denoted rational series.
This page documents the syntax and transfo... |
elmaso/tno-ai | aind2-dl-master/Student_Admissions.ipynb | gpl-3.0 | import pandas as pd
data = pd.read_csv('student_data.csv')
data
"""
Explanation: Predicting Student Admissions
In this notebook, we predict student admissions to graduate school at UCLA based on three pieces of data:
- GRE Scores (Test)
- GPA Scores (Grades)
- Class rank (1-4)
The dataset originally came from here: ht... |
lucasb-eyer/go-colorful | doc/LinearRGB Approximations.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import numpy as np
from sympy import *
init_printing()
"""
Explanation: Taylor approximations to color conversion
This notebook shows how to come up with all these magic... |
mrcinv/matpy | oma/kolokviji/OMA, 2. kolokvij, 2011_2012.ipynb | gpl-2.0 | f = lambda x: x**4 + 2*x**3 - 2*x**2 + 1
x = sympy.Symbol('x', real=True)
"""
Explanation: 2. kolokvij 2011/2012, rešitve
1. naloga
Poišči največjo in najmanjšo vrednost, ki jo zavzame funkcija
$$f(x) = x^4 + 2x^3 - 2x^2 + 1.$$
End of explanation
"""
eq = Eq(f(x).diff(), 0)
eq
critical_points = sympy.solve(eq)
cri... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/text_classification/labs/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 ... |
google-research/vision_transformer | lit.ipynb | apache-2.0 | # Installs the vit_jax package from Github.
!pip install -q git+https://github.com/google-research/vision_transformer
import jax
import jax.numpy as jnp
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow_datasets as tfds
import tqdm
from vit_jax impor... |
google-research/google-research | pairwise_fairness/monotone.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Tensorflow modules.
import tensorflow as tf
# Install Tensorflow Lattice and Tensorflow Constrained Optimization libraries.
!pip install tensorflow_lattice
!pip install git+https://github.com/google-research/tensorflow_constrained_optimization
... |
quantumlib/Cirq | docs/tutorials/variational_algorithm.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... |
tensorflow/docs-l10n | site/ko/hub/tutorials/text_to_video_retrieval_with_s3d_milnce.ipynb | apache-2.0 | !pip install -q opencv-python
import os
import tensorflow.compat.v2 as tf
import tensorflow_hub as hub
import numpy as np
import cv2
from IPython import display
import math
"""
Explanation: Text-to-Video retrieval with S3D MIL-NCE
<table class="tfo-notebook-buttons" align="left">
<td><a target="_blank" href="http... |
crowd-course/datascience | 4-regression/4.3 - Regularization and Model Evaluation.ipynb | mit | import pandas as pd
import numpy as np
from sklearn.linear_model import SGDRegressor
from sklearn.preprocessing import StandardScaler
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (10, 10)
"""
Explanation: Optimizing the Models
Welcome to the practical section of module 4.3. Here... |
buruzaemon/svd | 01_SVD_visualizing_data.ipynb | bsd-3-clause | iris = sklearn.datasets.load_iris()
df_iris = pd.DataFrame(iris.data, columns=iris.feature_names)
print('Iris dataset has {} rows and {} columns\n'.format(*df_iris.shape))
print('Here are the first 5 rows of the data:\n\n{}\n'.format(df_iris.head(5)))
print('Some simple statistics on the Iris dataset:\n\n{}\n'.form... |
feroda/lessons-python4beginners | .ipynb_checkpoints/P4B - Capitolo 1-Copy1-checkpoint.ipynb | agpl-3.0 | # This is hello_who.py
def hello(who):
print("Hello {}!".format(who))
if __name__ == "__main__":
hello("mamma")
"""
Explanation: Python2 for beginners (P4B)
<p style="text-align: center;">Luca Ferroni <luca@befair.it></p>
<p style="text-align: center;">http://www.befair.it<br />**Software Libero per i terr... |
google/starthinker | colabs/drive_copy.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: Drive Copy
Copy a drive document.
License
Copyright 2020 Google LLC,
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://... |
ISosnovik/UVA_AML17 | week_2/2.Experiments.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import Image
from IPython.core.display import HTML
"""
Explanation: Assignment 1
Experiments
Seems like you've already implemented all the building blocks of the neural networks. Now we will conduct several experiments.
Note: T... |
NathanYee/ThinkBayes2 | code/chap03mine.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import thinkplot
from thinkbayes2 import Hist, Pmf, Suite, Cdf
"""
Explanation: Think Bayes: Chapter 3
This notebook presents example code and exercise solutions for Think Bayes.
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/lic... |
WNoxchi/Kaukasos | FAI_old/lesson2/lesson2_LM_SGD_Optz_codealong.ipynb | mit | %matplotlib inline
import numpy as np
from numpy.random import random
# from matplotlib import pyplot as plt, animation
from matplotlib import pyplot as plt, rcParams, animation, rc
rc('animation', html='html5')
rcParams['figure.figsize'] = 3, 3 # sets plot window size
%precision 4
np.set_printoptions(precision=4, line... |
steinam/teacher | jup_notebooks/datenbanken/Versicherung_11FI3_On_Paper.ipynb | mit | %load_ext sql
%sql mysql://steinam:steinam@localhost/versicherung_complete
"""
Explanation: Versicherung on Paper
End of explanation
"""
%%sql
-- meine Lösung
select distinct(Land) from Fahrzeughersteller;
%%sql
-- deine Lösung
select fahrzeughersteller.Land
from fahrzeughersteller
group by fahrzeughersteller.... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/cmip6/models/sandbox-3/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-3', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-3
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turb... |
pycircle/presentations | wprowadzenie_2.ipynb | apache-2.0 | help([1, 2, 3])
dir([1, 2, 3])
sum??
"""
Explanation: <img src='http://pycircle.org/static/pycircle_big.png' style="margin-left:auto; margin-right:auto; height:70%; width:70%">
Wprowadzenie część 2
End of explanation
"""
all([1==1, True, 10, -1, False, 3*5==1]), all([1==5, True, 10, -1])
any([False, True]), any([... |
mne-tools/mne-tools.github.io | 0.14/_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... |
napjon/ds-nd | p3-wrangling/project.osm/01-documentation.ipynb | mit | pipeline = [{'$match': {'address.street':{'$exists':1}}},
{'$project': {'_id': '$address.street'}},
{'$limit' : 5}]
result = db.jktosm.aggregate(pipeline)['result']
pprint.pprint(result)
"""
Explanation: OpenStreetMap is an open project, which means it's free and everyone can use it and edit a... |
dgergel/VIC | samples/notebooks/example_plotting_vic_outputs.ipynb | gpl-2.0 | %matplotlib inline
import pandas as pd
import xarray as xr
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
# input files for example:
asci_fname = '/Users/jhamman/workdir/VIC_tests_20160531/examples/Example-Classic-Stehekin-fewb/results/fluxes_48.1875_-120.6875.txt'
nc_f... |
ml-ensemble/ml-ensemble.github.io | info/_downloads/layer.ipynb | mit | from mlens.parallel import Layer, Group, make_group, run
from mlens.utils.dummy import OLS, Scale
from mlens.index import FoldIndex
indexer = FoldIndex(folds=2)
group = make_group(indexer, [OLS(1), OLS(2)], None)
"""
Explanation: .. currentmodule:: mlens.parallel
Layer Mechanics
ML-Ensemble is designed to provide an... |
caganze/wisps | notebooks/.ipynb_checkpoints/lsstdsf_pca-checkpoint.ipynb | mit | features=list(hst3d.columns)
features.remove('name')
"""
Explanation: Create a training set, a test set and a set to predict for
End of explanation
"""
import seaborn as sns
#plt.xscale('log')
sns.pairplot(spex[features], hue=None)
good_features=['H_2O-1/J-Cont', 'CH_4/H-Cont', 'H_2O-2/J-Cont']
from sklearn.decomp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.