repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
aamirg/athena-hacks-honeywell | modeling.ipynb | apache-2.0 | data = pd.read_csv("./formatted_data.csv",header=0, index_col=False)
data.head()
"""
Explanation: Supervised Learning
Supervised learning is the machine learning task of inferring a function from labeled training data. The training data consist of a set of training examples. Each example is a pair consisting of an inp... |
adit-chandra/tensorflow | tensorflow/lite/experimental/examples/lstm/TensorFlowLite_LSTM_Keras_Tutorial.ipynb | apache-2.0 | !pip install tf-nightly
"""
Explanation: Overview
This codelab will demonstrate how to build a LSTM model for MNIST recognition using keras & how to convert the model to TensorFlow Lite.
End of explanation
"""
# This is important!
import os
os.environ['TF_ENABLE_CONTROL_FLOW_V2'] = '1'
import tensorflow as tf
impor... |
csaladenes/csaladenes.github.io | present/bi2/2020/ubb/az_en_jupyter2_mappam/sklearn_tutorial/04.3-Density-GMM.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
plt.style.use('seaborn')
"""
Explanation: <small><i>This notebook was put together by Jake Vanderplas. Source and license info is on GitHub.</i></small>
Density Estimation: Gaussian Mixture Models
Here we'll explore Gaussian... |
Danghor/Formal-Languages | Python/Regexp-2-NFA.ipynb | gpl-2.0 | class RegExp2NFA:
def __init__(self, Sigma):
self.Sigma = Sigma
self.StateCount = 0
"""
Explanation: From Regular Expressions to <span style="font-variant:small-caps;">Fsm</span>s
This notebook shows how a given regular expression $r$ can be transformed into an equivalent finite state machine.... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <trachelr@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import Vectorizer, get_coef... |
flsantos/startup_acquisition_forecast | .ipynb_checkpoints/1_dataset_creation-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
"""
Explanation: Loading Companies...
End of explanation
"""
companies = pd.read_csv('data/companies.csv')
#Having a look to the companies data structure
companies[:3]
#Let's first remove non USA companies, since they usually have a lot of missing data
companies_USA = compani... |
StingraySoftware/notebooks | DataQuickLook/Quicklook NuSTAR data with Stingray.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from stingray.powerspectrum import AveragedPowerspectrum, DynamicalPowerspectrum
from stingray.crossspectrum import AveragedCrossspectrum
from stingray.events import EventList
from stingray.lightcurve import Lightc... |
zhuanxuhit/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... |
rmichnovicz/Sick-Slopes | Slopes.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
deg = np.arange(0.0, 90.01, 0.01)
def deg2dist(deg): return 10.29 * np.cos(np.pi / 180 * deg)
dist = deg2dist(deg)
# Note that using plt.subplots below is equivalent to using
# fig = plt.figure and then ax = fig.add_subplot(111)
fig, ax = plt.sub... |
npdoty/bigbang | examples/Single Word Trend.ipynb | agpl-3.0 | %matplotlib inline
from bigbang.archive import Archive
import bigbang.parse as parse
import bigbang.graph as graph
import bigbang.mailman as mailman
import bigbang.process as process
import networkx as nx
import matplotlib.pyplot as plt
import pandas as pd
from pprint import pprint as pp
import pytz
import numpy as np... |
ML4DS/ML4all | R2.kNN_Regression/regression_knn_professor.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
# To visualize plots in the notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pylab
# Packages used to read datasets
import scipy.io # To read matlab files
import pan... |
eneskemalergin/Data_Structures_and_Algorithms | Chapter2/2-Arrays.ipynb | gpl-3.0 | from array_class import Array1D
import random
# Array valueList created with size of 100
valueList = Array1D(100)
# Filling the array with random floating-point values
for i in range(len(valueList)):
valueList[i] = random.random()
# Print the values, one per line
for value in valueList:
print(value)
"""... |
google/starthinker | colabs/bucket.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: Storage Bucket
Create and permission a bucket in Storage.
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... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-AND-gate-out-12d.ipynb | mit | ph_sel_name = "None"
data_id = "12d"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:36:27 2017
Duration: 8 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from fretbursts import *
ini... |
JamesSample/enviro_mod_notes | notebooks/07_GLUE.ipynb | mit | # Choose true params
a_true = 3
b_true = 6
sigma_true = 2
n = 100 # Length of data series
# For the independent variable, x, we will choose n values equally spaced
# between 0 and 10
x = np.linspace(0, 10, n)
# Calculate the dependent (observed) values, y
y = a_true*x + b_true + np.random.normal(loc=0, scale=sigma_... |
cmshobe/landlab | notebooks/tutorials/lithology/lithology_and_litholayers.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
import os
import numpy as np
import xarray as xr
import dask
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
%matplotlib inline
import holoviews as hv
hv.notebook_extension('matplotlib')
from landlab import RasterModelGrid
from landlab.compon... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/dev/n07_market_simulator.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10... |
jsignell/MpalaTower | inspection/.ipynb_checkpoints/meta_data-checkpoint.ipynb | mit | from __future__ import print_function
import pandas as pd
import datetime as dt
import numpy as np
import os
import xray
from posixpath import join
from flask.ext.mongoengine import MongoEngine
db = MongoEngine()
ROOTDIR = 'C:/Users/Julia/Documents/GitHub/MpalaTower/raw_netcdf_output/'
data = 'Table1'
datas = ['upp... |
4DGenome/Chromosomal-Conformation-Course | Notebooks/A4-Align_and_compare_TADs.ipynb | gpl-3.0 | from pytadbit import load_chromosome
"""
Explanation: Table of Contents
Comparing TAD borders between experiments
Alignment of TAD borders
Significance
Playing with borders
Get a given column
Search for aligned TADs with specific features
Strongly conserved broders
Borders specific to one experiment
Comparing ... |
morningc/wwconnect-2016-spark4everyone | python/Apache Spark for Everyone | PySpark + Python + Jupyter.ipynb | mit | # set your working directory if you want less pathy things later
WORK_DIR = '/Users/amcasari/repos/wwconnect-2016-spark4everyone/'
# create an RDD from bikes data
# sc is an existing SparkContext (initialized when PySpark starts)
bikes = sc.textFile(WORK_DIR + "data/bikes/p*")
bikes.count()
# import SQLContext
from... |
liufuyang/deep_learning_tutorial | course-deeplearning.ai/course4-cnn/week2-ResNets/ResNets/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
... |
liganega/Gongsu-DataSci | previous/notes2017/old/NB-06-Loops.ipynb | gpl-3.0 | animals = ['cat', 'dog', 'mouse']
for x in animals:
print("This is the {}.".format(x))
"""
Explanation: 루프(Loop)
시퀀스 자료형을 for 문 또는 while 문과 조합하여 사용하면 간단하지만 강력한 루프 프로그래밍을 완성할 수 있다. 특히 range 또는 xrange 함수를 유용하게 활용할 수 있다.
for 문 루프
리스트 활용
End of explanation
"""
for x in animals:
print("{}!, this is the {}.".form... |
sadahanu/Capstone | NLP/nlp eda.ipynb | mit | # source1: web
df_breed = pd.read_csv("breed_nick_names.txt",names=['breed_info'])
df_breed.head()
df_breed.shape
breeds_info = df_breed['breed_info'].values
breed_dict = {}
for breed in breeds_info:
temp = breed.lower()
temp = re.findall('\d.\s+(\D*)', temp)[0]
temp = temp.strip().split('=')
breed_d... |
mdiaz236/DeepLearningFoundations | transfer-learning/Transfer_Learning.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... |
Kaggle/learntools | notebooks/data_viz_to_coder/raw/ex2.ipynb | apache-2.0 | import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
print("Setup Complete")
"""
Explanation: In this exercise, you will use your new knowledge to propose a solution to a real-world scenario. To succeed, you will need to import data i... |
hidenori-t/snippet | reading_plan.ipynb | mit | # 読書計画用スニペット
from datetime import date
import math
def reading_plan(title, total_number_of_pages, period):
current_page = int(input("Current page?: "))
deadline = (date(*period) - date.today()).days
remaining_pages = total_number_of_pages - current_page
print(title, period, "まで", math.ceil(re... |
johntellsall/shotglass | jupyter/timeline.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
try:
# Try to fetch a list of Matplotlib releases and their dates
# from https://api.github.com/repos/matplotlib/matplotlib/releases
import urllib.request
import json
url = 'https://a... |
ManchesterBioinference/BranchedGP | notebooks/Hematopoiesis.ipynb | apache-2.0 | import time
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import BranchedGP
plt.style.use("ggplot")
%matplotlib inline
"""
Explanation: Branching GP Regression on hematopoietic data
Alexis Boukouvalas, 2017
Note: this notebook is automatically generated by Jupytext, see the README for ... |
ueapy/ueapy.github.io | content/notebooks/2017-03-17-numpy-finite-diff.ipynb | mit | # import time module to get execution time
import time
# plotting
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Going through Mark's Ocean World climate model code, one of the improvements that we discussed this Friday was moving from nested for-loops to array-wide operations. Sometimes this is c... |
weikang9009/pysal | notebooks/explore/spaghetti/Network_Usage.ipynb | bsd-3-clause | import os
last_modified = None
if os.name == "posix":
last_modified = !stat -f\
"# This notebook was last updated: %Sm"\
Network_Usage.ipynb
elif os.name == "nt":
last_modified = !for %a in (Network_Usage.ipynb)\
do echo # This notebook was last updat... |
tschinz/iPython_Workspace | 02_WP/VHDL/Steppermotordriver_L6208PD.ipynb | gpl-2.0 | # Function to calculate the Bits needed fo a given number
def unsigned_num_bits(num):
_nbits = 1
_n = num
while(_n > 1):
_nbits = _nbits + 1
_n = _n / 2
return _nbits
"""
Explanation: VHDL implementation of Steppermotordriver for L6208PD
End of explanation
"""
rev_distance = 0.5 # mm
step_angle ... |
lithiumdenis/MLSchool | 3. Котики и собачки.ipynb | mit | visual = pd.read_csv('data/CatsAndDogs/TRAIN2.csv')
#Сделаем числовой столбец Outcome, показывающий, взяли животное из приюта или нет
#Сначала заполним единицами, типа во всех случах хорошо
visual['Outcome'] = 'true'
#Неудачные случаи занулим
visual.loc[visual.OutcomeType == 'Euthanasia', 'Outcome'] = 'false'
visual.l... |
bayesimpact/bob-emploi | data_analysis/notebooks/datasets/imt/market_score_api_dataset.ipynb | gpl-3.0 | import os
from os import path
import pandas as pd
import seaborn as _
DATA_FOLDER = os.getenv('DATA_FOLDER')
market_statistics = pd.read_csv(path.join(DATA_FOLDER, 'imt/market_score.csv'))
market_statistics.head()
"""
Explanation: Author: Marie Laure, marielaure@bayesimpact.org
IMT Market Score from API
The IMT dat... |
StingraySoftware/notebooks | Simulator/Concepts/PowerLaw Spectrum.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Simulating Light Curves from Power Law Power Spectra
In this notebook, we will show how to simulate a light curve from a power spectrum that
follows a power law shape.
End of explanation
"""
def simulate(B):
N = 10... |
quantumlib/OpenFermion-Cirq | examples/tutorial_4_variational.ipynb | apache-2.0 | import openfermion
import openfermioncirq
# Set parameters of jellium model.
wigner_seitz_radius = 5. # Radius per electron in Bohr radii.
n_dimensions = 2 # Number of spatial dimensions.
grid_length = 2 # Number of grid points in each dimension.
spinless = True # Whether to include spin degree of freedom or not.
n_el... |
prk327/CoAca | 3_Plotting_Categorical_Data.ipynb | gpl-3.0 | # loading libraries and reading the data
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# set seaborn theme if you prefer
sns.set(style="white")
# read data
market_df = pd.read_csv("./global_sales_data/market_fact.csv")
customer_df = pd.read_csv("./global_sales_data/cust_... |
blakeflei/IntroScientificPythonWithJupyter | 06b - Fitting Plots.ipynb | bsd-3-clause | # Python imports
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import normal
from scipy.optimize import curve_fit
"""
Explanation: Fitting Plots
Essential for determining the fit of a model to raw data, curve fitting is ubiquitous. Using the scipy.optimize.curve_fit functionality, we can define ... |
SheffieldML/notebook | GPy-phil/GPy Intro.ipynb | bsd-3-clause | import GPy, numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: GPy
GPy is a framework for Gaussian process based applications. It is design for speed and reliability. The main three pillars of its functionality are made of
Ease of use
Reproduceability
Scalability
In this tutorial w... |
mayank-johri/LearnSeleniumUsingPython | Section 1 - Core Python/Chapter 05 - Data Types/Numbers.ipynb | gpl-3.0 | # Converting real to integer
print ('int(3.14) =', int(3.14))
print ('int(3.64) =', int(3.64))
print('int("22") =', int("22"))
print('int("22.0") !=', int("22.0"))
print("int(3+4j) =", int(3+4j))
# Converting integer to real
print ('float(5) =', float(5))
print('int("22.0") ==', float("22.0"))
print('int(float("22... |
yedivanseven/bestPy | examples/03_Logging.ipynb | gpl-3.0 | import sys
sys.path.append('../..')
"""
Explanation: CHAPTER 3
Logging
As you are exploring and, later, using bestPy you might want to keep track (in a discrete way) of what happens under the hood. For that purpose, a convenient logging faciĺity is built into bestPy that keeps you up to date.
Preliminaries
We only nee... |
GoogleCloudPlatform/mlops-on-gcp | workshops/guided-projects/guided_project_3.ipynb | apache-2.0 | import os
"""
Explanation: Guided Project 3
Learning Objective:
Learn how to customize the tfx template to your own dataset
Learn how to modify the Keras model scaffold provided by tfx template
In this guided project, we will use the tfx template tool to create a TFX pipeline for the covertype project, but this time... |
geography-munich/sciprog | material/sub/jrjohansson/Lecture-1-Introduction-to-Python-Programming.ipynb | apache-2.0 | ls scripts/hello-world*.py
cat scripts/hello-world.py
!python scripts/hello-world.py
"""
Explanation: Introduction to Python programming
J.R. Johansson (jrjohansson at gmail.com)
The latest version of this IPython notebook lecture is available at http://github.com/jrjohansson/scientific-python-lectures.
The other no... |
LucaCanali/Miscellaneous | PLSQL_Neural_Network/MNIST_oracle_plsql.ipynb | apache-2.0 | %%bash
sqlplus -s mnist/mnist@dbserver:1521/orcl.cern.ch <<EOF
-- create the table for test data, where the images of digits are stored as arrays of type utl_nla_array
create table testdata_array as
select a.image_id, a.label,
cast(multiset(select val from testdata where image_id=a.image_id order by val_id) as utl_n... |
thsant/scipy-intro | 05._Matplotlib.ipynb | cc0-1.0 | %pylab inline
"""
Explanation: Matplotlib
End of explanation
"""
X = linspace(-pi, pi, 256)
C = cos(X)
S = sin(X)
"""
Explanation: Matplotlib é um módulo para a criação de gráficos 2D e 3D criada por John Hunter (2007). Sua sintaxe é propositalmente similar às funções de plotagem da MATLAB, facilitando o aprendizad... |
rashikaranpuria/Machine-Learning-Specialization | Classification/Week 3/Assignment 1/module-5-decision-tree-assignment-1-blank.ipynb | mit | import graphlab
graphlab.canvas.set_target('ipynb')
"""
Explanation: Identifying safe loans with decision trees
The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr... |
vadim-ivlev/STUDY | handson-data-science-python/DataScience-Python3/.ipynb_checkpoints/DecisionTree-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
from sklearn import tree
input_file = "e:/sundog-consult/udemy/datascience/PastHires.csv"
df = pd.read_csv(input_file, header = 0)
df.head()
"""
Explanation: Decison Trees
First we'll load some fake data on past hires I made up. Note how we use pandas to convert a csv file into... |
econandrew/povcalnetjson | notebooks/integral-constrained-cubic-spline.ipynb | mit | # The y values are simply the mean-scaled derivatives of the Lorenz curve
dL = np.diff(L)
dp = np.diff(p)
y = ymean * dL/dp
#y = np.hstack((0.0, y))
# And we arbitrarily assign these y values to the mid-points of the p values
pmid = np.add(p[1:],p[:-1])/2
#pmid = np.hstack((0.0, pmid))
plt.plot(y, pmid, 'b.')
# Find... |
dianafprieto/SS_2017 | .ipynb_checkpoints/06_NB_VTKPython_Scalar-checkpoint.ipynb | mit | %gui qt
import vtk
from vtkviewer import SimpleVtkViewer
#help(vtk.vtkRectilinearGridReader())
"""
Explanation: <img src="imgs/header.png">
Visualization techniques for scalar fields in VTK + Python
Recap: The VTK pipeline
<img src="imgs/vtk_pipeline.png", align=left>
$~$
VTK look-up tables and transfer functions
End ... |
zomansud/coursera | ml-regression/week-1/week-1-simple-regression-assignment-blank.ipynb | mit | import graphlab
"""
Explanation: Regression Week 1: Simple Linear Regression
In this notebook we will use data on house sales in King County to predict house prices using simple (one input) linear regression. You will:
* Use graphlab SArray and SFrame functions to compute important summary statistics
* Write a functio... |
rdhyee/diversity-census-calc | zzz-Census_Geo.ipynb | apache-2.0 | !ls /Users/raymondyee/Downloads/tl_2010_06001_bg00/tl_2010_06001_bg00.shp
!rm /Users/raymondyee/Downloads/tl_2010_06001_bg00/tl_2010_06001_bg00.geojson
!/Library/Frameworks/Python.framework/Versions/Current/bin/ogr2ogr -f GeoJSON /Users/raymondyee/Downloads/tl_2010_06001_bg00/tl_2010_06001_bg00.geojson /Users/raymondy... |
LiaoPan/blaze | docs/source/_static/notebooks/xray-dask.ipynb | bsd-3-clause | import xray
import dask.array as da
import numpy as np
import dask
"""
Explanation: xray + dask
This was modified from a notebook originally written by Stephan Hoyer
Weather data -- especially the results of numerical weather simulations -- is big. Some of the biggest super computers make weather forecasts, and they ... |
d00d/quantNotebooks | .ipynb_checkpoints/06142017-PRA-Python-Ciriculum-Notebook-1-checkpoint.ipynb | unlicense | import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText
#import matplotlib.animation as animation
%matplotlib inline
weight =[258.1,257.1,256.6,257.7,257.6,254.3,252.5,252.6,251.7]
#plot(weight, 'm', label='line1', linewidth=4)
plt.title('Q2 2017 - Progress on Weight Loss Program')
plt.grid(Tr... |
dusenberrymw/incubator-systemml | samples/jupyter-notebooks/ALS_python_demo.ipynb | apache-2.0 | from pyspark.sql import SparkSession
from pyspark.sql.types import *
from systemml import MLContext, dml
spark = SparkSession\
.builder\
.appName("als-example")\
.getOrCreate()
schema = StructType([StructField("movieId", IntegerType(), True),
StructField("userId", IntegerT... |
tensorflow/privacy | tensorflow_privacy/privacy/privacy_tests/secret_sharer/secret_sharer_image_example.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... |
mne-tools/mne-tools.github.io | stable/_downloads/9f8cb3957705df93f5da4fe6dc1bc69b/fnirs_artifact_removal.ipynb | bsd-3-clause | # Authors: Robert Luke <mail@robertluke.net>
#
# License: BSD-3-Clause
import os
import mne
from mne.preprocessing.nirs import (optical_density,
temporal_derivative_distribution_repair)
"""
Explanation: Visualise NIRS artifact correction methods
Here we artificially introduce seve... |
phoebe-project/phoebe2-docs | 2.2/examples/legacy_contact_binary.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2. In order to run this backend, you'll need to have PHOEBE 1.0 installed and manually install the python wrappers in the phoebe... |
SciTools/courses | course_content/iris_course/4.Joining_Cubes_Together.ipynb | gpl-3.0 | import iris
import numpy as np
"""
Explanation: Iris introduction course
4. Joining Cubes Together
Learning outcome: by the end of this section, you will be able to apply Iris functionality to combine multiple Iris cubes into a new larger cube.
Duration: 30 minutes
Overview:<br>
4.1 Merge<br>
4.2 Concatenate<br>
4.3 E... |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/tpu/tools/colab/Classification_Iris_data_with_TPUEstimator.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow 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 appl... |
arizona-phonological-imaging-lab/autotres | examples/network-training-tutorial.ipynb | apache-2.0 | import logging
from imp import reload
reload(logging)
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s', level=logging.INFO, datefmt='%I:%M:%S')
#logging.debug('This is a debug message')
#logging.basicConfig(level=logging.INFO)
"""
Explanation: Training a network
Logging
For most purposes, we are goin... |
jrieke/machine-intelligence-2 | sheet08/sheet08.ipynb | mit | from __future__ import division, print_function
import matplotlib.pyplot as plt
%matplotlib inline
import scipy.stats
import numpy as np
"""
Explanation: Machine Intelligence II - Team MensaNord
Sheet 08
Nikolai Zaki
Alexander Moore
Johannes Rieke
Georg Hoelger
Oliver Atanaszov
End of explanation
"""
def E(W, s):
... |
datapythonista/pandas | doc/source/user_guide/style.ipynb | bsd-3-clause | import matplotlib.pyplot
# We have this here to trigger matplotlib's font cache stuff.
# This cell is hidden from the output
import pandas as pd
import numpy as np
import matplotlib as mpl
df = pd.DataFrame([[38.0, 2.0, 18.0, 22.0, 21, np.nan],[19, 439, 6, 452, 226,232]],
index=pd.Index(['Tumour (P... |
astarostin/MachineLearningSpecializationCoursera | course6/week5/ParseTraining.ipynb | apache-2.0 | import requests
from bs4 import BeautifulSoup
"""
Explanation: Парсинг веб-страниц
End of explanation
"""
req = requests.get('https://en.wikipedia.org/wiki/Bias-variance_tradeoff')
print req
"""
Explanation: 3a. Парсинг заголовков верхнего уровня со страницы https://en.wikipedia.org/wiki/Bias-variance_tradeoff
Выпо... |
google-research/google-research | socraticmodels/SocraticModels_MSR_VTT.ipynb | apache-2.0 | openai_api_key = "your-api-key"
"""
Explanation: Copyright 2021 Google LLC.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENS... |
olgabot/kvector | overview.ipynb | bsd-3-clause | import kvector
"""
Explanation: Overview of kvector features
End of explanation
"""
motifs = kvector.read_motifs('kvector/tests/data/example_rbps.motif', residues='ACGT')
motifs.head()
"""
Explanation: Read HOMER Motifs
Read HOMER motif file and create a pandas dataframe for each position weight matrix (PWM), with ... |
rasbt/algorithms_in_ipython_notebooks | ipython_nbs/data-structures/bloom-filter.ipynb | gpl-3.0 | import hashlib
h1 = hashlib.md5()
h1.update('hello-world'.encode('utf-8'))
int(h1.hexdigest(), 16)
"""
Explanation: Bloom Filters
Bloom filters in a nutshell
A bloom filter is a probablistic data structures for memory-efficient look-ups to test if a element or value is a member of a set. In a nutshell, you can think ... |
dsacademybr/PythonFundamentos | Cap10/Notebooks/DSA-Python-Cap10-Intro-TensorFlow.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 10</font>
Download: http://github.com/dsacademybr
End of explanation
"""
from I... |
weikang9009/pysal | notebooks/viz/splot/esda_morans_viz.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
from pysal.lib.weights.contiguity import Queen
from pysal.lib import examples
import numpy as np
import pandas as pd
import geopandas as gpd
import os
from pysal.viz import splot
"""
Explanation: Exploratory Analysis of Spatial Data: Visualizing Spatial Autocorrelati... |
dmc-2016/dmc | notebooks/week-4/01-tensorflow ANN for regression.ipynb | apache-2.0 | %matplotlib inline
import math
import random
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_boston
import numpy as np
import tensorflow as tf
sns.set(style="ticks", color_codes=True)
"""
Explanation: Lab 4 - Tensorflow ANN for regression
In this lab we wi... |
keras-team/keras-io | examples/nlp/ipynb/bidirectional_lstm_imdb.ipynb | apache-2.0 | import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
max_features = 20000 # Only consider the top 20k words
maxlen = 200 # Only consider the first 200 words of each movie review
"""
Explanation: Bidirectional LSTM on IMDB
Author: fchollet<br>
Date created: 2020/05/03<br>
Last modifie... |
bliebeskind/Gene-Ages | Notebooks/nodeStats_plotting.ipynb | mit | import pandas as pd
from matplotlib import pyplot as plt
import matplotlib.lines as mlines
from LECA.plotting import histLinePlot
%matplotlib inline
nodestats = pd.read_csv("nodeStats_HUMAN.csv",index_col=0,na_values=[None])
nodestats.head()
"""
Explanation: Distributions of node-based statistics
This notebook was u... |
newsapps/public-notebooks | Shootings and homicides within the Austin community area.ipynb | mit | import requests
from shapely.geometry import shape, Point
r = requests.get('https://data.cityofchicago.org/api/geospatial/cauq-8yn6?method=export&format=GeoJSON')
for feature in r.json()['features']:
if feature['properties']['community'] == 'AUSTIN':
austin = feature
poly = shape(austin['geometry'])
"""... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/prod/n04_day28_model_choosing_close_feat_all_syms_equal.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10... |
zzsza/Datascience_School | 17. 로지스틱 회귀 분석/01. 로지스틱 회귀 분석.ipynb | mit | xx = np.linspace(-10, 10, 1000)
plt.plot(xx, (1/(1+np.exp(-xx)))*2-1, label="logistic (scaled)")
plt.plot(xx, sp.special.erf(0.5*np.sqrt(np.pi)*xx), label="erf (scaled)")
plt.plot(xx, np.tanh(xx), label="tanh")
plt.ylim([-1.1, 1.1])
plt.legend(loc=2)
plt.show()
"""
Explanation: 로지스틱 회귀 분석
로지스틱 회귀(Logistic Regression) ... |
neuromusic/neuronexus-probe-data | denormalizing.ipynb | bsd-3-clause | for col in probe_spec.columns:
if col.endswith('ID'):
print col
"""
Explanation: Let's see what the column names that end in 'ID' are. Those are probably primary keys and foreign keys.
End of explanation
"""
probe_spec.set_index('DesignID',inplace=True)
probe_spec.head()
design_type = pd.read_csv('NiPOD... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/4b_keras_dnn_babyweight.ipynb | apache-2.0 | import datetime
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
"""
Explanation: LAB 4b: Create Keras DNN model.
Learning Objectives
Set CSV Columns, label column, and column defaults
Make dataset of features and label from CSV files
Create input layers for raw f... |
vascotenner/holoviews | doc/Tutorials/Composing_Data.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
hv.notebook_extension()
np.random.seed(10)
def sine_curve(phase, freq, amp, power, samples=102):
xvals = [0.1* i for i in range(samples)]
return [(x, amp*np.sin(phase+freq*x)**power) for x in xvals]
phases = [0, np.pi/2, np.pi, 3*np.pi/2]
powers = [1,2,3]
a... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/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', 'nerc', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
AllenDowney/ModSimPy | soln/salmon_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 functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
MRod5/pyturb | notebooks/Gas Mixtures.ipynb | mit | from pyturb.gas_models import GasMixture
gas_mix = GasMixture(gas_model='Perfect')
gas_mix.add_gas('O2', mass=0.5)
gas_mix.add_gas('H2', mass=0.5)
"""
Explanation: Gas Mixtures: Perfect and Semiperfect Models
This Notebook is an example about how to declare and use Gas Mixtures with pyTurb. Gas Mixtures in pyTurb are ... |
mjlong/openmc | docs/source/pythonapi/examples/mgxs-part-i.ipynb | mit | from IPython.display import Image
Image(filename='images/mgxs.png', width=350)
"""
Explanation: This IPython Notebook introduces the use of the openmc.mgxs module to calculate multi-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the following features:
General equ... |
tensorflow/docs-l10n | site/ko/quantum/tutorials/gradients.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... |
Walter1218/self_driving_car_ND | CarND-LaneLines-P1/P1.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
"""
Explanation: Self-Driving Car Engineer Nanodegree
Project: Finding Lane Lines on the Road
In this project, you will use the tools you learned about in the lesson to ide... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/text_models/solutions/word2vec.ipynb | apache-2.0 | import io
import itertools
import os
import re
import string
import numpy as np
import tensorflow as tf
import tqdm
from tensorflow.keras import Model, Sequential
from tensorflow.keras.layers import (
Activation,
Dense,
Dot,
Embedding,
Flatten,
GlobalAveragePooling1D,
Reshape,
)
from tensor... |
ck-quantuniversity/cntk_pyspark | .ipynb_checkpoints/CNTK_model_scoring_on_Spark_walkthrough-checkpoint.ipynb | mit | from cntk import load_model
import findspark
findspark.init('/root/spark-2.1.0-bin-hadoop2.6')
import os
import numpy as np
import pandas as pd
import pickle
import sys
from pyspark import SparkFiles
from pyspark import SparkContext
from pyspark.sql.session import SparkSession
sc =SparkContext()
spark = SparkSession(sc... |
khrapovs/metrix | notebooks/asymptotic_and_bootstrap_ci.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
import datetime as dt
from numpy.linalg import inv, lstsq
from scipy.stats import norm
# Local file ols.py
from ols import ols
# For inline pictures
%matplotlib inline
sns.set_context('paper')
# For nicer output of Pandas data... |
Pybonacci/notebooks | Joyas en la biblioteca estandar de Python (I).ipynb | bsd-2-clause | from collections import ChainMap
dict_a = {'a': 1, 'b': 10}
dict_b = {'b': 100, 'c': 1000}
cm = ChainMap(dict_a, dict_b)
for key, value in cm.items():
print(key, value)
"""
Explanation: Dentro de la biblioteca estándar de Python dispones de auténticas joyas, muchas veces ignoradas u olvidadas. Es por ello que vo... |
smharper/openmc | examples/jupyter/nuclear-data.ipynb | mit | %matplotlib inline
import os
from pprint import pprint
import shutil
import subprocess
import urllib.request
import h5py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm
from matplotlib.patches import Rectangle
import openmc.data
"""
Explanation: In this notebook, we will go through the salien... |
brettavedisian/phys202-2015-work | assignments/assignment12/FittingModelsEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 1
Imports
End of explanation
"""
a_true = 0.5
b_true = 2.0
c_true = -4.0
"""
Explanation: Fitting a quadratic curve
For this problem we are going to work with the following mod... |
esa-as/2016-ml-contest | geoLEARN/Submission_3_RF_FE.ipynb | apache-2.0 | ###### Importing all used packages
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
from... |
dipanjank/ml | simple_implementations/Flavours_of_Gradient_Descent.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
def L(x):
return x**2 - 2*x + 1
def L_prime(x):
return 2*x - 2
def converged(x_prev, x, epsilon):
"Return True if the abs value of all elements in x-x_prev are <= epsilon."
absdiff = np.abs(x-x_prev)
return np.all(absdiff <= epsilon)
def gradient_des... |
fonnesbeck/scientific-python-workshop | notebooks/Model Selection and Validation.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
import warnings
warnings.simplefilter("ignore")
salmon = pd.read_table("../data/salmon.dat", sep=r'\s+', index_col=0)
salmon.plot(x='spawners', y='recruits', kind='scatter')
"""
... |
ColeLab/informationtransfermapping | MasterScripts/ManuscriptS1a_NetworkInformationEstimate_Supplementary.ipynb | gpl-3.0 | import sys
sys.path.append('utils/')
import numpy as np
import loadGlasser as lg
import scripts3_functions as func
import scipy.stats as stats
from IPython.display import display, HTML
import matplotlib.pyplot as plt
import statsmodels.sandbox.stats.multicomp as mc
import sys
import multiprocessing as mp
import pandas
... |
ueapy/ueapy.github.io | content/notebooks/2019-02-28-functions-will.ipynb | mit | def print_a_phrase(): # we start the definition of a function with "def"
print("Academics of the world unite! You have nothing to lose but your over-priced proprietary software licenses.")
#return 0;
print_a_phrase()
"""
Explanation: Basic principles and features
Functions are exactly that: they usually take ... |
swara-salih/Portfolio | 2001 SAT Scores Analysis/Analysis of 2001 Iowa SAT Scores.ipynb | mit | import scipy as sci
import pandas as pd
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Remember that for specific functions, the array function in numpy
# can be useful in listing out the elements in a list (example would
# be for finding the mode.)
with open('./dat... |
scikit-optimize/scikit-optimize.github.io | 0.8/notebooks/auto_examples/store-and-load-results.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
import os
import sys
"""
Explanation: Store and load skopt optimization results
Mikhail Pak, October 2016.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Problem statement
We often want to store optimization results in a file. This can be useful,
for example,
if you w... |
mcs07/MolVS | examples/standardization.ipynb | mit | from rdkit.Chem.Draw import IPythonConsole
import logging
logger = logging.getLogger('molvs')
logger.setLevel(logging.INFO)
"""
Explanation: Standardization
Here are some examples of how to standardize molecules.
First set our iPython notebook to display molecule images and log messages:
End of explanation
"""
from ... |
eford/rebound | ipython_examples/Checkpoints.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1e-6, a=1.)
sim.add(a=2.)
sim.integrator = "whfast"
sim.save("checkpoint.bin")
sim.status()
"""
Explanation: Checkpoints
You can easily save and load a REBOUND simulation to a binary file. The binary file includes all information about the particles (ma... |
aborgher/Main-useful-functions-for-ML | NLP/NLP.ipynb | gpl-3.0 | import enchant
# The underlying programming model provided by the Enchant library is based on the notion of Providers.
# A provider is a piece of code that provides spell-checking services which Enchant can use to perform its work.
# Different providers exist for performing spellchecking using different frameworks -... |
DistrictDataLabs/ceb-training | 03 - Regression Analysis.ipynb | mit | %matplotlib notebook
import os
import sklearn
import requests
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Fixtures
GENDATA = os.path.join("data", "generated")
DATASET = "dataset{}.txt"
TARGET = "target{}.txt"
COEFS = "coefs{}.txt"
def load_gendata(suffix=""):
X = np.loadtxt(... |
wmvanvliet/neuroscience_tutorials | posthoc/linear_regression.ipynb | bsd-2-clause | import mne
epochs = mne.read_epochs('subject04-epo.fif')
epochs.metadata
"""
Explanation: <a href="https://mybinder.org/v2/gh/wmvanvliet/neuroscience_tutorials/master?filepath=posthoc%2Flinear_regression.ipynb" target="_new" style="float: right"><img src="qr.png" alt="https://mybinder.org/v2/gh/wmvanvliet/neuroscienc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.