repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
googlegenomics/datalab-examples | datalab/genomics/Getting started with the Genomics API.ipynb | apache-2.0 | !pip install --upgrade google-api-python-client
"""
Explanation: <!-- Copyright 2015 Google Inc. 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 -->
... |
robertoalotufo/ia898 | deliver/Aula_10_Wavelets.ipynb | mit | import numpy as np
import sys,os
import matplotlib.image as mpimg
ia898path = os.path.abspath('../../')
if ia898path not in sys.path:
sys.path.append(ia898path)
import ia898.src as ia
"""
Explanation: Aula 10 Discrete Wavelets Transform
Exercícios
isccsym
Não é fácil projetar um conjunto de testes para garantir q... |
Chipe1/aima-python | obsolete_search4e.ipynb | mit | romania = {
'A': ['Z', 'T', 'S'],
'B': ['F', 'P', 'G', 'U'],
'C': ['D', 'R', 'P'],
'D': ['M', 'C'],
'E': ['H'],
'F': ['S', 'B'],
'G': ['B'],
'H': ['U', 'E'],
'I': ['N', 'V'],
'L': ['T', 'M'],
'M': ['L', 'D'],
'N': ['I'],
'O': ['Z', 'S'],
'P': ['R', 'C', 'B'],
'R': ['S', 'C', 'P'],
'S': ['A', 'O', 'F', '... |
tuanavu/coursera-university-of-washington | machine_learning/1_machine_learning_foundations/assignment/week6/.ipynb_checkpoints/Deep Features for Image Retrieval-checkpoint.ipynb | mit | import graphlab
"""
Explanation: Building an image retrieval system with deep features
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
"""
Explanation: Load the CIFAR-10 dataset
We will use a popular benchmark dataset in computer vision called CIFAR-10.
(We've red... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.time_frequency import sing... |
ddandur/Twords | jupyter_example_notebooks/Bitcoin Data.ipynb | mit | import sys
sys.path.append('..')
from twords.twords import Twords
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
# this pandas line makes the dataframe display all text in a line; useful for seeing entire tweets
pd.set_option('display.max_colwidth', -1)
twit = Twords()
twit.data_path = "../da... |
whitead/numerical_stats | project/type3_examples/basketball.ipynb | gpl-3.0 | import pandas as pd
import numexpr
import bottleneck
import numpy as np
import numpy.linalg as linalg
import matplotlib.pyplot as plt
%matplotlib inline
import scipy.stats as ss
reg_14_15 = pd.read_csv('2014_2015 Regular Season Stats.csv')
#Testing out our system
reg_14_15
"""
Explanation: Markov Madness
Ok let's ge... |
kdestasio/online_brain_intensive | nipype_tutorial/notebooks/basic_mapnodes.ipynb | gpl-2.0 | from nipype import Function
def square_func(x):
return x ** 2
square = Function(["x"], ["f_x"], square_func)
"""
Explanation: <img src="../static/images/mapnode.png" width="300">
MapNode
If you want to iterate over a list of inputs, but need to feed all iterated outputs afterwards as one input (an array) to the n... |
waynegm/OpendTect-Plugins | python_bindings/Examples/wmodpy_demo.ipynb | gpl-3.0 | import sys
sys.path.insert(0,'/opt/seismic/OpendTect_6/6.6.0/bin/lux64/Release')
"""
Explanation: OpendTect Python Bindings
Release 6.6.7 of the wmPlugins suite includes experimental Python bindings to OpendTect. There are a number of limitations to be aware of:
- Currently the bindings only provide access to informa... |
modin-project/modin | examples/tutorial/jupyter/execution/pandas_on_ray/local/exercise_2.ipynb | apache-2.0 | import modin.pandas as pd
import pandas
import time
from IPython.display import Markdown, display
def printmd(string):
display(Markdown(string))
"""
Explanation: <center><h2>Scale your pandas workflows by changing one line of code</h2>
Exercise 2: Speed improvements
GOAL: Learn about common functionality that Mod... |
freedomtan/tensorflow | tensorflow/lite/micro/examples/hello_world/train/train_hello_world_model.ipynb | apache-2.0 | # Define paths to model files
import os
MODELS_DIR = 'models/'
if not os.path.exists(MODELS_DIR):
os.mkdir(MODELS_DIR)
MODEL_TF = MODELS_DIR + 'model'
MODEL_NO_QUANT_TFLITE = MODELS_DIR + 'model_no_quant.tflite'
MODEL_TFLITE = MODELS_DIR + 'model.tflite'
MODEL_TFLITE_MICRO = MODELS_DIR + 'model.cc'
"""
Explanation... |
IS-ENES-Data/scripts | Scripts/test1.ipynb | apache-2.0 | result = web.jsonfile_to_dict("/home/stephan/Repos/ENES-EUDAT/cordex/CORDEX_adjust_register.json")
html_out = web.generate_bias_table(result)
HTML(html_out)
"""
Explanation: HTML Bias CV view
showing ["institution", "institute_id", "bc_method", "bc_method_id",
"institute_id"-"bc_method_id", "terms_of_use", ... |
dedx/STAR2015 | notebooks/CountingStars.ipynb | mit | %pylab inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Counting Stars
Based on the Multimedia Programming lesson at Software Carpentry.
End of explanation
"""
from PIL import Image
import requests
from StringIO import StringIO
#Pick an image from the list above and fetch it with requests.... |
idekerlab/cyrest-examples | notebooks/Realistic workflow/The workflow of Anne/The Python workflow of Anne.ipynb | mit | from py2cytoscape.data.cynetwork import CyNetwork
from py2cytoscape.data.cyrest_client import CyRestClient
from py2cytoscape.data.style import StyleUtil
import py2cytoscape.util.cytoscapejs as cyjs
import py2cytoscape.cytoscapejs as renderer
import networkx as nx
import pandas as pd
import json
# !!!!!!!!!!!!!!!!! St... |
stonebig/winpython_afterdoc | docs/maths/kalman_filters.ipynb | mit | # mlab.bivariate_normal is going to be remove from matplotlib
# from matplotlib.mlab import bivariate_normal
import numpy as np
def _bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0,
mux=0.0, muy=0.0, sigmaxy=0.0):
"""
This is the implementation from matplotlib:
https://github.com/matplotl... |
jobovy/stream-stream | py/Orbits-for-Nbody.ipynb | bsd-3-clause | lp= LogarithmicHaloPotential(normalize=1.,q=0.9)
R0, V0= 8., 220.
"""
Explanation: Initial conditions for $N$-body simulations to create the impact we want
Setup the potential and coordinate system
End of explanation
"""
def rectangular_to_cylindrical(xv):
R,phi,Z= bovy_coords.rect_to_cyl(xv[:,0],xv[:,1],xv[:,2]... |
eric-haibin-lin/mxnet | example/adversary/adversary_generation.ipynb | apache-2.0 | %matplotlib inline
import mxnet as mx
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mxnet import gluon
"""
Explanation: Fast Sign Adversary Generation Example
This notebook demos finds adversary examples using MXNet Gluon and taking advantage of the gradient information
[1] Goodf... |
solomonvimal/UCLA-Hydro | LakeArea_Altimetry/Altimetry_MODIS_SurfaceArea_lake_345.ipynb | gpl-3.0 | % matplotlib inline
import pandas as pd
import glob
import matplotlib.pyplot as plt
GRLM = "345_GRLM10.txt"; print GRLM
df_grlm = pd.read_csv(GRLM, skiprows=43, delim_whitespace=True, names="mission,cycle,date,hour,minute,lake_height,error,mean(decibels),IonoCorrection,TropCorrection".split(","), engine='python', inde... |
sevo/pewe-presentations | PCA nie je vyber atributov.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
plt.rcParams['figure.figsize'] = 9, 6
"""
Explanation: Priklad vyber autributov pomocou filtra a ukazka toho, preco PCA nie je vyber atributov
End of explanation
"""
from sklearn import datasets, svm
from sklear... |
ceteri/pytextrank | explain_summ.ipynb | apache-2.0 | import warnings
warnings.filterwarnings("ignore")
import spacy
nlp = spacy.load("en_core_web_sm")
"""
Explanation: Explain PyTextRank: extractive summarization
How does PyTextRank perform extractive summarization on a text document?
First we perform some basic housekeeping for Jupyter, then load spaCy with a languag... |
arcyfelix/Courses | 18-11-22-Deep-Learning-with-PyTorch/02-Introduction to PyTorch/Part 6 - Saving and Loading Models.ipynb | apache-2.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms
import helper
import fc_model
# Define a transform to normalize the data
transform ... |
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies | ex30-Identify_North_Atlantic_winter_weather_regimes by KMeans.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
import cartopy.crs as ccrs
from sklearn.cluster import KMeans
"""
Explanation: Identify North Atlantic Winter Weather Regimes by K-means Clustering
The four weather regimes typically found over the North Atlantic in winter are i... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/tutorials/pipeline/pipeline_tutorial_lesson_8.ipynb | unlicense | from quantopian.pipeline.data import morningstar
# Since the underlying data of morningstar.share_class_reference.exchange_id
# is of type string, .latest returns a Classifier
exchange = morningstar.share_class_reference.exchange_id.latest
"""
Explanation: Classifiers
A classifier is a function from an asset and a mo... |
turi-code/tutorials | strata-sj-2016/intro-ml/sentiment_analysis.ipynb | apache-2.0 | !head -n 2 ../data/yelp/yelp_training_set_review.json
reviews = gl.SFrame.read_csv('../data/yelp/yelp_training_set_review.json', header = False)
reviews
reviews[0]
"""
Explanation: 1. Task: Predicting sentiment from product reviews
The goal of this task is to know if a particular review has a positive, or negative r... |
tayden/titanic-death-decider | titanic-death-decider.ipynb | mit | import numpy as np
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Read the input datasets
train_data = pd.read_csv('../input/train.csv')
test_data = pd.read_csv('../input/test.csv')
# Fill missing numeric values with median for that column
train_data['Age'].fillna(train_data['Age'].mean(), i... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session08/Day1/IntroToSQLiteSolutions.ipynb | mit | import matplotlib.pyplot as plt
%matplotlib notebook
"""
Explanation: Introduction to SQLite &
Selecting Sources from the Sloan Digital Sky Survey
Version 0.1
By AA Miller 2019 Mar 25
As noted earlier, there will be full lectures on databases over the remainder of this week.
This notebook provides a quick introductio... |
lseongjoo/learn-python | function.ipynb | mit | def greetings(hour, lang='kr', extra_msg=None):
# 시간값 확인
if hour < 0 or hour > 24:
return
# 언어에 따라 메시지 설정
msgs = {'kr': [u'좋은', u'아침', u'오후', u'저녁', u'밤'],
'en': [u'Good', u'morning', u'afternoon', u'evening',
u'night']}
# 별도로 설정된 메시지가 있으면, 해당 메시지 반영
... |
LorenzoBi/courses | UQ/assignment_3/.ipynb_checkpoints/Assignment 3-checkpoint.ipynb | mit | import numpy as np
from scipy.special import binom
import matplotlib.pylab as plt
from scipy.misc import factorial as fact
%matplotlib inline
def binomial(p, n, k):
return binom(n, k) * p ** k * (1 - p) ** (n-k)
"""
Explanation: Assignment 3
Lorenzo Biasi and Michael Aichmüller
End of explanation
"""
p = 4. / ... |
ponderousmad/pyndent | depth_classy.ipynb | mit | %matplotlib inline
from __future__ import print_function
import gc
import ipywidgets
import math
import os
import random
import sys
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from IPython.display import Image
from scipy import ndimage
from scipy.misc import imsave
from six.moves import... |
google/eng-edu | ml/cc/prework/es-419/tensorflow_programming_concepts.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
seg/2016-ml-contest | Pet_Stromatolite/Facies_Classification_Draft2.ipynb | apache-2.0 | ### loading
%matplotlib inline
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
### setting up options in pandas
from pandas import set_option
set_option("display.max_rows", 10)
pd... |
CartoDB/cartoframes | docs/examples/data_observatory/do_data_enrichment.ipynb | bsd-3-clause | import geopandas as gpd
import matplotlib.pyplot as plt
import seaborn as sns
from cartoframes.auth import set_default_credentials
from cartoframes.data.observatory import *
from cartoframes.data.services import Isolines
from cartoframes.viz import *
sns.set_style('whitegrid')
%matplotlib inline
"""
Explanation: Adv... |
google/alligator2 | alligator2.ipynb | apache-2.0 | # Printing to screen
print("I'm a code block")
# Defining variables
a = 2
b = 5
c = a + b
print(f"a equals {a}")
print(f"b equals {b}")
print(f"a plus b equals {c}")
# Proper indentation is essential in Python
for x in range(1,6):
print(x)
"""
Explanation: Make a copy of this notebook!
Intro to Colab
60 second cra... |
gwsb-istm-6212-fall-2016/syllabus-and-schedule | lectures/week-03/20160913-lecture-notes.ipynb | cc0-1.0 | !mkdir mydirectory
!ls > mydirectory/myfiles.txt
!rm myfiles.txt
!rm mydirectory/myfiles.txt
!ls mydirectory
"""
Explanation: Week 3 lecture notes
Exercise 2 review - common mistakes
Including directories in paths
If you create a file in a lower directory, then want to modify, move, or delete it, you have to use t... |
arongdari/sparse-graph-prior | notebooks/CompareSparseMixtureGraph.ipynb | mit | mdest = '../result/random_network/mixture/'
sdest = '../result/random_network/sparse/'
m_f = '%d_%.2f_%.2f_%.2f_%.2f_%.2f_%.2f.pkl'
s_f = '%d_%.2f_%.2f_%.2f.pkl'
colors = cm.rainbow(np.linspace(0, 1, 7))
np.random.shuffle(colors)
colors = itertools.cycle(colors)
def degree_dist_list(graph, ddist):
_ddict = nx.de... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/feature_engineering/solutions/5_tftransform_taxifare.ipynb | apache-2.0 | # Run the chown command to change the ownership
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Install the necessary dependencies
!pip install tensorflow==2.3.0 tensorflow-transform==0.24.0 apache-beam[gcp]==2.24.0
"""
Explanation: Exploring tf.transform #
Learning Objectives
1. Preprocess data ... |
marcelomiky/PythonCodes | scikit-learn/scikit-learn-book/Chapter 4 - Advanced Features - Model Selection.ipynb | mit | %pylab inline
import IPython
import sklearn as sk
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
print 'IPython version:', IPython.__version__
print 'numpy version:', np.__version__
print 'scikit-learn version:', sk.__version__
print 'matplotlib version:', matplotlib.__version__
"""
Explanation... |
rishuatgithub/MLPy | nlp/4. Naive Machine Translation + LSH.ipynb | apache-2.0 | en_set = set(en_vec.vocab)
fr_set = set(fr_vec.vocab)
en_embeddings_subset = {}
fr_embeddings_subset = {}
french_words = set(en_fr_train.values())
for en_word in en_fr_train.keys():
fr_word = en_fr_train[en_word]
if fr_word in fr_set and en_word in en_set:
en_embeddings_subset[en_word] = en_vec[en_wo... |
rh01/ml-course-4-cluster-and-retrieval | 0_nearest-neighbors-features-and-metrics_blank.ipynb | agpl-3.0 | import graphlab
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
"""
Explanation: Nearest Neighbors
author: 申恒恒
When exploring a large set of documents -- such as Wikipedia, news articles, StackOverflow, etc. -- it can be useful to get a list of related material. To find relevant documents you typ... |
jrbourbeau/cr-composition | notebooks/fraction-distribution.ipynb | mit | %load_ext watermark
%watermark -u -d -v -p numpy,matplotlib,scipy,pandas,sklearn,mlxtend
"""
Explanation: <a id='top'> </a>
Author: James Bourbeau
End of explanation
"""
from __future__ import division, print_function
from collections import defaultdict
import itertools
import numpy as np
from scipy import optimize
... |
pramitchoudhary/Experiments | notebook_gallery/other_experiments/build-models/model-selection-and-tuning/current-solutions/TPOT/TPOT-demo.ipynb | unlicense | !sudo pip install deap update_checker tqdm xgboost tpot
import pandas as pd
import numpy as np
import psycopg2
import os
import json
from tpot import TPOTClassifier
from sklearn.metrics import classification_report
conn = psycopg2.connect(
user = os.environ['REDSHIFT_USER']
,password = os.environ['REDSHIFT_... |
nproctor/phys202-2015-work | assignments/assignment03/NumpyEx01.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 1
Imports
End of explanation
"""
def checkerboard(size):
#Create a 2x2 diagonal array
x = np.diag((1.0, 1.0))
#If the... |
dynaryu/rmtk | rmtk/vulnerability/derivation_fragility/R_mu_T_dispersion/ruiz_garcia_miranda/ruiz-garcia_miranda.ipynb | agpl-3.0 | from rmtk.vulnerability.derivation_fragility.R_mu_T_dispersion.ruiz_garcia_miranda import RGM2007
from rmtk.vulnerability.common import utils
import scipy.stats as stat
%matplotlib inline
"""
Explanation: Ruiz-García and Miranda (2007)
The aim of this procedure is the estimation of the median spectral acceleration v... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/feature_engineering/labs/3_keras_basic_feat_eng-lab.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Install Sklearn
!python3 -m pip install --user sklearn
import os
import tensorflow.keras
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
from tensorflow import feature_column as fc
from tensorflow.keras import layers
fr... |
eroicaleo/LearningPython | HandsOnML/ch02/ex01.ipynb | mit | strat_train_set_copy = strat_train_set.copy()
housing.plot(kind="scatter", x='longitude', y='latitude')
housing.plot(kind="scatter", x='longitude', y='latitude', alpha=0.1)
strat_train_set_copy.plot(kind='scatter', x='longitude', y='latitude', alpha=0.4,
s=strat_train_set_copy.population/10... |
griffinfoster/fundamentals_of_interferometry | 2_Mathematical_Groundwork/2_3_fourier_series.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
2. Mathematical Groundwork
Previous: 2.2 Important functions
Next: 2.4 The Fourier Transform
Import standard modules:
End of expla... |
ayush29feb/cs231n | assignment2/BatchNormalization.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
... |
balaaagi/pylearn | presentations/ChennaiPy-ProbabilisticProgrammingWithLea.ipynb | mit | from lea import *
# mandatory die example - initilize a die object
die = Lea.fromVals(1, 2, 3, 4, 5, 6)
# throw the die a few times
die.random(20)
# mandatory coin toss example - states can be strings!
coin = Lea.fromVals('Head', 'Tail')
# toss the coin a few times
coin.random(10)
# how about a Boolean variable - ... |
bioinformatica-corso/lezioni | laboratorio/lezione16-03dic21/esercizio1-biopython.ipynb | cc0-1.0 | import Bio
"""
Explanation: Biopython - Esercizio1
Prendere in input un file in formato FASTA di sequenze EST (Expressed Sequence Tag) e
separare le sequenze in due diversi gruppi:
A: sequenze EST con coding sequence
B: sequenze EST senza coding sequence
Per ognuna delle sequenze del gruppo A estrarre la coding seq... |
Tsiems/machine-learning-projects | Lab1/Lab1-Travis-Copy1.ipynb | mit | import pandas as pd
import numpy as np
df = pd.read_csv('data/data.csv') # read in the csv file
"""
Explanation: Lab 1: Exploring NFL Play-By-Play Data
Data Loading and Preprocessing
To begin, we load the data into a Pandas data frame from a csv file.
End of explanation
"""
df.head()
"""
Explanation: Let's take a ... |
scikit-optimize/scikit-optimize.github.io | dev/notebooks/auto_examples/plots/partial-dependence-plot.ipynb | bsd-3-clause | print(__doc__)
import sys
from skopt.plots import plot_objective
from skopt import forest_minimize
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
"""
Explanation: Partial Dependence Plots
Sigurd Carlsen Feb 2019
Holger Nahrstaedt 2020
.. currentmodule:: skopt
Plot objective now supports optiona... |
n-witt/MachineLearningWithText_SS2017 | tutorials/8 k-Means Clustering.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns; sns.set() # for plot styling
import numpy as np
"""
Explanation: k-Means Clustering
In the previous few section, we have explored one category of unsupervised machine learning models: dimensionality reduction.
Here we will move on to another c... |
martijnvermaat/monoseq | doc/monoseq.ipynb | mit | from monoseq.ipynb import Seq
s = ('cgcactcaaaacaaaggaagaccgtcctcgactgcagaggaagcaggaagctgtc'
'ggcccagctctgagcccagctgctggagccccgagcagcggcatggagtccgtgg'
'ccctgtacagctttcaggctacagagagcgacgagctggccttcaacaagggaga'
'cacactcaagatcctgaacatggaggatgaccagaactggtacaaggccgagctc'
'cggggtgtcgagggatttattcccaagaact... |
opengeostat/pygslib | pygslib/Ipython_templates/broken/vtk_tools.ipynb | mit | import pygslib
import numpy as np
"""
Explanation: VTK tools
Pygslib use VTK:
as data format and data converting tool
to plot in 3D
as a library with some basic computational geometry functions, for example to know if a point is inside a surface
Some of the functions in VTK were obtained or modified from Adamos Kyr... |
thomasantony/CarND-Projects | Exercises/Term1/TensorFlow-Tutorials/01_Simple_Linear_Model.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
"""
Explanation: TensorFlow Tutorial #01
Simple Linear Model
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
This tutorial demonstrates the basic workflow o... |
bumblebeefr/poppy_rate | [startup] Dynamixel - List and configure motors.ipynb | gpl-2.0 | ports = pypot.dynamixel.get_available_ports()
if not ports:
raise IOError('no port found!')
print "Ports founds %s" % ports
for port in ports:
print('Connecting on port:', port)
dxl_io = pypot.dynamixel.DxlIO(port)
motors = dxl_io.scan()
print(" %s motors founds : %s\n" % (len(motors),motors)... |
tleonhardt/CodingPlayground | dataquest/SQL_and_Databases/Preparing_Data_for_SQLite.ipynb | mit | # Import pandas and read the CSV file academy_awards.csv into a DataFrame
import pandas as pd
df = pd.read_csv('../data/academy_awards.csv', encoding="ISO-8859-1")
# Start exploring the data in Pandas and look for data quality issues
df.head()
# There are 6 unnamed columns at the end. Do any of them contain valid va... |
quantopian/research_public | notebooks/lectures/Case_Study_Comparing_ETFs/answers/notebook.ipynb | apache-2.0 | # Useful functions
def normal_test(X):
z, pval = stats.normaltest(X)
if pval < 0.05:
print 'Values are not normally distributed.'
else:
print 'Values are normally distributed.'
return
# Useful Libraries
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import s... |
katychuang/ipython-notebooks | fragrance analysis - scrapy example.ipynb | gpl-2.0 | import requests
from scrapy.http import TextResponse
url = "https://www.fragrantica.com/designers/Dolce%26Gabbana.html"
user_agent = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58: .0.3029.110 Chrome/58.0.3029.110 Safari/537.36'}
r = requests.get(url, headers... |
mne-tools/mne-tools.github.io | 0.23/_downloads/d2352ab4b72ce7d1dc05c76bda6ef71d/55_setting_eeg_reference.ipynb | bsd-3-clause | import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
raw.crop(tmax=60).load_data()
raw.pick(['EEG 0{:... |
kevinjliang/Duke-Tsinghua-MLSS-2017 | 03A_Variational_Autoencoder.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
slim = tf.contrib.slim
# Import data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"""
Explanation: Variational Autoencoder in TensorFlow
Variational Autoencoders (VA... |
osemer01/insights-from-baby-names-since-1910 | baby_names.ipynb | cc0-1.0 | import os
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
data_folder = os.path.join('data')
file_names = []
for f in os.listdir(data_folder):
file_names.append(os.path.join(data_folder,f))
del file_names[file_names.index(os.path.join(data_folder,'Stat... |
elizabetht/deep-learning | gan_mnist/Intro_to_GANs_Solution.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
turbomanage/training-data-analyst | courses/machine_learning/feateng/feateng.ipynb | apache-2.0 | !pip install --user apache-beam[gcp]==2.16.0
!pip install --user httplib2==0.12.0
"""
Explanation: <h1> Feature Engineering </h1>
In this notebook, you will learn how to incorporate feature engineering into your pipeline.
<ul>
<li> Working with feature columns </li>
<li> Adding feature crosses in TensorFlow </li>
<... |
WNoxchi/Kaukasos | FAML1/Lesson1-RandomForests.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
from fastai.imports import *
from fastai.structured import *
from pandas_summary import DataFrameSummary
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from IPython.display import display
from sklearn import metrics
PATH = "data/bulld... |
udacity/deep-learning | sentiment-network/Sentiment_Classification_Projects.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
slundberg/shap | notebooks/tabular_examples/tree_based_models/Scatter Density vs. Violin Plot Comparison.ipynb | mit | import xgboost
import shap
# train xgboost model on diabetes data:
X, y = shap.datasets.diabetes()
bst = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(X, label=y), 100)
# explain the model's prediction using SHAP values on the first 1000 training data samples
shap_values = shap.TreeExplainer(bst).shap_values... |
ocefpaf/git_intro_demo | git_intro.ipynb | mit | %%bash
git status
%%bash
git log
%%bash
git show
%%writefile foo.md
Fetchez la vache
%%bash
git add foo.md
%%bash
git st
%%bash
git diff foo.md
%%bash
git diff git_intro.ipynb
%%bash
git rm -f foo.md
%%bash
git st
"""
Explanation: Very simple git intro
git config
%%bash
git config --global --get us... |
tommyod/abelian | docs/notebooks/homomorphisms.ipynb | gpl-3.0 | from IPython.display import display, Math
def show(arg):
return display(Math(arg.to_latex()))
"""
Explanation: Tutorial: Homomorphisms
This is an interactive tutorial written with real code.
We start by setting up $\LaTeX$ printing.
End of explanation
"""
from abelian import LCA, HomLCA
# Initialize the target... |
f-guitart/data_mining | notes/02c - Apache Spark MLlib.ipynb | gpl-3.0 | from pyspark.sql import SparkSession
import pyspark
spark = SparkSession \
.builder \
.appName("Python Spark SQL basic example") \
.config("spark.some.config.option", "some-value") \
.getOrCreate()
sc = spark.sparkContext
"""
Explanation: Apache Spark MLlib
MLlib is Spark’s machine learning (ML) lib... |
aboSamoor/compsocial | Word_Tracker/3rd_Yr_Paper/PsychoInfo.ipynb | gpl-3.0 | from tools import get_psycinfo_database
words_df = get_psycinfo_database()
words_df.head()
#words_df.to_csv("data/PsycInfo/processed/psychinfo_combined.csv.bz2", encoding='utf-8',compression='bz2')
"""
Explanation: Merge CSV databases
End of explanation
"""
#psychinfo = pd.read_csv("data/PsycInfo/processed/psychi... |
manoharan-lab/structural-color | detector_tutorial.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import structcol as sc
from structcol import refractive_index as ri
from structcol import montecarlo as mc
from structcol import detector as det
import pymie as pm
from pymie import size_parameter, index_ratio
import time
# For Jupyter notebooks only:
%matplotlib inl... |
BL-Labs/poetryhunt | Cluster experiment 2.ipynb | mit | %matplotlib inline
# Load this library to make the graphs interactive for smaller samples
#import mpld3
#mpld3.enable_notebook()
# Turns out, multiple interactive scattergraphs with 170,000+ points each is a bit too much for a browser
# Who knew?!
from clustering_capitals import create_cluster_dataset, NewspaperArc... |
kgrodzicki/machine-learning-specialization | course-3-classification/module-2-linear-classifier-assignment-blank.ipynb | mit | from __future__ import division
import graphlab
import math
import string
"""
Explanation: Predicting sentiment from product reviews
The goal of this first notebook is to explore logistic regression and feature engineering with existing GraphLab functions.
In this notebook you will use product review data from Amazon.... |
diego0020/va_course_2015 | AstroML/notebooks/07_classification_example.ipynb | mit | import os
DATA_HOME = os.path.abspath('C:/temp/AstroML/data/sdss_colors/')
"""
Explanation: Classification Example
You'll need to modify the DATA_HOME variable to the location of the datasets.
In this tutorial we'll use the colors of over 700,000 stars and quasars from the
Sloan Digital Sky Survey. 500,000 of them a... |
gmodena/notebooks | Ensemble learning - stacked generalization.ipynb | bsd-3-clause | from sklearn.cross_validation import train_test_split, StratifiedKFold
from sklearn.metrics import accuracy_score
from sklearn.datasets import make_classification
import numpy as np
n_features = 20
n_samples = 10000
X, y = make_classification(n_features=n_features, n_samples=n_samples)
"""
Explanation: Introduction
... |
JakeColtman/BayesianSurvivalAnalysis | Full done.ipynb | mit | running_id = 0
output = [[0]]
with open("E:/output.txt") as file_open:
for row in file_open.read().split("\n"):
cols = row.split(",")
if cols[0] == output[-1][0]:
output[-1].append(cols[1])
output[-1].append(True)
else:
output.append(cols)
output = out... |
esa-as/2016-ml-contest | esaTeam/esa_Submission02.ipynb | apache-2.0 | # Import
from __future__ import division
get_ipython().magic(u'matplotlib inline')
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['figure.figsize'] = (20.0, 10.0)
inline_rc = dict(mpl.rcParams)
from classification_utilities import make_facies_log_plot
import pandas as pd
import numpy as np
impo... |
mne-tools/mne-tools.github.io | 0.23/_downloads/f398f296c84e53a14339d2c3c36e91a4/movement_detection.ipynb | bsd-3-clause | # Authors: Adonay Nunes <adonay.s.nunes@gmail.com>
# Luke Bloy <luke.bloy@gmail.com>
# License: BSD (3-clause)
import os.path as op
import mne
from mne.datasets.brainstorm import bst_auditory
from mne.io import read_raw_ctf
from mne.preprocessing import annotate_movement, compute_average_dev_head_t
# Load d... |
Open-Power-System-Data/time_series | processing.ipynb | mit | version = '2020-10-06'
changes = '''Yearly update'''
"""
Explanation: <div style="width:100%; background-color: #D9EDF7; border: 1px solid #CFCFCF; text-align: left; padding: 10px;">
<b>Time series: Processing Notebook</b>
<ul>
<li><a href="main.ipynb">Main Notebook</a></li>
<li>Processing ... |
darkomen/TFG | ipython_notebooks/06_regulador_experto/.ipynb_checkpoints/ensayo3-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
ecervera/Baxter-Vision | 03 Compute Items Dominant Colors.ipynb | mit | import json
from utils import load_items
with open('parameters.json', 'r') as infile:
params = json.load(infile)
RESIZE_X = params['resize']['x']
RESIZE_Y = params['resize']['y']
ITEM_FOLDER = params['item_folder']
items = load_items(ITEM_FOLDER)
"""
Explanation: <a id="top"></a>
Compute Items Features
First:
*... |
monsta-hd/ml-mnist | experiments/cross_validations.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
sns.set()
import matplotlib.pyplot as plt
import env
from ml_mnist.knn import KNNClassifier
from ml_mnist.gp import GPClassifier
from ml_mnist.logreg import LogisticRegression
from ml_mnist.nn import NNClassifier, RBM
from ml_mnist.nn.layers import FullyConn... |
setiQuest/ML4SETI | results/effsubsee_seti_code_challenge_1stPlace.ipynb | apache-2.0 | # Uncomment and run this one time only
# !pip install http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl
# !pip install torchvision==0.1.8
# !pip install tabulate
# !pip install --upgrade scikit-learn
# !pip install --upgrade numpy
# !pip install h5py
# !pip install ibmseti
# !pip insta... |
metpy/MetPy | dev/_downloads/bb9caa5586d62e19ca46e30c02d29b43/Station_Plot.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from metpy.calc import reduce_point_density
from metpy.cbook import get_test_data
from metpy.io import metar
from metpy.plots import add_metpy_logo, current_weather, sky_cover, StationPlot
"""
Explanation: Station Plot
Make ... |
adit-chandra/tensorflow | tensorflow/lite/g3doc/performance/post_training_float16_quant.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... |
niketanpansare/systemml | samples/jupyter-notebooks/Linear_Regression_Algorithms_Demo.ipynb | apache-2.0 | !pip install --upgrade --user systemml
!pip show systemml
"""
Explanation: Linear Regression Algorithms using Apache SystemML
Table of Content:
- Install SystemML using pip
- Example 1: Implement a simple 'Hello World' program in SystemML
- Example 2: Matrix Multiplication
- Load diabetes dataset from scikit-learn fo... |
ContextLab/quail | docs/tutorial/basic_analyze_and_plot.ipynb | mit | import quail
%matplotlib inline
egg = quail.load_example_data()
"""
Explanation: Basic analyzing and plotting
This tutorial will go over the basics of analyzing eggs, the primary data structure used in quail. To learn about how an egg is set up, see the egg tutorial.
An egg is made up of (at minimum) the stimuli pres... |
brain-research/guided-evolutionary-strategies | Guided_Evolutionary_Strategies_Demo.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
rueedlinger/machine-learning-snippets | notebooks/basics/statistical_analysis.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import pandas as pd
from matplotlib import pyplot as plt
plt.style.use("ggplot")
"""
Explanation: Statistical analysis
In this notebook we use pandas and the stats module from scipy for some basic statistical analysi... |
lmcinnes/pynndescent | doc/pynndescent_in_pipelines.ipynb | bsd-2-clause | from sklearn.manifold import Isomap, TSNE
from sklearn.neighbors import KNeighborsTransformer
from pynndescent import PyNNDescentTransformer
from sklearn.pipeline import make_pipeline
from sklearn.datasets import fetch_openml
from sklearn.utils import shuffle
import seaborn as sns
"""
Explanation: Working with Scikit... |
pysg/pyther | thermodynamic_correlations.ipynb | mit | import numpy as np
import pandas as pd
import pyther as pt
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Thermodynamics correlations for pure components
En esta sección se muestra la class Thermodynamic_correlations() la cual permite realizar el cálculo de propiedades termodinámicas de sustancia... |
valter-lisboa/ufo-notebooks | Python3/.ipynb_checkpoints/ufo-sample-python3-checkpoint.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
"""
Explanation: USA UFO sightings (Python 3 version)
This notebook is based on the first chapter sample from Machine Learning for Hackers with some added features. I did this to present Jupyter Notebook with Python 3 for Tech Days in my Job.
The original link is offline so you ... |
KitwareMedical/ITKUltrasound | examples/RFPowerSpectraAttenuation.ipynb | apache-2.0 | # Install notebook dependencies
import sys
#!{sys.executable} -m pip install itk itk-ultrasound matplotlib
import os
import requests
import shutil
import itk
import matplotlib.pyplot as plt
assert 'AttenuationImageFilter' in dir(itk) # Verify we have an up-to-date version of itk-ultrasound
"""
Explanation: RF Power ... |
ToqueWillot/M2DAC | FDMS/TME4/TME4_FiltrageCollaboratif-Copy1.ipynb | gpl-2.0 | def loadMovieLens(path='./data/movielens'):
#Get movie titles
movies={}
for line in open(path+'/u.item'):
id,title=line.split('|')[0:2]
movies[id]=title
# Load data
prefs={}
for line in open(path+'/u.data'):
(user,movieid,rating,ts)=line.split('\t')
prefs.setdefa... |
corochann/chainer-hands-on-tutorial | src/04_cifar_cnn/cifar10_cifar100_dataset_introduction.ipynb | mit | from __future__ import print_function
import os
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import chainer
basedir = './src/cnn/images'
"""
Explanation: CIFAR-10, CIFAR-100 dataset introduction
CIFAR-10 and CIFAR-100 are the small image datasets with its classification labeled. It is widel... |
JENkt4k/pynotes-general | Reformer_Text_Generation.ipynb | gpl-3.0 | # Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the Licen... |
kvr777/deep-learning | first-neural-network/dlnd-your-first-neural-network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
zhmz90/DeepLearningCourseFromGoogle | udacity/1_notmnist.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import matplotlib.pyplot as plt
import numpy as np
import os
import tarfile
import urllib
from IPython.display import display, Image
from scipy import ndimage
from sklearn.linear_model import LogisticRegression
... |
PWhiddy/kbmod | notebooks/Kbmod_Documentation.ipynb | bsd-2-clause | from kbmodpy import kbmod as kb
import numpy
path = "../data/demo/"
"""
Explanation: KBMOD Documentation
This notebook demonstrates the basics of the kbmod image processing and searching python API
Before importing, make sure to run
source setup.bash
in the root directory, and that you are using the python3 kernel.
Im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.