code
stringlengths
2.5k
150k
kind
stringclasses
1 value
## Классная работа Является ли процесс ($X_n$) мартингалом по отношению к фильтрации $\mathcal{F}_n$? 1. $z_1,z_2,\ldots,z_n$ — независимы и $z_i\sim N(0,49)$, $X_n=\sum_{i=1}^n z_i$. Фильтрация: $\mathcal{F}_n=\sigma(z_1,z_2,\ldots,z_n);$ 2. $z_1,z_2,\ldots,z_n$ — независимы и $z_i\sim U[0,1]$, $X_n=\sum_{i=1}^n z_...
github_jupyter
# Sistema de Recomendação com a biblioteca Surprise Aqui nós vamos implementar um simples **Sistema de Recomendação** com a biblioteca **[Surprise](http://surpriselib.com/)**. O objetivo principal é testar alguns dos recursos básico da biblioteca. ## 01 - Preparando o Ambiente & Conjunto de dados ### 01.1 - Baixando ...
github_jupyter
<a href="https://colab.research.google.com/github/sortsammcdonald/edx-python_and_data_science/blob/master/final_project.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Determining Iris species based on simple metrics This report will evaluate if ...
github_jupyter
# Initialization Welcome to the first assignment of "Improving Deep Neural Networks". Training your neural network requires specifying an initial value of the weights. A well chosen initialization method will help learning. If you completed the previous course of this specialization, you probably followed our ins...
github_jupyter
# Deep Crossentropy method In this section we'll extend your CEM implementation with neural networks! You will train a multi-layer neural network to solve simple continuous state space games. __Please make sure you're done with tabular crossentropy method from the previous notebook.__ ![img](https://tip.duke.edu/inde...
github_jupyter
# 2.3 Least Squares and Nearest Neighbors ### 2.3.3 From Least Squares to Nearest Neighbors 1. Generates 10 means $m_k$ from a bivariate Gaussian distrubition for each color: - $N((1, 0)^T, \textbf{I})$ for <span style="color: blue">BLUE</span> - $N((0, 1)^T, \textbf{I})$ for <span style="color: orange">ORANGE<...
github_jupyter
<a href="https://colab.research.google.com/github/JerKeller/2022_ML_Earth_Env_Sci/blob/main/S4_3_THOR.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <img src='https://unils-my.sharepoint.com/:i:/g/personal/tom_beucler_unil_ch/ESLP1e1BfUxKu-hchh7wZK...
github_jupyter
``` import re import json import matplotlib.pylab as plt import numpy as np import glob %matplotlib inline all_test_acc = [] all_test_err = [] all_train_loss = [] all_test_loss = [] all_cardinalities = [] all_depths = [] all_widths = [] for file in glob.glob('logs_cardinality/Cifar2/*.txt'): with open(file) as logs...
github_jupyter
``` import numpy as np import spectral_embedding as se import matplotlib as mpl import matplotlib.pyplot as plt ``` In this example we demostrate unfolded adjacency spectral embedding for a series of stochastic block models and investigate the stability of the embedding compared to two other possible approaches; omnib...
github_jupyter
# Using an external master clock for hardware control of a stage-scanning high NA oblique plane microscope Tutorial provided by [qi2lab](https://www.shepherdlaboratory.org). This tutorial uses Pycro-Manager to rapidly acquire terabyte-scale volumetric images using external hardware triggering of a stage scan optimiz...
github_jupyter
# Distribution Plots Let's discuss some plots that allow us to visualize the distribution of a data set. These plots are: * distplot * jointplot * pairplot * rugplot * kdeplot ___ ## Imports ``` import seaborn as sns %matplotlib inline ``` ## Data Seaborn comes with built-in data sets! ``` tips = sns.load_dataset...
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
# EUC Calibration Experiment from David Halpern For the vertical spacing, what are the ECCOv4r4 vertical layers from the surface to 400 m depth? At the equator (0°), the vertical profile of the zonal velocity component is: 0.1 m s*-1 towards the west from the sea surface at 0 m to 20 m depth; 0.5 m s*-1 towards the...
github_jupyter
Cross-shelf transport (total) of CNTDIFF experiments == This notebook explores the similarities and differences between the 2 tracer transports for case CNTDIFF as well as canyon and no canyon cases. It looks at the transport normal to a shelf break wall<sup>1</sup>. Total Tracer Transport (TracTrans) is understood he...
github_jupyter
``` import pandas as pd import numpy as np from datetime import datetime from sqlalchemy import create_engine import requests from time import sleep import warnings warnings.filterwarnings('ignore') df = pd.read_excel("HistoricoCobranca.xlsx") df["doc"] = df.apply(lambda x : x["CNPJ"].replace(".", "").replace("-", "")....
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import sys from pathlib import Path ROOT_DIR = os.path.abspath(os.path.join(Path().absolute(), os.pardir)) sys.path.insert(1, ROOT_DIR) import numpy as np import scipy import matplotlib.pyplot as plt from frequency_response import FrequencyResponse from biquad import pea...
github_jupyter
``` !pip install -q blackjax !pip install -q distrax import jax import jax.numpy as jnp import jax.scipy.stats as stats from jax.random import PRNGKey, split try: import distrax except ModuleNotFoundError: %pip install -qq distrax import distrax try: from tensorflow_probability.substrates.jax.distribut...
github_jupyter
# Direct Grib Read If you have installed more recent versions of pygrib, you can ingest grib mosaics directly without conversion to netCDF. This speeds up the ingest by ~15-20 seconds. This notebook will also demonstrate how to use MMM-Py with cartopy, and how to download near-realtime data from NCEP. ``` from __futu...
github_jupyter
# Lab 01 : MLP -- demo # Understanding the training loop ``` import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from random import randint import utils ``` ### Download the data ``` from utils import check_mnist_dataset_exists data_path=check_mnist_dataset_exists() train...
github_jupyter
``` # header files import torch import torch.nn as nn import torchvision import numpy as np from torch.utils.tensorboard import SummaryWriter from google.colab import drive drive.mount('/content/drive') np.random.seed(1234) torch.manual_seed(1234) torch.cuda.manual_seed(1234) # define transforms train_transforms = torc...
github_jupyter
Deep Learning ============= Assignment 1 ------------ The objective of this assignment is to learn about simple data curation practices, and familiarize you with some of the data we'll be reusing later. This notebook uses the [notMNIST](http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html) dataset to be used...
github_jupyter
# MLB's Biggest All-Star Injustices ``` # Import dependencies import numpy as np import pandas as pd pd.set_option('display.max_columns', 100) pd.options.mode.chained_assignment = None from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression, SGDClassifier from sklearn.m...
github_jupyter
``` import numpy as np %matplotlib inline import matplotlib.pyplot as plt np.random.seed(0) from statistics import mean ``` 今回はアルゴリズムの評価が中心の章なので,学習アルゴリズム実装は後に回し、sklearnを学習アルゴリズムとして使用する。 ``` import sklearn ``` 今回、学習に使うデータはsin関数に正規分布$N(\varepsilon|0,0.05)$ノイズ項を加えたデータを使う ``` size = 100 max_degree = 11 x_data = np.rand...
github_jupyter
___ <a href='https://www.udemy.com/user/joseportilla/'><img src='../Pierian_Data_Logo.png'/></a> ___ <center><em>Content Copyright by Pierian Data</em></center> # Warmup Project Exercise ## Simple War Game Before we launch in to the OOP Milestone 2 Project, let's walk through together on using OOP for a more robust...
github_jupyter
``` from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> The raw code for this IPython notebook is by default hidden for easier rea...
github_jupyter
# H2O Tutorial: EEG Eye State Classification Author: Erin LeDell Contact: erin@h2o.ai This tutorial steps through a quick introduction to H2O's R API. The goal of this tutorial is to introduce through a complete example H2O's capabilities from R. Most of the functionality for R's `data.frame` is exactly the same s...
github_jupyter
<a href="https://colab.research.google.com/github/issdl/from-data-to-solution-2021/blob/main/4_metrics.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Metrics ## Imports ``` import numpy as np np.random.seed(2021) import random random.seed(2021)...
github_jupyter
``` import pandas as pd import numpy as np import os import matplotlib import matplotlib.pyplot as plt from xgboost.sklearn import XGBRegressor from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error, roc_auc_score, make_scorer, accuracy_score from xgboost import XGBClassifi...
github_jupyter
![rmotr](https://i.imgur.com/jiPp4hj.png) <hr style="margin-bottom: 40px;"> <img src="https://user-images.githubusercontent.com/7065401/39117440-24199c72-46e7-11e8-8ffc-25c6e27e07d4.jpg" style="width:300px; float: right; margin: 0 40px 40px 40px;"></img> # Handling Missing Data with Pandas pandas borrows all the...
github_jupyter
<a href="https://colab.research.google.com/github/mrdbourke/tensorflow-deep-learning/blob/main/00_tensorflow_fundamentals.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # 00. Getting started with TensorFlow: A guide to the fundamentals ## What is ...
github_jupyter
# Libraries + DATA ``` from visualizations import * import numpy as np import pandas as pd import warnings from math import tau import matplotlib.pyplot as plt from scipy.integrate import quad warnings.filterwarnings('ignore') data = np.loadtxt("./../DATA/digits2k_pixels.data.gz", ndmin=2)/255.0 data.shape = (data.sha...
github_jupyter
# Predicitng Stock/Weather prices using neural networks ## import relevant libraries ``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt from keras.models import Sequential import matplotlib.patches as mpatches from keras.layer...
github_jupyter
``` import re from robobrowser import RoboBrowser import urllib import os class ProgressBar(object): """ 链接:https://www.zhihu.com/question/41132103/answer/93438156 来源:知乎 """ def __init__(self, title, count=0.0, run_status=None, fin_status=None, total=100.0, unit='', sep='/', chunk_size=1.0): ...
github_jupyter
# Character-based LSTM ## Grab all Chesterton texts from Gutenberg ``` from nltk.corpus import gutenberg gutenberg.fileids() text = '' for txt in gutenberg.fileids(): if 'chesterton' in txt: text += gutenberg.raw(txt).lower() chars = sorted(list(set(text))) char_indices = dict((c, i) for i, c i...
github_jupyter
**Run the following two cells before you begin.** ``` %autosave 10 import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import roc_auc_score ``` ______________________________________________________________________ **First, import your data set and define t...
github_jupyter
<a href="https://colab.research.google.com/github/ahammedshaneebnk/ML_Support_Vector_Machines_Exercises/blob/main/soft_margin_svm_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #**Question:** ![lab_9_q1.png](data:image/png;base64,iVBORw0KGgoAAAA...
github_jupyter
# Team BackProp During exploration of the neural architecture, we used copies of this notebook to be able to easily process data whilst keeping our models intact. 1. Import KMNIST Data 2. Data preprocess and augmentate 3. Develop neural network model 4. Cross validate model - At this stage we decide whether to ke...
github_jupyter
# Author: [Yunting Chiu](https://www.linkedin.com/in/yuntingchiu/) ``` import cv2 import matplotlib.pyplot as plt import numpy as np import time import pandas as pd #wd %cd /content/drive/MyDrive/American_University/2021_Fall/DATA-793-001_Data Science Practicum/data !pwd ``` # Exploratory Data Analysis ##Read the dat...
github_jupyter
Check coefficients for integration schemes - they should all line up nicely for values in the middle and vary smoothly ``` from bokeh import plotting, io, models, palettes io.output_notebook() import numpy from maxr.integrator import history nmax = 5 figures = [] palette = palettes.Category10[3] for n in range(1, nm...
github_jupyter
# Operations on Word Vectors Welcome to your first assignment of Week 2, Course 5 of the Deep Learning Specialization! Because word embeddings are very computationally expensive to train, most ML practitioners will load a pre-trained set of embeddings. In this notebook you'll try your hand at loading, measuring simi...
github_jupyter
### Notebook for the Udacity Project "Write A Data Science Blog Post" #### Dataset used: "TripAdvisor Restaurants Info for 31 Euro-Cities" https://www.kaggle.com/damienbeneschi/krakow-ta-restaurans-data-raw https://www.kaggle.com/damienbeneschi/krakow-ta-restaurans-data-raw/downloads/krakow-ta-restaurans-data-raw.zip/...
github_jupyter
``` import os, sys, time, copy import random import numpy as np import matplotlib.pyplot as plt import multiprocessing from functools import partial from tqdm import tqdm import myokit sys.path.append('../') sys.path.append('../Protocols') sys.path.append('../Models') sys.path.append('../Lib') import protocol_lib im...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt % matplotlib inline plt.rcParams["savefig.dpi"] = 300 plt.rcParams["savefig.bbox"] = "tight" np.set_printoptions(precision=3, suppress=True) import pandas as pd from sklearn.model_selection import train_test_split from sklearn.pipeline import make_pipeline from skl...
github_jupyter
``` # Imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle import os from scipy.stats import linregress from sklearn_pandas import DataFrameMapper from sklearn.preprocessing import LabelEncoder, LabelBinarizer from sklearn.model_selection import train_test_split, GridSearchCV, R...
github_jupyter
# How to setup Seven Bridges Public API python library ## Overview Here you will learn the three possible ways to setup Seven Bridges Public API Python library. ## Prerequisites 1. You need to install _sevenbridges-python_ library. Library details are available [here](http://sevenbridges-python.readthedocs.io/en/late...
github_jupyter
Manipulating numbers in Python ================ **_Disclaimer_: Much of this section has been transcribed from <a href="https://pymotw.com/2/math/">https://pymotw.com/2/math/</a>** Every computer represents numbers using the <a href="https://en.wikipedia.org/wiki/IEEE_floating_point">IEEE floating point standard</a>...
github_jupyter
# Seldon-Core Component Demo If you are reading this then you are about to take Seldon-Core, a model serving framework, for a test drive. Seldon-Core has been packaged as a [combinator component](https://combinator.ml/components/introduction/), which makes it easy to spin up a combination of MLOps components to make ...
github_jupyter
``` import numpy as np import random twopi = 2.*np.pi oneOver2Pi = 1./twopi import time def time_usage(func): def wrapper(*args, **kwargs): beg_ts = time.time() retval = func(*args, **kwargs) end_ts = time.time() print("elapsed time: %f" % (end_ts - beg_ts)) return retval ...
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 a...
github_jupyter
# Génération de données synthétiques ``` import numpy as np import pandas as pd from math import exp, log, log10, sqrt from scipy.integrate import odeint from scipy.stats import norm, lognorm # The Complete model def deriv(y, t, phiS, phiL, deltaS, deltaL, deltaAb): dydt = phiS * exp(-deltaS * t) + phiL * exp(-de...
github_jupyter
# Discretization --- In this notebook, you will deal with continuous state and action spaces by discretizing them. This will enable you to apply reinforcement learning algorithms that are only designed to work with discrete spaces. ### 1. Import the Necessary Packages ``` import sys import gym import numpy as np i...
github_jupyter
## Energy Generation Analysis - This script analyzes energy generation and fuel stock data published by the U.S Energy Information Administration - The data used includes energy generation data from across the country - Also included are stock levels of fuels used, including oil, coal, petcoke, and boiler fuels - Data ...
github_jupyter
``` pip install pyspark pip install sklearn pip install pandas pip install seaborn pip install matplotlib import pandas as pd import numpy as np import os import seaborn as sns import matplotlib.pyplot as plt from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LogisticRegressionCV from ...
github_jupyter
# GRIP_JULY - 2021 (TASK 5) # Task Name:- Traffic sign classification/Recognition # Domain:- Computer Vision and IOT # Name:- Akash Singh ![image.png](attachment:image.png) ``` import cv2 import numpy as np from scipy.stats import itemfreq def get_dominant_color(image, n_colors): pixels = np.float32(image)....
github_jupyter
# Making Predictions with the Standardized Coefficients ## Import the relevant libraries ``` # For these lessons we will need NumPy, pandas, matplotlib and seaborn import numpy as np import pandas as pd import matplotlib.pyplot as plt # and of course the actual regression (machine learning) module from sklearn.linea...
github_jupyter
## Synthetic spectra generator ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd max_features = 15 n_points = 640 nu = np.linspace(0,1,n_points) def random_chi3(): """ generates a random spectrum, without NRB. output: params = matrix of parameters. each row corresponds to...
github_jupyter
# NLP-Cube local installation To be able to use NLP-Cube to the fullest (train models, export them, change the network structure, etc.) we need a clone of the NLP-Cube repository. NLP-Cube requires a number of dependencies installed. This tutorial will show each step in detail. We'll install on a fresh Ubuntu 18.04 w...
github_jupyter
``` #DATA TAKEN ON 5/1 import pandas as pd import numpy as np from sodapy import Socrata client = Socrata("data.sfgov.org", None) # results = client.get("cuks-n6tp", limit = 2191368) data = client.get("cuks-n6tp", limit = 3000000) data_df = pd.DataFrame.from_records(data)#here print(data_df.shape) data_df.columns data_...
github_jupyter
# Distribution function for the NFW profiles ``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import interpolate from scipy.integrate import quad, cumtrapz from tqdm import tqdm import matplotlib as mpl mpl.rcParams['font.size'] = 18.0 G_N = 4.302e-3 c = 100 def f_NFW(x): retu...
github_jupyter
# Markov Random Fields for Collaborative Filtering (Memory Efficient) This notebook provides a **memory efficient version** in Python 3.7 of the algorithm outlined in the paper "[Markov Random Fields for Collaborative Filtering](https://arxiv.org/abs/1910.09645)" at the 33rd Conference on Neural Information Processi...
github_jupyter
<a href="https://colab.research.google.com/github/HenriqueCCdA/bootCampAluraDataScience/blob/master/modulo1/desafios/Desafio_aula5_modulo1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd import matplotlib.pyplot as plt import...
github_jupyter
<a href="https://colab.research.google.com/github/emadphysics/Amsterdam_Airbnb_predictive_models/blob/main/airbnb_pytorch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd import numpy as np from datetime import date import ...
github_jupyter
``` import panel as pn pn.extension() ``` One of the main design goals for Panel was that it should make it possible to seamlessly transition back and forth between interactively prototyping a dashboard in the notebook or on the commandline to deploying it as a standalone server app. This section shows how to display ...
github_jupyter
``` import os import numpy as np import scipy.stats as sps import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import random import sys, os sys.path += [os.path.abspath(os.pardir + '/code')] print(sys.path) from experiment import init_random_state, BanditLoopExperiment, get_ts_model sns.set(f...
github_jupyter
# Emulators: First example This example illustrates Bayesian inference on a time series, using [Adaptive Covariance MCMC](http://pints.readthedocs.io/en/latest/mcmc_samplers/adaptive_covariance_mcmc.html) with emulator neural networks . It follows on from [Sampling: First example](../sampling/first-example.ipynb) Li...
github_jupyter
# Bias Reduction Climate models can have biases towards different references. Commonly, biases are reduced by postprocessing before verification of forecasting skill. `climpred` provides convenience functions to do so. ``` import climpred import xarray as xr import matplotlib.pyplot as plt from climpred import Hindca...
github_jupyter
``` import os import sys import random import math import re import time import numpy as np from keras import backend as K import matplotlib import matplotlib.pyplot as plt # Root directory of the project ROOT_DIR = os.path.abspath("../..") # Import Mask RCNN sys.path.append(ROOT_DIR) from mrcnn import utils impor...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os os.environ['CUDA_VISIBLE_DEVICES'] = "0" import gin import numpy as np from matplotlib import pyplot as plt from torch.autograd import Variable from tqdm.auto import tqdm import torch from causal_util.helpers import lstdct2dctlst from sparse_causal_model_learner_rl.sacre...
github_jupyter
``` import os import threading import gym import multiprocessing import numpy as np from queue import Queue import matplotlib.pyplot as plt %matplotlib inline import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers, optimizers class ActorCriticModel(keras.Model): def __init__(self...
github_jupyter
``` class DF2Paths(): def __init__(self, path, fps=24): self.path, self.fps = path, fps def __call__(self, item:pd.Series): def fr(t): return int(float(t)*self.fps) Id, start, end = item['id'], item['start'], item['end'] start, end = fr(start), fr(end) step ...
github_jupyter
# Using `bw2landbalancer` Notebook showing typical usage of `bw2landbalancer` ## Generating the samples `bw2landbalancer` works with Brightway2. You only need set as current a project in which the database for which you want to balance land transformation exchanges is imported. ``` import brightway2 as bw import nu...
github_jupyter
# Analyzing volumes for word frequencies This notebook will demonstrate some of basic functionality of the Hathi Trust FeatureReader object. We will look at a few examples of easily replicable text analysis techniques — namely word frequency and visualization. ``` %%capture !pip install nltk from htrc_features import ...
github_jupyter
``` import json from matplotlib import pyplot as plt import numpy as np import statistics n_gen = 200 # number of generatons n = 10 # number of generations to group ``` Read files ``` with open("Results_vehicle_ga.json", "r") as f: ga = json.load(f) with open("Results_vehicle_mo.json", "r") as f: mo = js...
github_jupyter
# Correlation and Causation It is hard to over-emphasize the point that **correlation is not causation**!. Variables can be highly correlated for any number of reasons, none of which imply a causal relationship. When trying to understand relationships between variables, it is worth the effort to think carefully a...
github_jupyter
# Modélisation thématique Dans ce notebook, nous effectuons de la modélisation thématique de textes à l'aide de modules Python spécialisés. **IMPORTANT**: ce notebook requiert le module `java`. S'il n'était pas chargé au moment d'ouvrir ce notebook, vous devez le fermer, l'arrêter, charger le module `java` et rouvrir ...
github_jupyter
# Fraud_Detection_Using_ADASYN_OVERSAMPLING I am able to achieve the following accuracies in the validation data. These results can be further improved by reducing the parameter, number of frauds used to create features from category items. I have used a threshold of 100. * Logistic Regression : Validation ...
github_jupyter
# Boston Housing Prices Classification ``` import itertools import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from dataclasses import dataclass from sklearn import datasets from sklearn import svm from sklearn import tree from sklearn.ensemble import AdaBoostClassifier f...
github_jupyter
# ALL/AML Classifier ## Research Description ### Summary of the relative research - **Index of the papers discussed** | Paper ID | Title | Published Year | |----------|-------|----------------| |1 |_Molecular classification of cancer: class discovery and class prediction by gene expression monitoring_|1999/10/15| ...
github_jupyter
# Increase Transparency and Accountability in Your Machine Learning Project with Python and H2O #### Explain your complex models with decision tree surrogates, GBM feature importance, and reason codes Decision trees and decision tree ensembles are some of the most popular machine learning models used in commercial pra...
github_jupyter
[![AnalyticsDojo](../fig/final-logo.png)](http://rpi.analyticsdojo.com) <center><h1>Intro to Tensorflow - MINST</h1></center> <center><h3><a href = 'http://rpi.analyticsdojo.com'>rpi.analyticsdojo.com</a></h3></center> [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research...
github_jupyter
``` # code reference: https://github.com/jeffheaton/t81_558_deep_learning/blob/dce2306815d4ac7c6443a01c071901822d612c6a/t81_558_class_06_4_keras_images.ipynb %matplotlib inline from PIL import Image, ImageFile from matplotlib.pyplot import imshow import requests import numpy as np from io import BytesIO from IPython.d...
github_jupyter
## 3.2 autograd 用Tensor训练网络很方便,但从上一小节最后的线性回归例子来看,反向传播过程需要手动实现。这对于像线性回归等较为简单的模型来说,还可以应付,但实际使用中经常出现非常复杂的网络结构,此时如果手动实现反向传播,不仅费时费力,而且容易出错,难以检查。torch.autograd就是为方便用户使用,而专门开发的一套自动求导引擎,它能够根据输入和前向传播过程自动构建计算图,并执行反向传播。 计算图(Computation Graph)是现代深度学习框架如PyTorch和TensorFlow等的核心,其为高效自动求导算法——反向传播(Back Propogation)提供了理论支持,了解计算图在实际写程序过...
github_jupyter
# COVID-19 Deaths Per Capita > Comparing death rates adjusting for population size. - comments: true - author: Joao B. Duarte & Hamel Husain - categories: [growth, compare, interactive] - hide: false - image: images/covid-permillion-trajectories.png - permalink: /covid-compare-permillion/ ``` #hide import numpy as n...
github_jupyter
``` # Required to load webpages from IPython.display import IFrame ``` [Table of contents](../toc.ipynb) <img src="https://github.com/scipy/scipy/raw/master/doc/source/_static/scipyshiny_small.png" alt="Scipy" width="150" align="right"> # SciPy * Scipy extends numpy with powerful modules in * optimization, * ...
github_jupyter
# ¿Cómo funciona la suspensión de un auto? <div> <img style="float: left; margin: 0px 0px 15px 0px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Packard_wishbone_front_suspension_%28Autocar_Handbook%2C_13th_ed%2C_1935%29.jpg/414px-Packard_wishbone_front_suspension_%28Autocar_Handbook%2C_13th_ed%2C...
github_jupyter
## RaTG13 de-novo assembly - plots of assembled nucleotide sequences Multiple preprints have questioned the validity of the metagenomic dataset upon which RaTG13 is based (Zhang, 2020; Rahalkar and Bahulikar, 2020; Singla et al., 2020; Signus, 2020). Here we undertook de-novo assembly of the metagenomic dataset uploa...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline # This code creates a virtual display to draw game images on. # If you are running locally, just ignore it import os if type(os.environ.get("DISPLAY")) is not str or len(os.environ.get("DISPLAY"))==0: !bash ../xvfb start %env DISPLAY=:1...
github_jupyter
# Financial Planning with APIs and Simulations In this Challenge, you’ll create two financial analysis tools by using a single Jupyter notebook: Part 1: A financial planner for emergencies. The members will be able to use this tool to visualize their current savings. The members can then determine if they have enough...
github_jupyter
``` import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def take_and_clean(filename, keyword, print_info=False): raw = pd.read_json(f'./data/giantsGates/{filename}.json') ranks = raw[['creatorName', 'totalScore']] ranks = ranks[ranks['creatorName'].str.contains(keyword)] ranks = ra...
github_jupyter
# Visualizing Sorting Algorithm Behavior ``` import numpy as np import random import matplotlib %matplotlib inline import matplotlib.pyplot as plt import time import scipy.signal def generateRandomList(n): # Generate list of integers # Possible alternative: l = [random.randint(0, n) for _ in range(n)] ...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Objectives" data-toc-modified-id="Objectives-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Objectives</a></span></li><li><span><a href="#Example-Together" data-toc-modified-id="Example-Together-2"><span...
github_jupyter
## Dependencies ``` import json, warnings, shutil from tweet_utility_scripts import * from tweet_utility_preprocess_roberta_scripts import * from transformers import TFRobertaModel, RobertaConfig from tokenizers import ByteLevelBPETokenizer from tensorflow.keras.models import Model from tensorflow.keras import optimiz...
github_jupyter
__This notebook__ trains resnet18 from scratch on CIFAR10 dataset. ``` %load_ext autoreload %autoreload 2 %env CUDA_VISIBLE_DEVICES=YOURDEVICEHERE import os, sys, time sys.path.insert(0, '..') import lib import numpy as np import torch, torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt %m...
github_jupyter
``` #!pip install tensorflow import pandas as pd #import tensorflow as tf #from tensorflow import keras #from tensorflow.keras.models import Sequential #from tensorflow.keras.layers import Activation, Dense import matplotlib.pyplot as plt x = [-1, 0, 1, 2, 3, 4] y = [-3, -1, 1, 3, 5, 7] df = pd.DataFrame({ "x": [...
github_jupyter
## Homework-3: MNIST Classification with ConvNet ### **Deadline: 2021.04.06 23:59:00 ** ### In this homework, you need to - #### implement the forward and backward functions for ConvLayer (`layers/conv_layer.py`) - #### implement the forward and backward functions for PoolingLayer (`layers/pooling_layer.py`) - #### i...
github_jupyter
#### Import the libraries and load the data ``` import pandas as pd import numpy as np import random from tqdm import tqdm from gensim.models import Word2Vec import matplotlib.pyplot as plt %matplotlib inline import warnings; warnings.filterwarnings('ignore') onlineData = pd.read_excel('./Data/Online Retail.xlsx') o...
github_jupyter
# YOLOv5 Training on Custom Dataset ## Pre-requisite - Make sure you read the user guide from the [repository](https://github.com/CertifaiAI/classifai-blogs/tree/sum_blogpost01/0_Complete_Guide_To_Custom_Object_Detection_Model_With_Yolov5) - Upload this to Google Drive to run on Colab. *This script is written pri...
github_jupyter
**ZuckFlix** *A data analysis using Python to give a streaming proposal.* --- By: Josue Salvador Cano Martinez. Facebook Data Challenge 2021. California, United States. Importing libraries. Analyzing DB in a general way. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn...
github_jupyter
## Calculations and plots for blog post ## Ice Lake Xeon Platinum 8352Y results ... with old data ... ### TR 3990x vs 3970x vs 3265W Performance and Scaling and rocket lake stuff These are typical imports I do for almost any data analysis ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt ...
github_jupyter