text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
##### Copyright 2018 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Color Detect Application ---- <div class="alert alert-box alert-info"> Please use Jupyter labs http://&lt;board_ip_address&gt;/lab for this notebook. </div> This notebook shows how to download and play with the Color Detect Application ## Aims * Instantiate the application * Start the application * Play with the r...
github_jupyter
``` import matplotlib.pyplot as plt # pip install matplotlib import seaborn as sns # pip install seaborn import plotly.graph_objects as go # pip install plotly import imageio # pip install imageio import grid2op env = grid2op.make(test=True) from grid2op.PlotGrid import PlotMatplot plot_helper = PlotMatplot(env.obse...
github_jupyter
<a href="https://colab.research.google.com/github/mbk-dev/okama/blob/master/examples/07%20forecasting.ipynb"><img align="left" src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" title="Open and Execute in Google Colaboratory"></a> ``` !pip install okama import matplotlib.pyplot as plt p...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Factor Operations with pyBN It is probably rare that a user wants to directly manipulate factors unless they are developing a new algorithm, but it's still important to see how factor operations are done in pyBN. Moreover, the ease-of-use and transparency of pyBN's factor operations mean it can be a great teaching/l...
github_jupyter
# Clustering See our notes on [unsupervised learning](https://jennselby.github.io/MachineLearningCourseNotes/#unsupervised-learning), [K-means](https://jennselby.github.io/MachineLearningCourseNotes/#k-means-clustering), [DBSCAN](https://jennselby.github.io/MachineLearningCourseNotes/#dbscan-clustering), and [clusteri...
github_jupyter
## Hyperparameter Tuning Design Pattern In Hyperparameter Tuning, the training loop is itself inserted into an optimization method to find the optimal set of model hyperparameters. ``` import datetime import os import numpy as np import pandas as pd import tensorflow as tf import time from tensorflow import keras fr...
github_jupyter
<p align="center"> <img src="https://github.com/GeostatsGuy/GeostatsPy/blob/master/TCG_color_logo.png?raw=true" width="220" height="240" /> </p> ## Bootstrap-based Hypothesis Testing Demonstration ### Boostrap and Methods for Hypothesis Testing, Difference in Means * we calculate the hypothesis test for differe...
github_jupyter
# Individual Project ## Barber review in Gliwice ### Wojciech Pragłowski #### Data scraped from [booksy.](https://booksy.com/pl-pl/s/barber-shop/12795_gliwice) ``` import requests from bs4 import BeautifulSoup booksy = requests.get("https://booksy.com/pl-pl/s/barber-shop/12795_gliwice") soup = BeautifulSoup(books...
github_jupyter
# Systems of Nonlinear Equations ## CH EN 2450 - Numerical Methods **Prof. Tony Saad (<a>www.tsaad.net</a>) <br/>Department of Chemical Engineering <br/>University of Utah** <hr/> # Example 1 A system of nonlinear equations consists of several nonlinear functions - as many as there are unknowns. Solving a system of n...
github_jupyter
(pandas_plotting)= # Plotting ``` {index} Pandas: plotting ``` Plotting with pandas is very intuitive. We can use syntax: df.plot.* where * is any plot from matplotlib.pyplot supported by pandas. Full tutorial on pandas plots can be found [here](https://pandas.pydata.org/pandas-docs/stable/user_guide/visualiz...
github_jupyter
# Machine Learning with PyTorch and Scikit-Learn # -- Code Examples ## Package version checks Add folder to path in order to load from the check_packages.py script: ``` import sys sys.path.insert(0, '..') ``` Check recommended package versions: ``` from python_environment_check import check_packages d = { ...
github_jupyter
# Script to plot GALAH spectra, but also save them into python dictionaries ## Author: Sven Buder (SB, MPIA) buder at mpia dot de This script is intended to plot the 4 spectra of the arms of the HERMES spectrograph History: 181012 - SB created ``` try: %matplotlib inline %config InlineBackend.figure_for...
github_jupyter
<a id='Top'></a> # MultiSurv results by cancer type<a class='tocSkip'></a> C-index value results for each cancer type of the best MultiSurv model trained on all-cancer data. ``` %load_ext autoreload %autoreload 2 %load_ext watermark import sys import os import numpy as np import pandas as pd import matplotlib imp...
github_jupyter
## **Initialize the connection** ``` import sqlalchemy, os from sqlalchemy import create_engine import pandas as pd import matplotlib import matplotlib.pyplot as plt %matplotlib inline %reload_ext sql %config SqlMagic.displaylimit = 5 %config SqlMagic.feedback = False %config SqlMagic.autopandas = True hxe_connect...
github_jupyter
# Preprocessing for numerical features In this notebook, we will still use only numerical features. We will introduce these new aspects: * an example of preprocessing, namely **scaling numerical variables**; * using a scikit-learn **pipeline** to chain preprocessing and model training; * assessing the generalizati...
github_jupyter
Notebook - análise exploratória de dados Gabriela Caesar 29/set/2021 Pergunta a ser respondida - Defina a sua UF e o ano no input e veja as estatísticas básicas da sua UF/ano quanto ao casamento LGBT ``` # importacao da biblioteca import pandas as pd # leitura do dataframe lgbt_casamento = pd.read_csv('https://raw...
github_jupyter
# `model_hod` module tutorial notebook ``` %load_ext autoreload %autoreload 2 %pylab inline import logging mpl_logger = logging.getLogger('matplotlib') mpl_logger.setLevel(logging.WARNING) pil_logger = logging.getLogger('PIL') plt.rcParams['font.family'] = 'sans-serif' plt.rcParams['font.size'] = 18 plt.rcParams['a...
github_jupyter
# Premier league: How has VAR impacted the rankings? There has been much debate about the video assistant referee (VAR) when it was introduced last year (in 2019). The goal is to lead to fairer refereeing, but concerns are high on whether this will really be the case and the fact that it could break the rythm of the g...
github_jupyter
``` #v1 #26/10/2018 dataname="epistroma" #should match the value used to train the network, will be used to load the appropirate model gpuid=0 patch_size=256 #should match the value used to train the network batch_size=1 #nicer to have a single batch so that we can iterately view the output, while not consuming too...
github_jupyter
# CirComPara Pipeline To demonstrate Dugong ́s effectiveness to distribute and run bioinformatics tools in alternative computational environments, the CirComPara pipeline was implemented in a Dugong container and tested in different OS with the aid of virtual machines (VM) or cloud computing servers. CirComPara is a ...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Generic Integration With Credo AI's Governance App Lens is primarily a framework for comprehensive assessment of AI models. However, in addition, it is the primary way to integrate assessment analysis with Credo AI's Governance App. In this tutorial, we will take a model created and assessed _completely independen...
github_jupyter
# Supercritical Steam Cycle Example This example uses Jupyter Lab or Jupyter notebook, and demonstrates a supercritical pulverized coal (SCPC) steam cycle model. See the ```supercritical_steam_cycle.py``` to see more information on how to assemble a power plant model flowsheet. Code comments in that file will guide y...
github_jupyter
# A canonical asset pricing job Let's estimate, for each firm, for each year, the alpha, beta, and size and value loadings. So we want a dataset that looks like this: | Firm | Year | alpha | beta | | --- | --- | --- | --- | | GM | 2000 | 0.01 | 1.04 | | GM | 2001 | -0.005 | 0.98 | ...but it will do this for every ...
github_jupyter
# NYC PLUTO Data and Noise Complaints Investigating how PLUTO data and zoning characteristics impact spatial, temporal and types of noise complaints through out New York City. Specifically looking at noise complaints that are handled by NYC's Department of Environmental Protection (DEP). All work performed by Zoe Mar...
github_jupyter
``` import time import pandas as pd import requests import json5 import matplotlib.pyplot as plt ``` # Loading national data ``` df_nat = pd.read_csv("../Data/Employment_Projections.csv").sort_values('Employment 2030',ascending=False) ``` # Loading CA data ``` df_CA = pd.read_csv("../Data/CA_Long_Term_Occupational_...
github_jupyter
``` """ Overriding descriptor (a.k.a. data descriptor or enforced descriptor): # BEGIN DESCR_KINDS_DEMO1 >>> obj = Managed() # <1> >>> obj.over # <2> -> Overriding.__get__(<Overriding object>, <Managed object>, <class Managed>) >>> Managed.over # <3> -> Overriding.__get__(<Overriding object>, N...
github_jupyter
<div class="alert alert-block alert-info" style="margin-top: 20px"> <a href="https://cocl.us/PY0101EN_edx_add_top"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/PY0101EN/Ad/TopAd.png" width="750" align="center"> </a> </div> <a href="https://cognitiveclass....
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Natural-Language-Pre-Processing" data-toc-modified-id="Natural-Language-Pre-Processing-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Natural Language Pre-Processing</a></span></li><li><span><a href="#Ob...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Make spectral libraries ``` import sys, os sys.path.append('/Users/simon/git/vimms') sys.path.insert(0,'/Users/simon/git/mass-spec-utils/') from vimms.Common import save_obj from tqdm import tqdm %load_ext autoreload %autoreload 2 library_cache = '/Users/simon/clms_er/library_cache' ``` ## Massbank ``` from mass_s...
github_jupyter
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) # Particle Filters ``` #format the book %matplotlib notebook from __future__ import division, print_function from book_format import load_style load_style() ``` ## Motivation Here...
github_jupyter
## Desafio Final 1 Bootcamp Analista de Machine Learning @ IGTI **Objetivos**: * Pré-processamento dos dados. * Detecção de anomalias * Processamento dos dados. * Correlações. * Redução da dimensionalidade. * Algoritmos supervisionados e não supervisionados **Análise com:** * Redução de dimensionalida...
github_jupyter
``` import pandas as pd import numpy as np import os, glob import pandas as pd import numpy as np %matplotlib inline #%matplotlib notebook import seaborn as sns sns.reset_orig() import matplotlib.pyplot as plt from datetime import datetime, timedelta import pdb import requests import sys from importlib import reload...
github_jupyter
I quote myself from the last post: > The number of tests and the probability to obtain at least one significant result increases with the number of variables (plus interactions) included in the Anova. According to Maxwell (2004) this may be a reason for prevalence of underpowered Anova studies. Researchers target some...
github_jupyter
# Fine-tuning and deploying ProtBert Model for Protein Classification using Amazon SageMaker ## Contents 1. [Motivation](#Motivation) 2. [What is ProtBert?](#What-is-ProtBert?) 3. [Notebook Overview](#Notebook-Overview) - [Setup](#Setup) 4. [Dataset](#Dataset) - [Download Data](#Download-Data) 5. [Data Explora...
github_jupyter
# The Autodiff Cookbook [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/jax/blob/master/docs/notebooks/autodiff_cookbook.ipynb) *alexbw@, mattjj@* JAX has a pretty general automatic differentiation system. In this notebook, we'll go throug...
github_jupyter
<a href="https://colab.research.google.com/github/airctic/icevision-gradio/blob/master/IceApp_pets.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # IceVision Deployment App Example: PETS Dataset This example uses Faster RCNN trained weights using t...
github_jupyter
To participate, you'll need to git clone (or download the .zip from GitHub): https://github.com/mbeyeler/2018-neurohack-skimage You can do that in git using: git clone https://github.com/mbeyeler/2018-neurohack-skimage If you have already cloned the material, please issue `git pull` now and reload the notebook ...
github_jupyter
# Amazon SageMaker Multi-Model Endpoints using XGBoost With [Amazon SageMaker multi-model endpoints](https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html), customers can create an endpoint that seamlessly hosts up to thousands of models. These endpoints are well suited to use cases where any one o...
github_jupyter
If not explicitly mentioned otherwise we assume: - RCP2.6 scenario or the lowest ppm concentration reported (stabilized around 400-420) - Linear phase-out of fossil fuels from model start time (2000-2015) by 2100 - BAU scenario would lead to RCP6 or higher - as it is widely accepcted that in order to obtain RCP2.6, emi...
github_jupyter
``` import xarray as xr import xroms import pandas as pd import numpy as np import matplotlib.pyplot as plt import cmocean.cm as cmo import cartopy ``` # How to select data The [load_data](load_data.ipynb) notebook demonstrates how to load in data, but now how to select out parts of it? ### Load in data More inform...
github_jupyter
## Viscous Inverse Design This notebook demonstrates the use of gradients from viiflow for fully viscous inverse design. It defines a target pressure distribution from one airfoil and, coming from another airfoil, tries to find the shape necessary to arrive at this target pressure. It uses virtual displacements, which ...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Solution Notebook ## Problem: Given two 16 bit numbers, n and m, and two indices i, j, insert m into n such that m starts at bit j and e...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
**About this challenge** To assess the impact of climate change on Earth's flora and fauna, it is vital to quantify how human activities such as logging, mining, and agriculture are impacting our protected natural areas. Researchers in Mexico have created the VIGIA project, which aims to build a system for autonomous ...
github_jupyter
#### SageMaker Pipelines Tuning Step This notebook illustrates how a Hyperparameter Tuning Job can be run as a step in a SageMaker Pipeline. The steps in this pipeline include - * Preprocessing the abalone dataset * Running a Hyperparameter Tuning job * Creating the 2 best models * Evaluating the performance of the ...
github_jupyter
# Ensembles ``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import mean_absolute_error, mean_squared_error from sklearn.linear_model import LinearRegression from sklearn.tree import DecisionTreeRegressor sns.set_theme() rng = np.random.default_rng(42) x = rng.uniform...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
``` %matplotlib inline import lsqfit from model_avg_paper import * from model_avg_paper.test_tmin import test_vary_tmin_SE p0_test_ME = { 'A0': 2.0, 'E0': 0.8, 'A1': 10.4, 'E1': 1.16, } Nt = 32 noise_params = { 'noise_amp': 0.3, 'noise_samples': 500, 'frac_noise': True, 'cross_val': Fal...
github_jupyter
### Classes Finally we get to classes. I assume you already have some knowledge of classes and OOP in general, so I'll focus on the semantics of creating classes and some of the differences with Java classes. First, the question of visibility. There is no such thing as private or public in Python. Everything is publ...
github_jupyter
``` import argparse from collections import namedtuple, OrderedDict import itertools import os import numpy as np from typing import Tuple from typing import List from typing import Dict import random from itertools import product import copy import re import random import hashlib import pathlib import json import matp...
github_jupyter
``` import gym import numpy as np import math ``` Description: There are four designated locations in the grid world indicated by R(ed), G(reen), Y(ellow), and B(lue). When the episode starts, the taxi starts off at a random square and the passenger is at a random location. The taxi drives to the passenger's locat...
github_jupyter
<h1><center>DBSCAN: A macroscopic investigation in Python</center></h1><br> Cluster analysis is an important problem in data analysis. Data scientists use clustering to identify malfunctioning servers, group genes with similar expression patterns, or various other applications. Briefly, clustering is the task of group...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from PIL import Image from IPython.display import Image as im %matplotlib inline data = pd.read_csv("../data/StockX-Data-Consolidated.csv") data['week_since_release'] = (data['Days Since Release']/7).round(1) data.columns[2...
github_jupyter
# EDA classification aim: When will a project succeed? Which features influence the success of a project? #### assumptions * the higher the goal, the lower the probability for success * the longer the duration the higher the probability for success * the longer the preparation time the higher the probability for ...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # AutoML 06: Custom CV Splits and Handling Sparse Data In this example we use the scikit-learn's [20newsgroup](http://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_20newsgroups.html) to showcase how you can u...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Mathematics/TellingTime/telling-time.ip...
github_jupyter
``` import os import sys import math import json import torch import numpy as np import scipy.io from scipy import ndimage import matplotlib # from skimage import io # matplotlib.use("pgf") matplotlib.rcParams.update({ # 'font.family': 'serif', 'font.size':10, }) from matplotlib import pyplot as plt import py...
github_jupyter
``` import zarr from pyprojroot import here import pandas as pd import numpy as np import allel import yaml import matplotlib.pyplot as plt import functools import seaborn as sns sns.set_context('paper') sns.set_style('darkgrid') import dask.array as da import scipy.interpolate import scipy.stats import petl as etl imp...
github_jupyter
<h1> <b>Homework 1</b></h1> <i>Alejandro J. Rojas<br> ale@ischool.berkeley.edu<br> W261: Machine Learning at Scale<br> Week: 01<br> Jan 21, 2016</i></li> <h2>HW1.0.0.</h2> Define big data. Provide an example of a big data problem in your domain of expertise. The term big data is asoociated to datasets that cannot be ...
github_jupyter
# Section 1: Preprocessing ## Behavior Analysis ### Generate trial regressors ``` import os import numpy as np from pandas import concat, read_csv from scipy.stats import gamma def normalize(arr): return (arr - arr.min()) / (arr.max() - arr.min()) root_dir = '/space/sophia/2/users/EMOTE-DBS/afMSIT/behavior' subjects ...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# Image Classification with Logistic Regression from Scratch with NumPy Welcome to another jupyter notebook of implementing machine learning algorithms from scratch using only NumPy. This time we will be implementing a different version of logistic regression for a simple image classification task. I've already done a...
github_jupyter
# Инициализация ``` #@markdown - **Монтирование GoogleDrive** from google.colab import drive drive.mount('GoogleDrive') # #@markdown - **Размонтирование** # !fusermount -u GoogleDrive ``` # Область кодов ``` #@title Приближение с помощью кривых { display-mode: "both" } # Curve fitting # В программе реализовано приб...
github_jupyter
# Machine Learning application: Forecasting wind power. Using alternative energy for social & enviromental Good <table> <tr><td> <img src="https://github.com/dmatrix/mlflow-workshop-part-3/raw/master/images/wind_farm.jpg" alt="Keras NN Model as Logistic regression" width="800"> </td></tr> </table> I...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@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 ...
github_jupyter
# TOC 1. [Settings](#Settings) 2. [Get the task list](#Get-the-task-list) 3. [Upload annotations](#Upload-annotations) 4. [Get annotation results](#Get-annotation-results) 5. [Get annotation detail log](#Get-annotation-detail-log) # Settings ``` import init import pandas as pd import json import requests host = 'http...
github_jupyter
# Real-world use-cases at scale! # Imports Let's start with imports. ``` import sys sys.path.append("gpu_bdb_runner.egg") import gpu_bdb_runner as gpubdb import os import inspect from highlight_code import print_code config_options = {} config_options['JOIN_PARTITION_SIZE_THRESHOLD'] = os.environ.get("JOIN_PARTITION...
github_jupyter
``` import time notebookstart= time.time() import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import os import gc # Models Packages from sklearn import metrics from sklearn.metrics import mean_squared_error from sklearn import feature_selection from sklearn.model_...
github_jupyter
``` %pylab inline import sys import numpy as np import tensorflow as tf import tensorflow_probability as tfp import arviz as az import matplotlib.pyplot as plt from matplotlib import rcParams import matplotlib.font_manager as fm rcParams['font.family'] = 'sans-serif' sys.path.append('../') from mederrata_spmf impor...
github_jupyter
Final models with hyperparameters tuned for Logistics Regression and XGBoost with all features. ``` #Import the libraries import pandas as pd import numpy as np from tqdm import tqdm from sklearn import linear_model, metrics, preprocessing, model_selection from sklearn.preprocessing import StandardScaler import xgboo...
github_jupyter
Imaging you are a metal toy producer and wan't to package your product automaticaly. In this case it would be nice to categorise your products without much effort. In this example we use a pretrained model ('Xception' with 'imagenet' dataset). ## Import dependencies ``` import warnings warnings.filterwarnings('ignor...
github_jupyter
``` import torch import sim_data_gen import numpy as np import dr_crn import matplotlib.pyplot as plt n_feat = 5 def get_mmd(x_train): feat = x_train[:, :n_feat] causes = x_train[:, n_feat:] cause_ind = sim_data_gen.cause_to_num(causes) uniques, counts = np.unique(cause_ind, return_counts=True) uniq...
github_jupyter
<center><img alt="" src="images/Cover_EDA.jpg"/></center> ## <center><font color="blue">EDA-04: Unsupervised Learning - Clustering Bagian ke-02</font></center> <h2 style="text-align: center;">(C) Taufik Sutanto - 2020</h2> <h2 style="text-align: center;">tau-data Indonesia ~ <a href="https://tau-data.id/eda-04/" tar...
github_jupyter
<h1 align="center">TensorFlow Deep Neural Network Lab</h1> <img src="image/notmnist.png"> In this lab, you'll use all the tools you learned from the *Deep Neural Networks* lesson to label images of English letters! The data you are using, <a href="http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html">notMNIST<...
github_jupyter
# Day and Night Image Classifier --- The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images. We'd like to build a classifier that can accurately label these images as day or night, and that relies on f...
github_jupyter
# Components of StyleGAN ### Goals In this notebook, you're going to implement various components of StyleGAN, including the truncation trick, the mapping layer, noise injection, adaptive instance normalization (AdaIN), and progressive growing. ### Learning Objectives 1. Understand the components of StyleGAN that...
github_jupyter
``` from mxnet import nd def pure_batch_norm(X, gamma, beta, eps=1e-5): assert len(X.shape) in (2, 4) # 全连接: batch_size x feature if len(X.shape) == 2: # 每个输入维度在样本上的平均和方差 mean = X.mean(axis=0) variance = ((X - mean)**2).mean(axis=0) # 2D卷积: batch_size x channel x height x width ...
github_jupyter
<a href="https://colab.research.google.com/github/wguesdon/BrainPost_google_analytics/blob/master/Report_v01_02.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Project Presentation ## About BrainPost Kasey Hemington runs BrainPost with a fellow ...
github_jupyter
Exercise 4 - Polynomial Regression ======== Sometimes our data doesn't have a linear relationship, but we still want to predict an outcome. Suppose we want to predict how satisfied people might be with a piece of fruit, we would expect satisfaction would be low if the fruit was under ripened or over ripened. Satisfac...
github_jupyter
# Building a Classifier from Lending Club Data **An end-to-end machine learning example using Pandas and Scikit-Learn** ## Data Ingestion ``` %matplotlib inline import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pandas.tools.plotting import scatter_matrix ...
github_jupyter
# Regularization Welcome to the second assignment of this week. Deep Learning models have so much flexibility and capacity that **overfitting can be a serious problem**, if the training dataset is not big enough. Sure it does well on the training set, but the learned network **doesn't generalize to new examples** that...
github_jupyter
## Yield Data ``` import pandas as pd import numpy as np import altair as alt import os pwd vegetables = pd.read_csv('MichiganVegetableData.csv') commodity_list1 = vegetables['Commodity'].unique().tolist() for commodity in commodity_list1: commoditydf = vegetables[vegetables['Commodity'] == commodity] mi_commo...
github_jupyter
# DiscreteDP Example: Water Management **Daisuke Oyama** *Faculty of Economics, University of Tokyo* From Miranda and Fackler, <i>Applied Computational Economics and Finance</i>, 2002, Section 7.6.5 ``` %matplotlib inline import itertools import numpy as np from scipy import sparse import matplotlib.pyplot as plt f...
github_jupyter
# Setup IAM for Kinesis ``` import boto3 import sagemaker import pandas as pd sess = sagemaker.Session() bucket = sess.default_bucket() role = sagemaker.get_execution_role() region = boto3.Session().region_name sts = boto3.Session().client(service_name="sts", region_name=region) iam = boto3.Session().client(service_...
github_jupyter
# Plot unit conversions This notebook demonstrates some examples of different kinds of units, and the circumstances under which they are converted and displayed. ``` %matplotlib inline import sys import atomica as at import matplotlib.pyplot as plt import numpy as np import sciris as sc from IPython.display import di...
github_jupyter
# Using the model and best-fit parameters from CenQue, we measure the following values: The "true" SF fraction $$f_{True SF}(\mathcal{M}_*)$$ The "true" SF SMF $$\Phi_{True SF}(\mathcal{M}_*)$$ ``` import numpy as np import pickle import util as UT import observables as Obvs from scipy.interpolate import interp1d # ...
github_jupyter
``` import os import random import math import time import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.keras.optimizers import Adam from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense, Conv1D, MaxPooling1D, Flatten, concatenate, Conv2D, MaxPooling2D...
github_jupyter
# What _projects_ am I a member of? ### Overview There are a number of API calls related to projects. Here we focus on listing projects. As with any **list**-type call, we will get minimal information about each project. There are two versions of this call: 1. (default) **paginated** call that will return 50 projects...
github_jupyter
``` import numpy as np import pprint import sys if "../" not in sys.path: sys.path.append("../") from lib.envs.gridworld import GridworldEnv pp = pprint.PrettyPrinter(indent=2) env = GridworldEnv() def value_iteration(env, theta=0.0001, discount_factor=1.0): """ Value Iteration Algorithm. Args: ...
github_jupyter
#### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/). <br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-fo...
github_jupyter
# Asymmetric Loss This documentation is based on the paper "[Asymmetric Loss For Multi-Label Classification](https://arxiv.org/abs/2009.14119)". ## Asymetric Single-Label Loss ``` import timm import torch import torch.nn.functional as F from timm.loss import AsymmetricLossMultiLabel, AsymmetricLossSingleLabel import...
github_jupyter
# 0. Dependências ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA %matplotlib inline pd.options.display.max_rows = 10 ``` # 1. Introdução **O objetivo principal do...
github_jupyter
## Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. ### Example 1: Input: a = "11", b = "1" Output: "100" ### Example 2: Input: a = "1010", b = "1011" Output: "10101" ``` def add_binary(a,b): return '{0:b}'.format(int(a...
github_jupyter
# Chapter 3: Dynamic Programming ## 1. Exercise 4.1 $\pi$ is equiprobable random policy, so all actions equally likely. - $q_\pi(11, down)$ With current state $s=11$ and action $a=down$, we have next is the terminal state $s'=end$, which have reward $R'=0$ $$ \begin{aligned} q_\pi(11, down) &= \sum_{s',r}p(s',r | s...
github_jupyter
# Predictions with Pyro + GPyTorch (High-Level Interface) ## Overview In this example, we will give an overview of the high-level Pyro-GPyTorch integration - designed for predictive models. This will introduce you to the key GPyTorch objects that play with Pyro. Here are the key benefits of the integration: **Pyro ...
github_jupyter
# Exercise 1: Schema on Read ``` from pyspark.sql import SparkSession import pandas as pd import matplotlib spark = SparkSession.builder.getOrCreate() dfLog = spark.read.text("data/NASA_access_log_Jul95.gz") ``` # Load the dataset ``` #Data Source: http://ita.ee.lbl.gov/traces/NASA_access_log_Jul95.gz dfLog = spark....
github_jupyter