text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Statistics review 3: Hypothesis testing and P values R code accompanying [paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC137449/pdf/cc1493.pdf) ## Key learning points - A P value is the probability that an observed effect is simply due to chance; it therefore provides a measure of the strength of an associati...
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
# California housing dataset with linear and polynomial regression In this notebook, we'll use [linear regression](https://scikit-learn.org/stable/modules/linear_model.html#ordinary-least-squares), [regularized linear regression](https://scikit-learn.org/stable/modules/linear_model.html#ridge-regression), and [polyno...
github_jupyter
# Preparing a computer vision training set for labeling photos This notebook covers the steps involved in preparing a labeled dataset of images derived from the Newspaper Navigator dataset. Specifically this training set is primarily intended for use in a Programming Historian lesson on computer vision. ## Aims Th...
github_jupyter
# Xarray-spatial ### User Guide: Focal #### Use datashader to render our images... To get started, we'll import numpy and xarray-spatial, along with datashader and a set of its functions to help us quickly render images. ``` import numpy as np import datashader as ds from datashader.transfer_functions import shade fr...
github_jupyter
# Astronomy 8824 - Numerical and Statistical Methods in Astrophysics ## Introduction to Clustering These notes are for the course Astronomy 8824: Numerical and Statistical Methods in Astrophysics and were written by Paul Martini. #### Background reading: - Statistics, Data Mining, and Machine Learning in Astronomy...
github_jupyter
# Bagging元估计器 `Bagging`是`Bootstrap Aggregating`的简称,意思就是再取样(`Bootstrap`)然后在每个样本上训练出来的模型进行集成. 通常如果目标是分类,则集成的方式是投票;如果目标是回归,则集成方式是取平均. 在集成算法中,`bagging`方法会在原始训练集的随机子集上构建一类黑盒估计器的多个实例,然后把这些估计器的预测结果结合起来形成最终的预测结果. 该方法通过在训练模型的过程中引入随机性,来减少基估计器的方差(例如,决策树).在多数情况下,`bagging`方法提供了一种非常简单的方式来对单一模型进行改进,而无需修改背后的算法.因为`bagging`方法可以减小过拟...
github_jupyter
<a href="https://www.bigdatauniversity.com"><img src="https://ibm.box.com/shared/static/cw2c7r3o20w9zn8gkecaeyjhgw3xdgbj.png" width="400" align="center"></a> <h1 align=center><font size="5"> SVM (Support Vector Machines)</font></h1> In this notebook, you will use SVM (Support Vector Machines) to build and train a mod...
github_jupyter
##### Copyright 2020 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
<h1> Training on Cloud ML Engine </h1> This notebook illustrates distributed training and hyperparameter tuning on Cloud ML Engine. ``` # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKET os.environ[...
github_jupyter
# Explore UK Crime Data with Pandas and GeoPandas ## Table of Contents 1. [London boroughs](#boroughs)<br> 2. [Crime data](#crime)<br> 2.1. [Load data](#load2)<br> 2.2. [Explore data](#explore2)<br> <div class="alert alert-danger" style="font-size:100%"> When you are using <b>Watson Studio</b> to run the wo...
github_jupyter
# Hybrid Monte Carlo ## Payoff Scripting In this notebook we demonstrate the setup and use of *Payoff* objects. This is structured along the following steps: 1. Specifying and using basic payoffs 2. Combining basic payoffs to form complex payoff structures 3. Simulate future payoffs with Monte Carlo 4. S...
github_jupyter
# TV Script Generation In this project, you'll generate your own [Seinfeld](https://en.wikipedia.org/wiki/Seinfeld) TV scripts using RNNs. You'll be using part of the [Seinfeld dataset](https://www.kaggle.com/thec03u5/seinfeld-chronicles#scripts.csv) of scripts from 9 seasons. The Neural Network you'll build will ge...
github_jupyter
## Visual Comparison Between Different Classification Methods in Shogun Notebook by Youssef Emad El-Din (Github ID: <a href="https://github.com/youssef-emad/">youssef-emad</a>) This notebook demonstrates different classification methods in Shogun. The point is to compare and visualize the decision boundaries of diffe...
github_jupyter
# RESULTS OF THE SET OF SIMULATIONS ## Loading results ``` %matplotlib notebook import numpy as np from scipy import stats import matplotlib.pyplot as plt from thermalspin.data_analysis import * # Insert here the name of the simulation set setname = "heisenberg_2D" final_state_lst, L_lst, t_lst, J_lst, h_lst, T...
github_jupyter
# 1. Imports ``` import sqlite3 ``` # 2. Connect to the database ``` # connect conn = sqlite3.connect('../../data/minority-state-owned-ases/sqlite/minority_state_owned_ases.sqlite') # create a cursos cur = conn.cursor() ``` # 3. Get insights of the dataset ## 3.1 Example of organizations table Table schema - ```t...
github_jupyter
``` import keras keras.__version__ ``` # Advanced usage of recurrent neural networks >#### This notebook contains the code samples found in Chapter 6, Section 3 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python?a_aid=keras&a_bid=76564dff). Note that the original text features far ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Name" data-toc-modified-id="Name-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Name</a></span></li><li><span><a href="#Search" data-toc-modified-id="Search-2"><span class="toc-i...
github_jupyter
# Imports ``` import os import h5py import time import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from PIL import Image from IPython import display from __future__ import division from __future__ import print_function from __future__ import absolute_import from sklearn import metrics, manifold...
github_jupyter
# Keras mnist LeNet-5 v2 **此项目为测试修改版的LeNet-5,并且使用图像增强,调节学习率, 使用BatchNormal** - 目前能在测试集上达到$0.9952$的准确率 ``` %matplotlib inline import os import PIL import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf import keras from IPython import display from functools import...
github_jupyter
# Notes ## selection of variable ### Principal Variables iterative search of variables that covariates more with Y response vector. After the first PV is found, the matrix is reduced to find the next one. KW: supervised methods Nørgaard, L., Saudland, A., Wagner, J., Nielsen, J. P., Munck, L., & Engelsen, S. B. (2...
github_jupyter
<a href="https://colab.research.google.com/github/mrdbourke/pytorch-resnet-twitch/blob/main/resnet50_twitch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !nvidia-smi !pip install torchinfo import torchinfo import os import torch import torchv...
github_jupyter
``` from matplotlib import pyplot as plt from sklearn.preprocessing import LabelEncoder, OneHotEncoder from sklearn.model_selection import train_test_split from keras.preprocessing.text import Tokenizer from keras.models import Sequential from keras.layers import Dense, Activation, Embedding, TimeDistributed, Bidirecti...
github_jupyter
# Robustness in Regulatory Networks ## A tutorial for BoolNet and BoolNetPerturb * [Introduction](#Introduction) * [Robustness and plasticity in biological systems](#Robustness-and-plasticity-in-biological-systems) * [Regulatory Networks](#Regulatory Networks) * [Biological system: Th17/iTreg network](#Bio...
github_jupyter
# Load/save and structure data Let's first take a quick survey on the Inaugural assignment process, found [here](https://forms.office.com/Pages/ResponsePage.aspx?id=kX-So6HNlkaviYyfHO_6kckJrnVYqJlJgGf8Jm3FvY9UMEZTODYyVjJWSFBPNTVRMzBMQzFYOE5JQiQlQCN0PWcu). You will learn to **load and save data** both to and from offl...
github_jupyter
# Introduction to Programming with Python # Unit 5: Nested Loops Let us start with revisiting the exercise from the last unit. We needed to: 1. Write a function `fact` that will calculate a factorial $n!=1\cdot2\cdot\dots\cdot n$ 2. Print a table of factorials from 1 to 7 Let's start with a function: ``` def fact(...
github_jupyter
Водопьян А.О. Хабибуллин Р.А. 2019 г. ## Газосодержание <a id="Rs"></a> ### Газосодержание, корреляция Стендинга <a id="Rs_Standing"></a> Для расчета газосодержания используется корреляция, обратная корреляции Стендинга для давления насыщения нефти газом. $$ R_s = \gamma_g \left( \frac{1.92 p}{\ 10^{y_g}}\right)...
github_jupyter
# What permutation tests to do? I need to work out what permutation tests to do. There are several ways we can compare X:A or Y:A or 4:A. These data are challenging because at the individual gene cell level the data are very sparse. One solution to this problem is to aggregate data to the cell type level. Unfortunat...
github_jupyter
# Import Libraries ``` import numpy as np import pandas as pd ``` # Import Data ``` # Import data. loan_data_preprocessed_backup = pd.read_csv('loan_data_2007_2014_preprocessed.csv') ``` # Explore Data ``` loan_data_preprocessed = loan_data_preprocessed_backup.copy() loan_data_preprocessed.columns.values # Display...
github_jupyter
``` #练习 1:求n个随机整数均值的平方根,整数范围在m与k之间。 import random,math m = int(input('please input a smaller number ')) k = int(input('please input a bigger number ')) n = int(input('please input a number for times ')) i = 1 total = 0 avg = 0 num = random.randint(m,k) print ('num0:',num) total += num while i < n : num ...
github_jupyter
# Copying Task Inspired on the task described in the following paper: [https://arxiv.org/pdf/1511.06464.pdf](https://arxiv.org/pdf/1511.06464.pdf) ## Introduction The copying task is one of the simplest benchmark tasks for recurrent neural networks. The general idea of the task is to reproduce a random sequence of s...
github_jupyter
``` #Necessary libraries import numpy as np import pandas as pd import graphviz import numexpr import itertools from subprocess import call from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifier from sklearn import tree from sklearn.metrics import fbeta_score from sklearn....
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline data = pd.read_csv('pokemon.csv') data.info() data.head(10) #correlation map f,ax = plt.subplots(figsize=(18, 18)) sns.heatmap(data.corr(), annot=True, linewidths=.5, fmt= '.1f',ax=ax) ``` ## Matplotlib...
github_jupyter
# Fully-Connected Neural Nets In the previous homework you implemented a fully-connected two-layer neural network on CIFAR-10. The implementation was simple but not very modular since the loss and gradient were computed in a single monolithic function. This is manageable for a simple two-layer network, but would become...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' from albert import modeling from albert import optimization from albert import tokenization import tensorflow as tf import numpy as np tokenizer = tokenization.FullTokenizer( vocab_file='albert-base-2020-04-10/sp10m.cased.v10.vocab', do_lower_case=False, ...
github_jupyter
## K2-24 Fitting & MCMC Using the K2-24 (EPIC-203771098) dataset, we demonstrate how to use the radvel API to: - perform a max-likelihood fit - do an MCMC exploration of the posterior space - plot the results ### Circular Orbits Perform some preliminary imports: ``` %matplotlib inline import os import matplotlib ...
github_jupyter
##### Copyright 2021 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
# Cart-pole Balancing Model with Amazon SageMaker and Ray --- ## Introduction In this notebook we'll start from the cart-pole balancing problem, where a pole is attached by an un-actuated joint to a cart, moving along a frictionless track. Instead of applying control theory to solve the problem, this example shows ho...
github_jupyter
``` ### This Notebook is intented to build a trainer ### using GPT2 and CNN daily mail !nvidia-smi import sys sys.path.append("/home/USER/TF_NEW/tf-transformers/src/") import tensorflow as tf import tqdm import time import functools import os from hydra import initialize, initialize_config_module, initialize_config_di...
github_jupyter
##### Copyright 2020 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
[source](../../api/alibi_detect.cd.cvm.rst) # Cramér-von Mises ## Overview The CVM drift detector is a non-parametric drift detector, which applies feature-wise two-sample [Cramér-von Mises](https://en.wikipedia.org/wiki/Cram%C3%A9r%E2%80%93von_Mises_criterion) (CVM) tests. For two empirical distributions $F(z)$ and...
github_jupyter
# E(n)-Equivariant Steerable CNNs - Hands-on tutorial We start by importing the necessary packages. The user typically only needs to interact with the high level functionalities provided in the subpackages `escnn.gspaces` and `escnn.nn`. ``` import torch from escnn import gspaces from escnn import nn import numpy...
github_jupyter
<img align="centre" src="../../Supplementary_data/dea_logo_wide.jpg" width="100%"> # Scalable Supervised Machine Learning on the Open Data Cube * **Prerequisites:** This notebook series assumes some familiarity with machine learning, statistical concepts, and python programming. Beginners should consider working thro...
github_jupyter
<div class="clearfix" style="padding: 10px; padding-left: 0px"> <img src="../resources/img/softbutterfly-logo.png" class="pull-left" style="display: block; height: 40px; margin: 0;"><img src="../resources/img/jupyter-logo.png" class="pull-right" style="display: block; height: 20px; margin-top: 10px;"> </div> <h1> Cur...
github_jupyter
# Machine learning with SPARK in SQL Server 2019 Big Data Cluster Spark in Unified Big data compute engine that enables big data processing, Machine learning and AI Key Spark advantages are 1. Distributed compute enging 2. Choice of langauge (Python, R, Scala, Java) 3. Single engine for Batch and Streaming job...
github_jupyter
# Implementing CEA calculations using Cantera ``` # this line makes figures interactive in Jupyter notebooks %matplotlib inline from matplotlib import pyplot as plt import numpy as np import cantera as ct from pint import UnitRegistry ureg = UnitRegistry() Q_ = ureg.Quantity # for convenience: def to_si(quant): ...
github_jupyter
# Bayesian Neural Network (VI) for regression ### Zhenwen Dai (2018-8-21) ``` # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License i...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline #plt.show() is used when not using Jupyter import numpy as np x = np.linspace(0,5,11) y = x ** 2 x y # Functional Method and then Object Oriented Method # FUNCTIONAL plt.plot(x, y, 'ro') #plt.show() plt.plot(x, y) plt.xlabel('X Label') plt.ylabel('Y Label') plt.tit...
github_jupyter
# Movie Recommendations Recommendations are a common machine learning task widely used by many leading companies, such as Netflix, Amazon, and YouTube. If you have used any of these online services, you are familiar with recommendations that are often prefixed with "You might also like.." or "Recommended items other c...
github_jupyter
# 13-Testing ``` from scipy import * def bisect(f, a, b, tol=1.e-8): """ Implementation of the bisection algorithm f real valued function a,b interval boundaries (float) with the property f(a) * f(b) <= 0 tol tolerance (float) """ if f(a) * f(b)> 0: raise ValueError("Incorrect...
github_jupyter
# Data exploration Questions to ask: 1. How do values distribute for the main variable *search_interest*? 1. What are keywords with high search interest? 2. What is the average search interest ... 1. for a keyword? 1. for a keyword that has at least 1 entry > 0? 1. for a keyword that has at least 1 entr...
github_jupyter
``` #hide #skip ! [ -e /content ] && pip install -Uqq mrl-pypi # upgrade mrl on colab # default_exp train.buffer ``` # Buffer > Callbacks for buffer ``` #hide from nbdev.showdoc import * %load_ext autoreload %autoreload 2 # export from mrl.imports import * from mrl.core import * from mrl.train.callback import * fr...
github_jupyter
# Setup Note that this notebook was developed with NodePy version 0.7. ``` import numpy as np import matplotlib.pyplot as plt from nodepy import rk, stability_function rk4 = rk.loadRKM('RK44').__num__() rk4x2 = rk4*rk4 ssp2 = rk.loadRKM('SSP22').__num__() ssp3 = rk.loadRKM('SSP33').__num__() ssp104 = rk.loadRKM('SSP...
github_jupyter
<a href="https://colab.research.google.com/github/facebookresearch/habitat-sim/blob/master/examples/tutorials/colabs/ECCV_2020_Interactivity.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Habitat-sim Interactivity This use-case driven tutorial co...
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
![qiskit_header.png](../../images/qiskit_header.png) # Circuit Rewriting using the Transpiler Previously we have performed basic operations on circuits, and ran those circuits on real quantum devices using the `execute` function. `execute` is a helper function that performs three tasks for the user: 1) Circuits are...
github_jupyter
# Quantization of Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. ## Spectral Shaping of the Quantization Noise The quantized signal $x_Q[k]$ can be expressed by the continuous amplitude signal $x[k]$ and the quantization error $e[...
github_jupyter
Code for generating results for the confounder-mediator graph (Figure 2(c) and Figure 3(c)). ``` import numpy import sympy import pandas import numpy as np import pandas as pd import sympy as sp import datetime import copy import attr import time import logging import itertools import pickle import sys import os impor...
github_jupyter
We will use the [CartPole-v1](https://gym.openai.com/envs/CartPole-v0/) OpenAI Gym environment. For reproducibility, let is fix a random seed. ``` import pytorch_lightning as pl from reagent.gym.envs.gym import Gym import pandas as pd from matplotlib import pyplot as plt import seaborn as sns import numpy as np import...
github_jupyter
# π Estimation with Monte Carlo methods We demonstrate how to run Monte Carlo simulations with lithops over IBM Cloud Functions. This notebook contains an example of estimation the number π with Monte Carlo. The goal of this notebook is to demonstrate how IBM Cloud Functions can benefit Monte Carlo simulations and not ...
github_jupyter
# Probabilistic Programming in Python using PyMC Authors: John Salvatier, Thomas V. Wiecki, Christopher Fonnesbeck ## Introduction Probabilistic programming (PP) allows flexible specification of Bayesian statistical models in code. PyMC3 is a new, open-source PP framework with an intutive and readable, yet powerful,...
github_jupyter
[this doc on github](https://github.com/dotnet/interactive/tree/master/samples/notebooks/csharp/Docs) # Variable Sharing .NET Interactive enables you to write code in multiple languages within a single notebook and in order to take advantage of those languages' different strengths, you might find it useful to share d...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/notebooks/vae_mnist_pytorch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # (Variational) autoencoders with CNNs on MNIST using PyTorch Based on https://github.com/pro...
github_jupyter
# Ensemble Combines predictions of several estimators ## Methods ### Averaging Method 1. Several estimators are built independently and then their predictions are averaged 1. Better because variance is reduced 1. Works best with strong & complex models 1. e.g. [Bagging Methods](http://scikit-learn.org/stable/modules...
github_jupyter
## Torch Core This module contains all the basic functions we need in other modules of the fastai library (split with [`core`](/core.html#core) that contains the ones not requiring pytorch). Its documentation can easily be skipped at a first read, unless you want to know what a given function does. ``` from fastai.im...
github_jupyter
**How to save this notebook to your personal Drive** To copy this notebook to your Google Drive, go to File and select "Save a copy in Drive", where it will automatically open the copy in a new tab for you to work in. This notebook will be saved into a folder on your personal Drive called "Colab Notebooks". Still stu...
github_jupyter
``` import numpy as np from plot_utils import read_Noise2Seg_results, fraction_to_abs, cm2inch from matplotlib import pyplot as plt plt.rc('text', usetex=True) ``` # Flywing n10: AP scores on validation data ``` alpha0_5_n10 = read_Noise2Seg_results('alpha0.5', 'flywing_n10', measure='AP', runs=[1,2,3,4,5], ...
github_jupyter
# Getting started: import required modules ``` ## Get dependencies ## import numpy as np import string import math import sys import pandas as pd import matplotlib.pyplot as plt import matplotlib import seaborn as sn from GIR import * import scipy as sp import pickle import time import scipy as sp from scipy import n...
github_jupyter
``` import random import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from PIL import Image from tensorflow.examples.tutorials.mnist import input_data from tensorflow.python.framework import ops ops.reset_default_graph() sess = tf.Session() mnist = input_data.read_data_sets("MNIST_data/", one_hot...
github_jupyter
<img src="https://www.microsoft.com/en-us/research/uploads/prod/2020/05/Attribution.png" width="400"> <h1 align="left">Multi-investment Attribution: Distinguish the Effects of Multiple Outreach Efforts</h1> A startup that sells software would like to know whether its multiple outreach efforts were successful in attra...
github_jupyter
# Statistical treatment for PASTIS <font color='red'>**This notebook is outdated as of 9 May 2021. Please use more recent notebooks for help.**</font> Getting into a full statistical treatment of the WFE requirements both mode-based as well as segmnet-based, using normal distributions and covariance matrices. 1. s...
github_jupyter
# Hyperparameter grid search NB the input data to the DNN is not normalised. Hyperparameter grid search adapted from Machine Learning Mastery https://machinelearningmastery.com/grid-search-hyperparameters-deep-learning-models-python-keras/ Using scikit-learn to grid search the batch size and epochs ``` import sys fro...
github_jupyter
## Colab Setup ``` # if you run this notebook in kaggle notebook or other platform, comment out the following codef from google.colab import drive drive.mount('/content/drive') ``` ## Config ``` root = '/content/drive/MyDrive/Colab Notebooks/g2net/' # set your root directory in your google drive. if you use Kaggle n...
github_jupyter
``` %matplotlib inline ``` Neural Networks =============== 使用torch.nn包来构建神经网络。 上一讲已经讲过了``autograd``,``nn``包依赖``autograd``包来定义模型并求导。 一个``nn.Module``包含各个层和一个``forward(input)``方法,该方法返回``output``。 例如: ![](https://pytorch.org/tutorials/_images/mnist.png) 它是一个简单的前馈神经网络,它接受一个输入,然后一层接着一层地传递,最后输出计算的结果。 神经网络的典型训练过程如下: ...
github_jupyter
The `Estimator` APIs are a high-level API in Tensorflow or say a high-level representation of a model. It is designed for easy scaling and asynchronous training. ``` !pip install tf-nightly import tensorflow as tf import pandas as pd print("Tensorflow Version: {}".format(tf.__version__)) print("Eager Model: {}".forma...
github_jupyter
# Neural Network (Multilayer Perceptron) Demo _Source: 🤖[Homemade Machine Learning](https://github.com/trekhleb/homemade-machine-learning) repository_ > ☝Before moving on with this demo you might want to take a look at: > - 📗[Math behind the Neural Networks](https://github.com/trekhleb/homemade-machine-learning/tre...
github_jupyter
``` import os import tensorflow as tf os.environ['CUDA_VISIBLE_DEVICES'] = '-1' if tf.test.gpu_device_name(): print('GPU found') else: print("No GPU found") from keras.datasets import reuters (train_data, train_labels),(test_data, test_labels) = reuters.load_data(num_words=10000) word_index = reuters.get_wor...
github_jupyter
(linalg_eigen)= # Eigenvalues and eigenvectors To introduce eigenvalues and eigenvectors, let us begin with an example of matrix-vector multiplication. Consider the following square matrix $A \in \mathbb{R}^{2 \times 2}$ multiplying a vector $\mathbf{u}$: $$ A \mathbf{u} = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix...
github_jupyter
<a href="https://colab.research.google.com/github/raqueeb/Intermediate-scikit-learn/blob/master/feature_pipeline.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## ফিচার ইঞ্জিনিয়ারিং এবং পাইপলাইন আমাদের আগের বইটাতে লিনিয়ার রিগ্রেশন নিয়ে বেশি ফোকাস ...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import Dataset, DataLoader fro...
github_jupyter
``` import pandas as pd import numpy as np customer_data_2017 = pd.read_csv("mod2017.csv",index_col = 0) customer_data_2018 = pd.read_csv("mod2018.csv",index_col = 0) customer_data_2019 = pd.read_csv("mod2019.csv",index_col = 0) customer_data = pd.read_csv("customer_data .csv") customer_data_2017.isnull().sum() custome...
github_jupyter
# Natural language processing ``` import numpy as np import pandas as pd from sklearn import model_selection as ms, feature_extraction as fe, ensemble from scipy.sparse import hstack import spacy from gensim.matutils import Sparse2Corpus from gensim.models import LdaModel, Word2Vec H2020_URL = 'http://cordis.europ...
github_jupyter
## Partial Dependence (PDP) and Individual Conditional Expectation (ICE) plots Partial Dependence Plot (PDP) and Individual Condition Expectation (ICE) are interpretation methods which describe the average behavior of a classification or regression model. They are particularly useful when the model developer wants to ...
github_jupyter
<a href="https://colab.research.google.com/github/lenyabloko/SemEval2020/blob/master/SemEval2020_Paraphraser.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> UPLOAD FILES - Place [train.csv](https://github.com/arielsho/Subtask-1/archive/master.zip) a...
github_jupyter
``` """ The MIT License (MIT) Copyright (c) 2021 NVIDIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
github_jupyter
# Imports ``` import sys import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.decomposition import PCA from sklearn.pipeline import make_pipeline from sklearn.preprocessing import MinMaxScaler from sklearn.externals import joblib import torch import torchvision import torchvisi...
github_jupyter
## Tutorial Outline **In this tutorial we will demonstrate how to:** 1. Use the new *Chempy* functions, which take the stellar birth-time as inputs 2. Create and train a neural network to emulate the *Chempy* with birth-time as a free parameter 3. Generate mock data-sets using *Chempy*. We will also describe the fi...
github_jupyter
# Bayesian Statistics From Scratch ## Building up to MCMC # Justin Bozonier ## Lead Data Scientist, GrubHub ### @databozo ### justin@bozonier.com ### http://www.databozo.com # GETTING STARTED ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline ``` * Probability and Bayes Theroem * Infinite Hyp...
github_jupyter
``` """ We use following lines because we are running on Google Colab If you are running notebook on a local computer, you don't need this cell """ from google.colab import drive drive.mount('/content/gdrive') import os os.chdir('/content/gdrive/My Drive/finch/tensorflow1/semantic_parsing/tree_slu/main') !pip install t...
github_jupyter
<table align="center"> <td align="center"><a target="_blank" href="http://introtodeeplearning.com"> <img src="http://introtodeeplearning.com/images/colab/mit.png" style="padding-bottom:5px;" /> Visit MIT Deep Learning</a></td> <td align="center"><a target="_blank" href="https://colab.research.google.c...
github_jupyter
### Legenda _**Definitie**_. Body. ⚠️ _**Eigenschap**_ bla. ## Gauss-eliminatie, echelon/rijgereduceerde vorm _**Rij-equivalent**_. Als een stelsel kan ontstaan door een opeenvolging van elementaire rijoperaties uit te voeren op een ander stelsel, dan zijn deze twee stelsels *rij-equivalent*. _**Gebonden/basis vari...
github_jupyter
``` # Load dependencies import pandas as pd import numpy as np from scipy.stats import gmean import sys sys.path.insert(0, '../../statistics_helper/') from excel_utils import * ``` # Estimating the biomass of Annelids To estimate the total biomass of annelids, we rely on data collected in a recent study by [Fierer et ...
github_jupyter
``` # Initialize Otter import otter grader = otter.Notebook("example.ipynb") import matplotlib.pyplot as plt import numpy as np ``` <!-- BEGIN QUESTION --> **Question 1.** Assign `x` to the smallest prime number. _Points:_ 16 ``` x = 2 # SOLUTION grader.check("q1") ``` <!-- END QUESTION --> <!-- BEGIN QUESTION --...
github_jupyter
``` !nvidia-smi %cd /content/ !git clone https://github.com/westphal-jan/peer-data %cd /content/peer-data # !git checkout huggingface !git submodule update --init --recursive # !pip install pytorch-lightning wandb python-dotenv catalyst sentence-transformers numpy requests nlpaug sentencepiece nltk # !pip install wandb...
github_jupyter
## Welcome to the BioProv tutorials! ### Tutorial index * <a href="./introduction.ipynb">Introduction to BioProv</a> * <a href="./w3c-prov.ipynb">W3C-PROV projects</a> * <a href="./workflows_and_presets.ipynb">Presets and Workflows</a> ## W3C-PROV projects In the last tutorial we learned about how to start a **Proje...
github_jupyter
# Image file formats When working with microscopy image data, many file formats are circulating. Most microscope vendors bring proprietary image file formats, image analysis software vendors offer custom and partially open file formats. Traditional file formats exist as well which are supported by common python librari...
github_jupyter
# Ens'IA - Session 3: Neural network After having seen how both a neuron and backpropagation works, it is time to do some more serious business and make an ENTIRE neural network. Of course, we won't ask you to reprogram everything from the ground up! In order to build our neural network, we are going to use the famous...
github_jupyter
# AutoML for Text Classification with Vertex AI **Learning Objectives** 1. Learn how to create a text classification dataset for AutoML using BigQuery 1. Learn how to train AutoML to build a text classification model 1. Learn how to evaluate a model trained with AutoML 1. Learn how to predict on new test data with Au...
github_jupyter
### *Before start: make sure you deleted the output_dir folder from this path* # Some things we get for free by using Estimators Estimators are a high level abstraction (Interface) that supports all the basic operations you need to support a ML model on top of TensorFlow. Estimators: * provide a simple interface f...
github_jupyter
``` import os import sys import pandas as pd import numpy as np from scipy import stats from sklearn.model_selection import RandomizedSearchCV, cross_val_score from sklearn.pipeline import make_pipeline, make_union from sklearn.compose import ColumnTransformer from sklearn.preprocessing import PolynomialFeatures, OneH...
github_jupyter