repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
akseshina/dl_course
seminar_6/hw_tSNE.ipynb
gpl-3.0
import numpy as np import pandas as pd from collections import Counter import warnings warnings.filterwarnings('ignore') import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from sklearn.manifold import TSNE family_classification_metadata = pd.read_table('../seminar_5/data/family_classification_...
phoebe-project/phoebe2-docs
2.2/examples/extinction_BK_binary.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Extinction: B-K Binary In this example, we'll reproduce Figures 1 and 2 in the extinction release paper (Jones et al. 2020). "Let us begin with a rather extreme case, a synthetic binary comprised of a hot, B-type main sequence star(M=6.5 Msol,Teff=17000 K, ...
kmclaugh/fastai_courses
kevin_files/lesson4.ipynb
apache-2.0
ratings = pd.read_csv(path+'ratings.csv') ratings.head() len(ratings) """ Explanation: Set up data We're working with the movielens data, which contains one rating per row, like this: End of explanation """ movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict() users = ratings.userId....
HuanglabPurdue/NCS
clib/jupyter_notebooks/ncs_demo_simulation.ipynb
gpl-3.0
import matplotlib import matplotlib.pyplot as pyplot import numpy import os import time # python3-6 NCS. import pyNCS import pyNCS.denoisetools as ncs # python3 and C NCS. import pyCNCS.ncs_c as ncsC # Generate the same random noise each time. numpy.random.seed(1) py_ncs_path = os.path.dirname(os.path.abspath(pyNC...
rkastilani/PowerOutagePredictor
PowerOutagePredictor/Linear/Lasso.ipynb
mit
import numpy as np import pandas as pd from sklearn import linear_model from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt data = pd.read_csv("../../Data/2014outagesJerry.csv") data.head() """ Explanation: Lasso Regression: Performs L1 regularization, i.e. adds penalty equivalent to abs...
iRipVanWinkle/ml
Data Science UA - September 2017/Lecture 05 - Modeling Techniques and Regression/Preparing Numeric Data.ipynb
mit
# This line lets me show plots %matplotlib inline #import useful modules import numpy as np import pandas as pd from ggplot import mtcars """ Explanation: Preparing Numeric Data There are variety of preprocessing tasks one should consider before using numeric data in analysis and predict...
quantopian/research_public
research/Markowitz-Quantopian-Research.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import cvxopt as opt from cvxopt import blas, solvers import pandas as pd np.random.seed(123) # Turn off progress printing solvers.options['show_progress'] = False """ Explanation: The Efficient Frontier: Markowitz Portfolio optimization in Python By Dr. Thomas Sta...
palrogg/foundations-homework
14/Homework-14-Ronga.ipynb
mit
# If you'd like to download it through the command line... !curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz # And then extract it through the command line... !tar -zxf convote_v1.1.tar.gz """ Explanation: Homework 14 (or so): TF-IDF text analysis and clustering Hooray, we kind of figured ...
tkurfurst/deep-learning
batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
yttty/python3-scraper-tutorial
Python_Spider_Tutorial_03.ipynb
gpl-3.0
import re import urllib.request import urllib from collections import deque queue = deque() visited = set() url = 'http://news.dbanotes.net' # 入口页面, 可以换成别的 queue.append(url) cnt = 0 while queue: url = queue.popleft() # 队首元素出队 visited |= {url} # 标记为已访问 print('已经抓取: ' + str(cnt) + ' 正在抓取 <--- ' + ...
GEMScienceTools/rmtk
notebooks/vulnerability/derivation_fragility/hybrid_methods/N2/N2.ipynb
agpl-3.0
from rmtk.vulnerability.derivation_fragility.hybrid_methods.N2 import N2Method from rmtk.vulnerability.common import utils %matplotlib inline """ Explanation: N2 - Eurocode 8, CEN (2005) This simplified nonlinear procedure for the estimation of the seismic response of structures uses capacity curves and inelastic spe...
AshtonIzmev/deep-learning-python-snippets
python/notebook/keras-digits.ipynb
mit
# Here's a Deep Dumb MLP (DDMLP) model = Sequential() model.add(Dense(input_dim, 128, init='lecun_uniform')) model.add(Activation('relu')) model.add(Dropout(0.25)) model.add(Dense(128, 128, init='lecun_uniform')) model.add(Activation('relu')) model.add(Dropout(0.25)) model.add(Dense(128, nb_classes, init='lecun_uniform...
oseledets/talks-online
kaiserslautern-2018/lecture-1.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt from numpy.polynomial import Chebyshev as T from numpy.polynomial.hermite import hermval %matplotlib inline def p_cheb(x, n): """ RETURNS T_n(x) value of not normalized Chebyshev polynomials $\int \frac1{\sqrt{1-x^2}}T_m(x)T_n(x) dx = \frac\pi2\delta_{...
diegocavalca/Studies
programming/Python/tensorflow/exercises/Graph.ipynb
cc0-1.0
# Q1. Create a graph g = ... with g.as_default(): # Define inputs with tf.name_scope("inputs"): a = tf.constant(2, tf.int32, name="a") b = tf.constant(3, tf.int32, name="b") # Ops with tf.name_scope("ops"): c = tf.multiply(a, b, name="c") d = tf.add(a, b, name="d") ...
tjwei/HackNTU_Data_2017
Week11/DIY_AI/Softmax.ipynb
mit
# Weight W = Matrix([1,2],[3,4], [5,6]) W # Bias b = Vector(1,0,-1) b # 輸入 x = Vector(2,-1) x """ Explanation: Supervised learning for classification 給一堆 $x$, 和他的分類,我們找出計算 x 的分類的方式 One hot encoding 如果我們有三類種類別, 我們可以來編碼這三個類別 * $(1,0,0)$ * $(0,1,0)$ * $(0,0,1)$ 問題 為什麼不直接用 1,2,3 這樣的編碼呢? Softmax Regression 的模型是這樣的 我們的輸...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_soft/td1a_cython_edit.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 1A.soft - Calcul numérique et Cython Python est très lent. Il est possible d'écrire certains parties en C mais le dialogue entre les deux langages est fastidieux. Cython propose un mélange de C et Python qui accélère la conception. End of...
tensorflow/docs-l10n
site/ja/tensorboard/get_started.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...
Oli4/lsi-material
Foundations of Information Management/Sheet 3 - RA operators in SQL and SQL queries.ipynb
mit
import sqlite3 conn = sqlite3.connect('movie.db') cur = conn.cursor() """ Explanation: Questions 1 (RA operators in SQL). Transform the following relational algebra expressions from the first exercise sheet into equivalent SQL queries. Question 2 End of explanation """ cur.execute('''SELECT genre ...
namiszh/fba
notebooks/yahoo-api-example.ipynb
mit
from rauth import OAuth2Service import webbrowser import json """ Explanation: Yahoo API Example This notebook is an example of using yahoo api to get fantasy sports data. End of explanation """ clientId= "dj0yJmk9M3gzSWJZYzFmTWZtJmQ9WVdrOU9YcGxTMHB4TXpnbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1kZg--" clinetSecrect="db...
azubiolo/itstep
it_step/ml_from_scratch/4_least-squares_continued/least-squares.ipynb
mit
X = [[1., 50.], [1., 76.], [1., 26.], [1., 102.]] Y = [30., 48., 12., 90.] # Y[3] = 300 # Outlier. Uncomment this line if you want to introduce an outlier. """ Explanation: Ordinary Least Squares -- Part II Course recap This lab consists in implementing the Ordinary Least Squares (OLS) algorithm, which is a linear re...
atcemgil/notes
LogisticRegression.ipynb
mit
%matplotlib inline import numpy as np import matplotlib as mpl import matplotlib.pylab as plt from ipywidgets import interact, interactive, fixed import ipywidgets as widgets from IPython.display import clear_output, display, HTML from matplotlib import rc import scipy as sc import scipy.optimize as opt mpl.rc('font...
cloudmesh/book
notebooks/scikit-learn/scikit-learn-k-means.ipynb
apache-2.0
! pip install numpy ! pip install scipy -U ! pip install -U scikit-learn """ Explanation: Instalation Source: ... Scikit-learn requires: Python (&gt;= 2.6 or &gt;= 3.3), NumPy (&gt;= 1.6.1), SciPy (&gt;= 0.9). If you already have a working installation of numpy and scipy, the easiest way to install scikit-learn is ...
aattaran/Machine-Learning-with-Python
titanic/titanic_survival_exploration[1].ipynb
bsd-3-clause
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the dataset in_file...
eggie5/ipython-notebooks
avengers/Avengers.ipynb
mit
import pandas as pd avengers = pd.read_csv("avengers.csv") avengers.head(5) """ Explanation: Avengers Data You can also see this notebook rendered on github: https://github.com/eggie5/ipython-notebooks/blob/master/avengers/Avengers.ipynb Life and Death of the Avengers The Avengers are a well-known and widely loved te...
dedx/cpalice
training/05_LinearFits.ipynb
mit
%pylab inline import numpy as np import matplotlib.pyplot as plt #Import the curve fitter from the scipy optimize package from scipy.optimize import curve_fit """ Explanation: 05 Linear fits to some data When you have a set of data that you would like to fit with some theoretical curve, you can use the SciPy optimize ...
leoferres/prograUDD
clases/02-Sintaxis-de-Python.ipynb
mit
# set the midpoint midpoint = 5 # make two empty lists lower = []; upper = [] # split the numbers into lower and upper for i in range(10): if (i < midpoint): lower.append(i) else: upper.append(i) print("lower:", lower) print("upper:", upper) """ Explanation: Metadata: Estos notebooks...
tleonhardt/CodingPlayground
dataquest/DataCleaning/Analyzing_NYC_High_School_Data.ipynb
mit
import pandas as pd import numpy as np import re data_files = ["ap_2010.csv", "class_size.csv", "demographics.csv", "graduation.csv", "hs_directory.csv", "sat_results.csv"] data = {} for f in data_files: d = pd.read_csv("../data/schools/{0}".fo...
ceos-seo/data_cube_notebooks
notebooks/water/detection/water_interoperability_similarity.ipynb
apache-2.0
import sys import os sys.path.append(os.environ.get('NOTEBOOK_ROOT')) %matplotlib inline import sys import datacube import numpy import numpy as np import xarray as xr from xarray.ufuncs import isnan as xr_nan import pandas as pd import matplotlib.pyplot as plt """ Explanation: <a id="water_interoperability_similari...
joekasp/ionic_liquids
ionic_liquids/examples/.ipynb_checkpoints/Example_Workflow-checkpoint.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from rdkit import Chem from rdkit.Chem import AllChem, Descriptors from rdkit.ML.Descriptors.MoleculeDescriptors import MolecularDescriptorCalculator as Calculator """ Explanation: Example of the...
xdnian/pyml
assignments/ex01_xdnian.ipynb
mit
# the function def sort(values): # insert your code here for j in range(len(values)-1,0,-1): for i in range(0, j): if values[i] > values[i+1]: values[i], values[i+1] = values[i+1], values[i] return values # main import numpy as np # different random seed np.random.seed(...
Kaggle/learntools
notebooks/embeddings/raw/1-embeddings.ipynb
apache-2.0
#$HIDE_INPUT$ # Setup. Import libraries and load dataframes for Movielens data. import numpy as np import pandas as pd from matplotlib import pyplot as plt import tensorflow as tf from tensorflow import keras import os import random tf.set_random_seed(1); np.random.seed(1); random.seed(1) # Set random seeds for reprod...
miguelfrde/stanford-cs231n
assignment2/FullyConnectedNets.ipynb
mit
# As usual, a bit of setup from __future__ import print_function 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.solv...
palrogg/foundations-homework
Data_and_databases/Homework_2_Paul_Ronga_Graded.ipynb
mit
import pg8000 conn = pg8000.connect(database="homework2") """ Explanation: Homework 2: Working with SQL (Data and Databases 2016) This homework assignment takes the form of an IPython Notebook. There are a number of exercises below, with notebook cells that need to be completed in order to meet particular criteria. Yo...
RaspberryJamBe/ipython-notebooks
notebooks/en-gb/102 - LEDs - Drive LEDS with the Raspberry Pi GPIO pins.ipynb
cc0-1.0
#load GPIO library import RPi.GPIO as GPIO #Set BCM (Broadcom) mode for the pin numbering GPIO.setmode(GPIO.BCM) """ Explanation: Drive LEDs with the Raspberry Pi GPIO pins This notebook will walk you through using the Raspberry Pi General Purpose Input/Output (GPIO) pins to make a LED light burn. The GPIO pins are th...
epeios-q37/epeios
tools/xdhq/examples/PYH/Hello.ipynb
agpl-3.0
try: import atlastk except: !pip install atlastk import atlastk atlastk.setJupyterHeight("150px") # Adjusting the height of the iframe in which the application will be displayed… """ Explanation: If you haven't already done so, please take a look at this FAQ, especially if you run this notebook on Google Colab....
pauliacomi/pyGAPS
docs/examples/iast.ipynb
mit
# import isotherms %run import.ipynb # import the iast module import pygaps import pygaps.iast as pgi import matplotlib.pyplot as plt import numpy """ Explanation: IAST examples The IAST method is used to predict the composition of the adsorbed phase in a multicomponent adsorption system, starting from pure componen...
probml/pyprobml
notebooks/book2/17/gp_poisson_1d.ipynb
mit
try: import tinygp except ImportError: %pip install -q tinygp try: import numpyro except ImportError: # It is much faster to use CPU than GPU. # This is because Colab has multiple CPU cores, so can run the 2 MCMC chains in parallel %pip uninstall -y jax jaxlib %pip install -q numpyro jax ja...
Juanlu001/poliastro
docs/source/examples/Using NEOS package.ipynb
mit
from astropy import time from poliastro.twobody.orbit import Orbit from poliastro.bodies import Earth from poliastro.frames import Planes from poliastro.plotting import StaticOrbitPlotter """ Explanation: Analyzing NEOs NEO stands for near-Earth object. The Center for NEO Studies (CNEOS) defines NEOs as comets and as...
d-meiser/cold-atoms
examples/Optimization of Coulomb force evaluation.ipynb
gpl-3.0
import coldatoms import numpy as np %matplotlib notebook import matplotlib.pyplot as plt import time """ Explanation: Evaluation of performance of Coulomb force evaluation In this notebook we have a quick look at the performance of the Coulomb force evalution and our optimizations. The timing results in this notebook ...
kcyu1993/ML_course_kyu
labs/ex01/npprimer.ipynb
mit
# Useful starting lines %matplotlib inline import numpy as np import matplotlib.pyplot as plt %load_ext autoreload %autoreload 2 """ Explanation: Welcome to the jupyter notebook! To run any cell, press Shit+Enter or Ctrl+Enter. IMPORTANT : Please have a look at Help-&gt;User Interface Tour and Help-&gt;Keyboard Shortc...
flothesof/LiveFFTPitchTracker
20150723_inversion.ipynb
bsd-2-clause
data = """79,05 102,40 115,40 126,10 217,50 240,70 82,4 101,5 114,1 123,1 215,8 239 81,90 104,80 113,20 121,50 214,20 237,50""" data = data.replace(',', '.') lines = data.split('\n') values = [line.split('\t') for line in lines] values import numpy as np import pandas as pd s = pd.DataFrame(values) s s.values....
yingchi/fastai-notes
deeplearning1/nbs/lesson6.ipynb
apache-2.0
path = get_file('nietzsche.txt', origin="https://s3.amazonaws.com/text-datasets/nietzsche.txt") text = open(path).read() print('corpus length:', len(text)) chars = sorted(list(set(text))) vocab_size = len(chars)+1 print('total chars:', vocab_size) """ Explanation: Setup We're going to download the collected works of ...
aaronmckinstry706/twitter-crime-prediction
notebooks/tweets_exploration.ipynb
gpl-3.0
import os import sys # From https://stackoverflow.com/a/36218558 . def sparkImport(module_name, module_directory): """ Convenience function. Tells the SparkContext sc (must already exist) to load module module_name on every computational node before executing an RDD. Args: m...
susantabiswas/Natural-Language-Processing
Notebooks/Word_Prediction_using_Quadgrams_Memory_Efficient_Encoded_keys.ipynb
mit
#import the modules necessary from nltk.util import ngrams from collections import defaultdict from collections import OrderedDict import nltk import string import time start_time = time.time() """ Explanation: Word prediction based on Quadgram This program reads the corpus line by line so it is slower than the progr...
Vizzuality/gfw
docs/Update_GFW_Layers_Vault.ipynb
mit
!pip install LMIPy from IPython.display import clear_output clear_output() print('LMI ready!') """ Explanation: Create Layer Config Backup This notebook outlines how to run a process to create a remote backup of gfw layers. Rough process: Run this notebook from the gfw/data folder Wait... Check _metadata.json files...
marcotcr/lime
doc/notebooks/Tutorial - MNIST and RF.ipynb
bsd-2-clause
import numpy as np import matplotlib.pyplot as plt from skimage.color import gray2rgb, rgb2gray, label2rgb # since the code wants color images from sklearn.datasets import fetch_openml mnist = fetch_openml('mnist_784') # make each image color so lime_image works correctly X_vec = np.stack([gray2rgb(iimg) for iimg in m...
jakobrunge/tigramite
tutorials/tigramite_tutorial_assumptions.ipynb
gpl-3.0
# Imports import numpy as np import matplotlib from matplotlib import pyplot as plt %matplotlib inline ## use `%matplotlib notebook` for interactive figures # plt.style.use('ggplot') import sklearn import tigramite from tigramite import data_processing as pp from tigramite.toymodels import structural_causal_proce...
tyberion/jupyter_pdf_slides
Example.ipynb
mit
attend = sns.load_dataset("attention").query("subject <= 12") g = sns.FacetGrid(attend, col="subject", col_wrap=4, size=2, ylim=(0, 10)) g.map(sns.pointplot, "solutions", "score", color=".3", ci=None); """ Explanation: Calculate the attention of subjects Here we calculate the attention of subjects End of explanation "...
RTHMaK/RPGOne
scipy-2017-sklearn-master/notebooks/03 Data Representation for Machine Learning.ipynb
apache-2.0
from sklearn.datasets import load_iris iris = load_iris() """ Explanation: The use of watermark (above) is optional, and we use it to keep track of the changes while developing the tutorial material. (You can install this IPython extension via "pip install watermark". For more information, please see: https://github.c...
KaiSzuttor/espresso
doc/tutorials/02-charged_system/02-charged_system-2.ipynb
gpl-3.0
from espressomd import System, electrostatics, electrostatic_extensions from espressomd.shapes import Wall from espressomd.minimize_energy import steepest_descent import espressomd import numpy """ Explanation: Tutorial 2: A Simple Charged System, Part 2 7 2D Electrostatics and Constraints In this section, we use the ...
ledeprogram/algorithms
class6/donow/Gruen_Gianna_6_donow.ipynb
gpl-3.0
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import statsmodels.formula.api as smf """ Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model End of explanation """ df = pd.read_csv('hanford.csv') df """ Explanation: 2. Read in the han...
qutip/qutip-notebooks
development/development-ssesolver-new-methods.ipynb
lgpl-3.0
%matplotlib inline %config InlineBackend.figure_formats = ['svg'] from qutip import * from qutip.ui.progressbar import BaseProgressBar import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint y_sse = None import time """ Explanation: Test for different solvers for stochastic equation Base...
statsmodels/statsmodels
examples/notebooks/statespace_tvpvar_mcmc_cfa.ipynb
bsd-3-clause
%matplotlib inline from importlib import reload import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from scipy.stats import invwishart, invgamma # Get the macro dataset dta = sm.datasets.macrodata.load_pandas().data dta.index = pd.date_range('1959Q1', '2009Q3', freq='Q...
ogoann/StatisticalMethods
examples/Cepheids/FirstLook.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (15.0, 8.0) """ Explanation: A First Look at the Periods and Luminosities of Cepheid Stars Cepheids are stars whose brightness oscillates with a stable period that appears to be strongly correlated with their lumi...
nslatysheva/data_science_blogging
tricks_of_the_trade_ensembling/messy_modelling_simplified.ipynb
gpl-3.0
# Creating the dataset # e.g. make_moons generates crescent-shaped data # Check out make_classification, which generates ~linearly-separable data from sklearn.datasets import make_moons X, y = make_moons( n_samples=500, # the number of observations random_state=1, noise=0.3 #0.3 ) # Take a peek print(X[:...
wittawatj/fsic-test
ipynb/ex2_results.ipynb
mit
%load_ext autoreload %autoreload 2 %matplotlib inline #%config InlineBackend.figure_format = 'svg' #%config InlineBackend.figure_format = 'pdf' import numpy as np import matplotlib import matplotlib.pyplot as plt import fsic.data as data import fsic.glo as glo import fsic.indtest as it import fsic.kernel as kernel imp...
dsacademybr/PythonFundamentos
Cap05/Notebooks/DSA-Python-Cap05-Exercicios-Solucao.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 5</font> Download: http://github.com/dsacademybr End of explanation """ # Exerc...
guyk1971/deep-learning
batch-norm/Batch_Normalization_Lesson_GK.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("../gan_mnist/MNIST_data/", one...
bloomberg/bqplot
examples/Interactions/Mark Interactions.ipynb
apache-2.0
x_sc = LinearScale() y_sc = LinearScale() x_data = np.arange(20) y_data = np.random.randn(20) scatter_chart = Scatter( x=x_data, y=y_data, scales={"x": x_sc, "y": y_sc}, colors=["dodgerblue"], interactions={"click": "select"}, selected_style={"opacity": 1.0, "fill": "DarkOrange", "stroke": "Re...
GoogleCloudPlatform/ml-design-patterns
06_reproducibility/feature_store.ipynb
apache-2.0
import os # Feast Core acts as the central feature registry FEAST_CORE_URL = os.getenv('FEAST_CORE_URL', 'localhost:6565') # Feast Online Serving allows for the retrieval of real-time feature data FEAST_ONLINE_SERVING_URL = os.getenv('FEAST_ONLINE_SERVING_URL', 'localhost:6566') # Feast Batch Serving allows for the ...
jGaboardi/LP_MIP
.ipynb_checkpoints/Primal_v_Dual_Canonical_GUROBI-checkpoint.ipynb
lgpl-3.0
# Imports import numpy as np import gurobipy as gbp import datetime as dt # Constants Aij = np.random.randint(5, 50, 25) Aij = Aij.reshape(5,5) AijSum = np.sum(Aij) Cj = np.random.randint(10, 20, 5) CjSum = np.sum(Cj) Bi = np.random.randint(10, 20, 5) BiSum = np.sum(Bi) # Matrix Shape rows = range(len(Aij)) cols = r...
keras-team/keras-io
examples/vision/ipynb/cutmix.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras np.random.seed(42) tf.random.set_seed(42) """ Explanation: CutMix data augmentation for image classification Author: Sayan Nath<br> Date created: 2021/06/08<br> Last modified: 2021/06/08<br> Des...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch2-Example_2-10.ipynb
unlicense
%pylab notebook """ Explanation: Electric Machinery Fundamentals 5th edition Chapter 2 (Code examples) Example 2-10 Calculate and plot the magnetization current of a 230/115 transformer operating at 230 volts and 50/60 Hz. This program also calculates the rms value of the mag. current. Import the PyLab namespace (pr...
mdeff/ntds_2016
algorithms/02_sol_clustering.ipynb
mit
# Load libraries # Math import numpy as np # Visualization %matplotlib notebook import matplotlib.pyplot as plt plt.rcParams.update({'figure.max_open_warning': 0}) from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy import ndimage # Print output of LFR code import subprocess # Sparse matrix import ...
Oslandia/open-data-bikes-analysis
notebooks/Prediction-Lyon.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import graphviz from xgboost import plot_tree, plot_importance, to_graphviz import matplotlib as mpl from matplotlib import pyplot as plt import seaborn as sns import folium %load_ext watermark %watermark -d -v -p numpy,pandas,xgboost,matplotlib,folium -g...
zerothi/ts-tbt-sisl-tutorial
TB_08/run.ipynb
gpl-3.0
graphene = sisl.geom.graphene(orthogonal=True) # Graphene tight-binding parameters on, nn = 0, -2.7 H_minimal = sisl.Hamiltonian(graphene) H_minimal.construct([[0.1, 1.44], [on, nn]]) """ Explanation: In TBtrans and TranSiesta one is capable of performing real space transport calculations by using real space self-ene...
beyondvalence/biof509_wtl
Wk09-dataset-processing/Wk09_Dataset-preprocessing_wl.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd %matplotlib inline """ Explanation: Week 9 - Dataset preprocessing Before we utilize machine learning algorithms we must first prepare our dataset. This can often take a significant amount of time and can have a large impact on the performance of ...
phoebe-project/phoebe2-docs
2.3/tutorials/constraints_builtin.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: Advanced: Built-In Constraints Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import num...
tkurfurst/deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
tensorflow/docs-l10n
site/ja/probability/examples/Fitting_DPMM_Using_pSGLD.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 writing, sof...
prasants/pyds
12.Introduction_to_Pandas.ipynb
mit
import pandas as pd import numpy as np %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Pandas:-Introduction" data-toc-modified-id="Pandas:-Introduction-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Pandas: Introduction</a></div><div clas...
jluttine/bayespy
doc/source/examples/multinomial.ipynb
mit
n_colors = 5 # number of possible colors n_bags = 3 # number of bags n_trials = 20 # number of draws from each bag """ Explanation: Multinomial distribution: bags of marbles Written by: Deebul Nair (2016) Edited by: Jaakko Luttinen (2016) Inspired by https://probmods.org/hierarchical-models.html Using multinomial ...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/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', 'ipsl', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balan...
landmanbester/fundamentals_of_interferometry
2_Mathematical_Groundwork/fft_implementation_assignment.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 import cmath """ Explanation: Implementation of a Radix-2 Fast Fourier Transform Import standard modules: End of explanation """ def loop_DFT(x): """ Impleme...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Ener...
tpin3694/tpin3694.github.io
sql/select_rows_based_on_text_string.ipynb
mit
# Ignore %load_ext sql %sql sqlite:// %config SqlMagic.feedback = False """ Explanation: Title: Select Rows Based On Text String Slug: select_rows_based_on_text_string Summary: Select Rows Based On Text String in SQL. Date: 2017-01-16 12:00 Category: SQL Tags: Basics Authors: Chris Albon Note: This tutorial ...
weikang9009/giddy
notebooks/Sequence.ipynb
bsd-3-clause
import numpy as np import pandas as pd import libpysal import mapclassify as mc f = libpysal.io.open(libpysal.examples.get_path("usjoin.csv")) pci = np.array([f.by_col[str(y)] for y in range(1929,2010)]) q5 = np.array([mc.Quantiles(y,k=5).yb for y in pci]).transpose() q5 q5.shape """ Explanation: Alignment-based seq...
MikeLing/shogun
doc/ipython-notebooks/evaluation/xval_modelselection.ipynb
gpl-3.0
%pylab inline %matplotlib inline # include all Shogun classes import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') from shogun import * # generate some ultra easy training data gray() n=20 title('Toy data for binary classification') X=hstack((randn(2,n), randn(2,n)+1)) Y=hstack((-ones(n), ones(n))) _...
VlachosGroup/VlachosGroupAdditivity
docs/source/WorkshopJupyterNotebooks/pgradd_demo/pgradd_demo.ipynb
mit
import pgradd print(pgradd.__file__) from pgradd.GroupAdd import GroupLibrary import pgradd.ThermoChem lib = GroupLibrary.Load('GRWSurface2018') """ Explanation: Theory, Applications, and Tools for Multiscale Kinetic Modeling (July 2020) pGrAdd Demonstration 1. Introduction <img src="images/pGrAdd_RGB_github.png" w...
ajs3g11/training-public
FEEG6016 Simulation and Modelling/02-Monte-Carlo_Lab-2.ipynb
mit
from IPython.core.display import HTML css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css' HTML(url=css_file) """ Explanation: Monte Carlo Methods: Lab 2 End of explanation """ p_JZG_T2 = [0.1776, 0.329, 0.489, 0.7, 1.071, 1.75, 3.028, 5.285, 9.12] """ Exp...
fotis007/python_intermediate
Python_2_2.ipynb
gpl-3.0
#beispiel a = [1, 2, 3,] my_iterator = iter(a) my_iterator.__next__() my_iterator.__next__() """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Python-für-Fortgeschrittene-2" data-toc-modified-id="Python-für-Fortgeschrittene-2-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Python für Fortge...
csc-training/python-introduction
notebooks/exercises/4 - Functions and exceptions.ipynb
mit
def celsius_to_kelvin(c): # implementation here pass celsius_to_kelvin(0) """ Explanation: Functions and exceptions Functions Write a function that converts from Celsius to Kelvin. To convert from Celsius to Kelvin you add 273.15 from the value. Try your solution for a few values. End of explanation """ def...
cathalmccabe/PYNQ
boards/Pynq-Z1/base/notebooks/pmod/pmod_grove_buzzer.ipynb
bsd-3-clause
from pynq.overlays.base import BaseOverlay base = BaseOverlay("base.bit") """ Explanation: Grove Buzzer v1.2 This example shows how to use the Grove Buzzer v1.2. A Grover Buzzer, and PYNQ Grove Adapter are required. To set up the board for this notebook, the PYNQ Grove Adapter is connected to PMODB and the Grove Buzz...
warrierr/cs109
hw0/hw0.ipynb
mit
import sys print sys.version """ Explanation: Homework 0 Survey due 4th September, 2015 Submission due 10th September, 2015 Welcome to CS109 / STAT121 / AC209 / E-109 (http://cs109.org/). In this class, we will be using a variety of tools that will require some initial configuration. To ensure everything goes smooth...
teuben/astr288p
notebooks/03-arrays.ipynb
mit
a = [1,2,3] b = [4,5,6] c = a+b print(c) """ Explanation: Arrays for Numerical work? End of explanation """ a.append(b) print(a) def sum(data): """ sum the elements of an array """ asum = 0.0 for i in data: asum = asum + i return asum # the length of the array is defined here, and re-us...
tomquisel/wine-tasting
Wine Tasting Analysis.ipynb
mit
%matplotlib inline import pylab as plt import seaborn as sns import pandas as pd import numpy as np import scipy.stats import datetime as dt import random from IPython.display import display sns.set_context("notebook", font_scale=2) raw_data = pd.read_csv('/Users/tom/Downloads/Wine Tasting Data - Sheet1.csv') raw_da...
GoogleCloudPlatform/mlops-on-gcp
immersion/explainable_ai/solutions/xai_structured_caip.ipynb
apache-2.0
import os PROJECT_ID = "" # TODO: your PROJECT_ID here. os.environ["PROJECT_ID"] = PROJECT_ID BUCKET_NAME = "" # TODO: your BUCKET_NAME here. REGION = "us-central1" os.environ['BUCKET_NAME'] = BUCKET_NAME os.environ['REGION'] = REGION """ Explanation: AI Explanations: Explaining a tabular data model Overview In th...
pdwyys20/deep-learning
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
unnati-xyz/intro-python-data-science
wine/wine-selection.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline plt.style.use('ggplot') plt.rcParams['figure.figsize'] = (13,8) df = pd.read_csv("./winequality-red.csv") df.head() df.shape """ Explanation: Wine Selection Framing I want to buy a fine wine but I have no...
statsmodels/statsmodels
examples/notebooks/kernel_density.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from scipy import stats import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.distributions.mixture_rvs import mixture_rvs """ Explanation: Kernel Density Estimation Kernel density estimation is the process of estimating an unknown probability density funct...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_time_frequency_mixed_norm_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse from mne.inverse_sparse import tf_mixed_norm from mne.viz import plot_sparse_source_estimates print(__doc__) ...
chrisjsewell/jsonextended
README.ipynb
mit
from jsonextended import edict, plugins, example_mockpaths """ Explanation: JSON Extended A module to extend the python json package functionality: Treat a directory structure like a nested dictionary: lightweight plugin system: define bespoke classes for parsing different file extensions and encoding/decoding obj...
CentreForResearchInAppliedLinguistics/clic
docs/notebooks/Concordance/A serious concordance.ipynb
mit
# coding: utf-8 import os from cheshire3.baseObjects import Session from cheshire3.document import StringDocument from cheshire3.internal import cheshire3Root from cheshire3.server import SimpleServer session = Session() session.database = 'db_dickens' serv = SimpleServer(session, os.path.join(cheshire3Root, 'con...
3upperm2n/notes-deeplearning
projects/language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) #target_text """ Explanation: Language Translation In this project...
jackbrucesimpson/Machine-Learning-Workshop
training_testing.ipynb
mit
import cv2 import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np %matplotlib inline """ Explanation: Building a machine learning program In this section we put together everything we learned about images and features so that we can train a machine learning algorithm to distinguish between the i...
fastai/course-v3
zh-nbs/Lesson3_head_pose.ipynb
apache-2.0
%reload_ext autoreload %autoreload 2 %matplotlib inline from fastai.vision import * """ Explanation: Practical Deep Learning for Coders, v3 Lesson3_head_pose Regression with BIWI head pose dataset<br> 用BIWI头部姿势数据集进行回归建模 This is a more advanced example to show how to create custom datasets and do regression with image...
MatteusDeloge/opengrid
notebooks/DemoTmpo.ipynb
apache-2.0
import sys import os import inspect import tmpo import pandas as pd import datetime as dt import matplotlib.pyplot as plt import pytz from opengrid.library import houseprint from opengrid import config c=config.Config() %matplotlib inline plt.rcParams['figure.figsize'] = 14,8 """ Explanation: Quick Tmpo demo To get ...
dataDogma/Computer-Science
.ipynb_checkpoints/DAT208x - Week 1 - Python Basics-checkpoint.ipynb
gpl-3.0
# working with print function print(5 / 8) # Add another print function on new line print(7 + 10) """ Explanation: Lecture : Hello Python! [RQ-1] : Which of the following statements is correct? Ans: The Ipython Shell is typically used to work with Python interactively. [RQ-2] : Which file extension is used for P...
KECB/learn
BAMM.101x/Datetime_Example.ipynb
mit
#Unfortunatel, this won't work on Windows. !head sample_data.csv """ Explanation: <h1>Bucketing time</h1> <h4>The file "sample_data.csv" contains start times and processing times for all complaints registered with New York City's 311 complaint hotline on 01/01/2016. Our goal is to compute the average processing time ...
ga7g08/ga7g08.github.io
_notebooks/2015-04-24-Gaussian-mixture-model-for-pulsar-population.ipynb
mit
%%writefile Makefile DOWNLOADED = psrcat_pkg.tar ATNF_DATABASE = psrcat_tar DATA_FILE = ATNF_data_file.txt PSRCAT_FILE_PATH = ./psrcat_tar/psrcat.db all: $(DATA_FILE) $(ATNF_DATABASE) .PHONY: clean $(ATNF_DATABASE): wget http://www.atnf.csiro.au/people/pulsar/psrcat/downloads/psrcat_pkg.tar.gz gunzip psrcat_pkg...