text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Feature Descriptions # Absolute Features Track statistics that depend only on a single track. A number of the below statistics include an autocorrelation calculation with a specific time lag. High autocorrelation values mean that there is some a repeated pattern to the time series being investigated. Low values mea...
github_jupyter
``` import numpy as np from sklearn.base import BaseEstimator, RegressorMixin, clone from sklearn.metrics.pairwise import rbf_kernel from sklearn.utils.validation import check_X_y, check_array, check_is_fitted import sys sys.path.insert(0,'/Users/eman/Documents/code_projects/kernellib/') import matplotlib.pyplot as pl...
github_jupyter
### Comparing Regression Models In this notebook, we'll look at methods for comparing regression models. In this notebook, we'll use results from the paper [Validation of AMBER/GAFF for Relative Free Energy Calculations](https://chemrxiv.org/articles/Validation_of_AMBER_GAFF_for_Relative_Free_Energy_Calculations/76534...
github_jupyter
# Object Detection Demo Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_de...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/notebooks/linreg_bayes_svi_hmc_pyro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Bayesian linear regression in Pyro We compare stochastic variational inference with H...
github_jupyter
## Compile supplementary table 1 Per compound and MOA median pairwise Pearson correlations ``` suppressPackageStartupMessages(library(dplyr)) # Load scores compound_cols <- readr::cols( compound = readr::col_character(), no_of_compounds = readr::col_double(), well = readr::col_character(), dose_recode = readr...
github_jupyter
``` # Standard imports import pandas as pd import matplotlib.pyplot as plt import numpy as np # Load mavenn import mavenn print(mavenn.__path__) # Load example data data_df = mavenn.load_example_dataset('gb1') # Separate test from data_df ix_test = data_df['set']=='test' test_df = data_df[ix_test].reset_index(drop=Tr...
github_jupyter
# KNeighborsClassifier with StandardScaler & Polynomial Features This Code template is for the Classification task using a simple KNeighborsClassifier based on the K-Nearest Neighbors algorithm and StandardScaler,PolynomialFeatures are used for rescaling,feature transformation respectively in a pipeline. ### Required...
github_jupyter
``` from PreFRBLE.convenience import * from PreFRBLE.estimate_redshift import * from PreFRBLE.plot import * from PreFRBLE.likelihood import * from PreFRBLE.physics import * import Pshirkov16 ## this contains procedures for Monte-Carlo simulation following Phsirkov e al. 2016 ``` ### Compare mean(redshift) Here we va...
github_jupyter
# Principal Componenet Analysis (PCA) The PCA algorithm is a dimensionality reduction algorithm which works really well for datasets which have correlated columns. It combines the features of X in linear combination such that the new components capture the most information of the data. The PCA model is implemented in...
github_jupyter
## AI for Medicine Course 3 Week 2 lecture notebook - Cleaning Text For this notebook you'll be using the `re` module, which is part of Python's Standard Library and provides support for regular expressions (which you may know as `regexp`). - If you aren't familiar with `regexp`, we recommend checking the [documentat...
github_jupyter
``` ''' Numbers: Integers You can use an integer represent numeric data, and more specifically, whole numbers from negative infinity to infinity, like 4, 5, or -1. Float "Float" stands for 'floating point number'. You can use it for rational numbers, usually ending with a decimal figure, such as 1.11 or 3.14. ''' # In...
github_jupyter
# Batch Normalization One way to make deep networks easier to train is to use more sophisticated optimization procedures such as SGD+momentum, RMSProp, or Adam. Another strategy is to change the architecture of the network to make it easier to train. One idea along these lines is batch normalization which was recently ...
github_jupyter
<a href="https://colab.research.google.com/github/pcsilcan/pcd/blob/master/20202/pcd_20202_0902_conway.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Conway's problem ``` !sudo apt install golang-go %%writefile 1.go package main import ( "f...
github_jupyter
**Chapter 1 – The Machine Learning landscape** _This is the code used to generate some of the figures in chapter 1._ <table align="left"> <td> <a href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/01_the_machine_learning_landscape.ipynb" target="_parent"><img src="https://colab.resear...
github_jupyter
_This notebook contains code and comments from Section 5.1 of the book [Ensemble Methods for Machine Learning](https://www.manning.com/books/ensemble-methods-for-machine-learning). Please see the book for additional details on this topic. This notebook and code are released under the [MIT license](https://github.com/gk...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt # for 畫圖用 import pandas as pd # Feature Scaling from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import Dropout from openpyxl import load_workbook from...
github_jupyter
## Content-Based Filtering Using Neural Networks This notebook relies on files created in the [content_based_preproc.ipynb](./content_based_preproc.ipynb) notebook. Be sure to run the code in there before completing this notebook. Also, we'll be using the **python3** kernel from here on out so don't forget to change...
github_jupyter
``` try: from openmdao.utils.notebook_utils import notebook_mode except ImportError: !python -m pip install openmdao[notebooks] ``` # ScipyKrylov ScipyKrylov is an iterative linear solver that wraps the methods found in `scipy.sparse.linalg`. The default method is "gmres", or the Generalized Minimal RESidual ...
github_jupyter
## simple ResNet ``` import torch import numpy as np from torch import nn from torch.nn import functional import matplotlib.pyplot as plt import ipywidgets # number of features in nf = 2 # number of classes nClass = 2 X = torch.randn(2,1500) R = torch.sqrt(X[0,:]**2 + X[1,:]**2) indRed = (R < 0.9).nonzero() indBl...
github_jupyter
``` # run this code to login to https://okpy.org/ and setup the assignment for submission from ist256 import okclient ok = okclient.Lab() ``` # In-Class Coding Lab: Strings The goals of this lab are to help you to understand: - String slicing for substrings - How to use Python's built-in String functions in the stan...
github_jupyter
``` import torch,torchvision import numpy as np import pandas as pd import matplotlib.pyplot as plt from torch.nn import * from torch.optim import * data = pd.read_csv('btcNewsToPrice2.csv') data.head() X = data['date'].tolist() new_X = [] for x in X: x = x.split('-') x = int(f'{x[0]}{x[1]}{x[2]}') new_X.ap...
github_jupyter
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All). Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we...
github_jupyter
``` %load_ext autoreload %autoreload 2 import xarray as xr import matplotlib.pyplot as plt from src.data_generator import * from src.train import * from src.utils import * from src.networks import * os.environ["CUDA_VISIBLE_DEVICES"]=str(7) limit_mem() policy = mixed_precision.Policy('mixed_float16') mixed_precision.se...
github_jupyter
# Outputting HTML in a notebook ## Display Helpers There are a number of helper methods for writing HTML that are available by default in a .NET notebook. ### HTML If you want to write out a `string` as HTML, you can use the `HTML` method: ``` display(HTML("<b style=\"color:blue\">Hello!</b>")); ``` Displaying HT...
github_jupyter
# <center>Prepare Lab of 2nd Exercise</center> ## <center> Speech Recognition using HMMs and RNNs </center> ### Description Our goal is the implementation of a speech recognition system, that recognizes isolated words. The first part involves the extraction of the appropriate acoustic features from our recordings an...
github_jupyter
TSG108 - View the controller upgrade config map =============================================== Description ----------- When running a Big Data Cluster upgrade using `azdata bdc upgrade`: `azdata bdc upgrade --name <namespace> --tag <tag>` It may fail with: > Upgrading cluster to version 15.0.4003.10029\_2 > > NOT...
github_jupyter
# **Gaussian Processes** Notebook version: 1.0 (Oct 06, 2015) Author: Jerónimo Arenas García (jarenas@tsc.uc3m.es) Changes: v.1.0 - First version v.1.1 - Figures changed to png (tiff not readable in Firefox) ``` # Import some libraries that will be necessary for working with data and displa...
github_jupyter
``` # Analyze ferrozine incubation data # Copyright Jackson M. Tsuji, Neufeld lab, 2019 import pandas as pd from plotnine import * # User variables sample_concentrations_filepath = 'data/Fe_incubation_plotting_data_191122.tsv' sample_metadata_filepath = 'sample_metadata.tsv' timepoint_metadata_filepath = 'timepoint_met...
github_jupyter
# Overfitting & Regularization State-of-the-art neural networks used in deep learning typically come with millions of weights. Unsurprisingly, it is therefore rarely an issue to push the training error to 0. In particular, without any regularization there is instant death through overfitting. In today's lecture, we di...
github_jupyter
# Hidden Linear Function Problem In this notebook we consider a problem from paper [1] and build a quantum cirquit, which solves it, in Cirq. ## The problem Consider $A \in \mathbb{F}_2^{n \times n}$ - upper-triangular binary matrix, $b \in \mathbb{F}_2^n$ - binary vector. Define a function $q : \mathbb{F}_2^n \to ...
github_jupyter
# Grammar Coverage [Producing inputs from grammars](GrammarFuzzer.ipynb) gives all possible expansions of a rule the same likelihood. For producing a comprehensive test suite, however, it makes more sense to maximize _variety_ – for instance, by not repeating the same expansions over and over again. In this chapter,...
github_jupyter
# Tutorial 2: Working With Datasets Data is central to machine learning. This tutorial introduces the `Dataset` class that DeepChem uses to store and manage data. It provides simple but powerful tools for efficiently working with large amounts of data. It also is designed to easily interact with other popular Pytho...
github_jupyter
``` # UCSD Data Science Bootcamp, HW 21 ML # Alexis Perumal, 4/28/20 # Update sklearn to prevent version mismatches # # Model X - Compare Models, no Hyperparameter tuning # !pip install sklearn --upgrade # install joblib. This will be used to save your model. # Restart your kernel after installing !pip install joblib...
github_jupyter
## In this notebook, we will train a CNN model on the [MNIST](https://en.wikipedia.org/wiki/MNIST_database) dataset and use *activation maximization* to visualize the features that the trained model has learnt. ### The MNIST database (Modified National Institute of Standards and Technology database) is a database of h...
github_jupyter
``` import numpy as np import sys import matplotlib.pyplot as plt from skimage import io from scipy import ndimage as ndi from skimage import feature from skimage.filters import gaussian from skimage.filters import sobel from skimage.exposure import equalize_hist from skimage.exposure import equalize_adapthist from ski...
github_jupyter
``` from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import pandas as pd import numpy as np import pkg_resources import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import model_bias_analysis # autoreload makes it easier to i...
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
``` from keras.models import Sequential from keras import layers import numpy as np from six.moves import range import matplotlib.pyplot as plt ``` # Parameters Config ``` class colors: ok = '\033[92m' fail = '\033[91m' close = '\033[0m' DATA_SIZE = 60000 TRAIN_SIZE = 45000 DIGITS = 3 REVERSE = False MAXL...
github_jupyter
``` !wget "https://storage.googleapis.com/kaggle-data-sets/38019/306654/bundle/archive.zip?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=gcp-kaggle-com%40kaggle-161607.iam.gserviceaccount.com%2F20210224%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20210224T022521Z&X-Goog-Expires=259199&X-Goog-SignedHeaders=host&X...
github_jupyter
# sxs_catalog_download_example This notebook demonstrates how to use the `sxs` python library to download data from the SXS Catalog of waveforms hosted on Zenodo (https://github.com/moble/sxs). The catalog is available at https://black-holes.org/waveforms and is described in https://arxiv.org/abs/1904.04831. You can ...
github_jupyter
# Entorno de experimentación `HMMLike` Entorno dónde se utiliza la minima información en la construcción de las *feature lists*. Esto es bias, la letra actual y la letra anterior. Con esto se simula un HMM pero construido con los CRFs ### Parámetros generales * Maximo Iteraciones = 50 * K = 3 ### Parametros por mod...
github_jupyter
# Using SVM to predict Multi-XRF TL;DR, RBF is best kernal. Poly does not work. Put together by Thomas Martin, thomasmartin@mines.edu, all errors are mine If you are interested in graident boosting, here is a good place to start: https://xgboost.readthedocs.io/en/latest/tutorials/model.html This is a supervised mac...
github_jupyter
<a href="https://colab.research.google.com/github/claytonchagas/intpy_prod/blob/main/1_4_automatic_evaluation_fibonacci_recursive_ast_only_files.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !sudo apt-get update !sudo apt-get install python3.9...
github_jupyter
# Autotranslation: Python to JavaScript and D3 Generate a random graph with Python, then visualize it with a [D3](http://d3js.org/) interactive, force-directed graph. The first cell imports the BeakerX package and initializes the runtime. Then we generates the graph (one made of nodes and edges, like a social netw...
github_jupyter
``` %load_ext autoreload %autoreload 2 %load_ext nb_black import json from itertools import combinations import pandas as pd from food_ke.stubs import ( EVALUATION_FILTER_ATTRIBUTES, PERFORMANCE_METRICS_MACRO_PATH, PERFORMANCE_METRICS_MICRO_PATH, ) from food_ke.composition_measurement import ( Composit...
github_jupyter
<!--BOOK_INFORMATION--> <img style="float: right; width: 100px" src="https://raw.github.com/pyomeca/design/master/logo/logo_cropped_doc.svg?sanitize=true"> <font size="+3">Effective computation in Biomechanics</font> <font size="+2">Romain Martinez</font> <a href="https://github.com/romainmartinez"><img src="https://i...
github_jupyter
# ALIGN Tutorial Notebook: CHILDES This notebook provides an introduction to **ALIGN**, a tool for quantifying multi-level linguistic similarity between speakers, using parent-child transcript data from the Kuczaj Corpus (https://childes.talkbank.org/access/Eng-NA/Kuczaj.html). This method was introduced in "ALIG...
github_jupyter
# Intel® Low Precision Optimization Tool (iLiT) Sample for Tensorflow ## Agenda - Train a CNN Model Based on Keras - Quantize Keras Model by ilit - Compare Quantized Model Import python packages and check version. Make sure the Tensorflow is **2.2** and iLiT, matplotlib are installed. ``` import tensorflow as tf pr...
github_jupyter
# Classification G. Richards (2016,2018), based particularly on materials from Andy Connolly, also Ivezic. Density estimation and clustering are **unsupervised** forms of classification. Let's now move on to **supervised** classification. That's where we actually know the "truth" for some of our objects and can use...
github_jupyter
[![AnalyticsDojo](https://github.com/rpi-techfundamentals/spring2019-materials/blob/master/fig/final-logo.png?raw=1)](http://introml.analyticsdojo.com) <center><h1>Introduction to Python - Null Values</h1></center> <center><h3><a href = 'http://introml.analyticsdojo.com'>introml.analyticsdojo.com</a></h3></center> # N...
github_jupyter
# K-Nearest Neighbor Classifier with QuantileTransformer This Code template is for the Classification task using a simple KNeighborsClassifier based on the K-Nearest Neighbors algorithm and feature transformation technique QuantileTransformer in a pipeline. ### Required Packages ``` !pip install imblearn import warn...
github_jupyter
``` %matplotlib inline import numpy as np import scipy import math import json import pprint import time import copy from matplotlib import pyplot as plt import itertools import pandas as pd import cProfile import csv import inspect import sys sys.path.insert(0, '../../') sys.path.insert(0, '../') from mx_sys.power_...
github_jupyter
#### Import reina and other necessary libraries. Initialize a spark session. ``` from reina.metalearners import SLearner from reina.metalearners import TLearner from reina.metalearners import XLearner from pyspark.ml.regression import RandomForestRegressor from pyspark.ml.classification import RandomForestClassifier f...
github_jupyter
## Machine Learning Model Building Pipeline: Feature Engineering In the following videos, we will take you through a practical example of each one of the steps in the Machine Learning model building pipeline, which we described in the previous lectures. There will be a notebook for each one of the Machine Learning Pip...
github_jupyter
<h1 align="center">Fundamentos de Programación</h1> <h1 align="center">Módulo 01: Introducción</h1> <h1 align="center">2021/02</h1> <h1 align="center">MEDELLÍN - COLOMBIA </h1> <table> <tr align=left><td><img align=left src="https://github.com/carlosalvarezh/Fundamentos_Programacion/blob/main/images/CC-BY.png?raw=tru...
github_jupyter
# SD211 TP1 Systèmes de recommandation *ZHAO Fubang* ``` import numpy as np from scipy import sparse import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from scipy.optimize import check_grad from scipy import linalg %matplotlib inline ``` # 1 Présentation du modèle ## Qu...
github_jupyter
``` # Copyright 2021 NVIDIA Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
github_jupyter
``` %matplotlib inline from __future__ import division import numpy as np from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt from utils import draw_in_row from utils import NormalDistribution from utils import plot_confusion_matrix from utils import MixtureGaussians plt.rcParams['figure.figs...
github_jupyter
# Classification on the Titanic Dataset The following example gives an idea about how you could run basic classification using a Gaussian mixture model on the Titanic dataset, using a latent node, continuous variables as well as discrete variables. The example uses cross validation to get a more robust accuracy score ...
github_jupyter
``` from glob import glob import pickle import numpy as np import sklearn import matplotlib.pyplot as plt import sys import pandas as pd # Import from adjacent scripts. import sys import os sys.path.append('..') sys.path.append('../src') sys.path.append('../audio') import src.data_util as du from src.defaults import D...
github_jupyter
# Join surrogate classes that are under the same node ``` import numpy as np import os from shutil import copyfile, copytree from tqdm import tqdm import sys sys.path.append('../../python_scripts') from utils import read_images_stl10 as read_images from torchvision import transforms from PIL import Image from matplo...
github_jupyter
# Setup and Imports ``` %%capture !rm -rf fairgraph !git clone -https://github.com/GMattheisen/fairgraph.git !pip install -r ./fairgraph/requirements.txt !pip install -U ./fairgraph from fairgraph import KGClient import os import re import io import logging from datetime import date, datetime from pprint import pprint...
github_jupyter
``` import gc import warnings warnings.filterwarnings("ignore") import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import KFold from sklearn.metrics import roc_auc_score import lightgbm as lgb SEED...
github_jupyter
# 4 Diagrama de fases para sustancias puras En esta sección se presentan los diagramas de fases comunes para sustancias puras. Como son: 1. Envolvente de fases liquido-vapor 2. Isoterma 3. Isobara 4. Sólido-líquido ``` %load_ext fortranmagic # activating magic ``` # Envolvente de fases para sustancias puras En e...
github_jupyter
#### Problem Tutorial 1: Regression Model We want to predict the gas consumption (in millions of gallons/year) in 48 of the US states based on some key features. These features are * petrol tax (in cents); * per capital income (in US dollars); * paved highway (in miles); and * population of people with driving...
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
# nba_tune_model ### Uses grid search to select optimal parameters for random forest model ``` # Import dependencies import numpy as np np.set_printoptions(suppress=True) import pandas as pd from sklearn.decomposition import PCA from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import ...
github_jupyter
# Data Handling in RAPIDS ## Installing Rapids - Note again use NVIDIA T4 or P4 or P100 GPU only ``` !nvidia-smi # Install RAPIDS !git clone https://github.com/rapidsai/rapidsai-csp-utils.git !bash rapidsai-csp-utils/colab/rapids-colab.sh import sys, os dist_package_index = sys.path.index('/usr/local/lib/python3.6...
github_jupyter
``` import xarray as xr import now from dask.distributed import LocalCluster, Client ``` ## Starting a Local Cluster with dask.distributed Here we will define a local cluster on the NCI Virtual Desktop and choose to use multithreading on the 8 cores available. Multithreading is achieved by setting `processes` to `Fals...
github_jupyter
# Class Coding Lab: Introduction to Programming The goals of this lab are to help you to understand: 1. How to turn in your lab and homework 2. the Jupyter programming environments 3. basic Python Syntax 4. variables and their use 5. how to sequence instructions together into a cohesive program 6. the input() functio...
github_jupyter
<h1> 2. Creating a sampled dataset </h1> This notebook illustrates: <ol> <li> Sampling a BigQuery dataset to create datasets for ML <li> Preprocessing with Pandas </ol> ``` # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.e...
github_jupyter
``` import math import numpy as np import os import nemo from nemo import logging from nemo.utils.lr_policies import WarmupAnnealing import nemo.collections.nlp as nemo_nlp from nemo.collections.nlp.data import NemoBertTokenizer from nemo.collections.nlp.nm.trainables import PunctCapitTokenClassifier from nemo.backen...
github_jupyter
# Support Vector Regression ### Required Packages ``` import warnings import numpy as np import pandas as pd import seaborn as se from sklearn.svm import SVR import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score, mean_absolute_error, mean_...
github_jupyter
# Orchestrating Jobs, Model Registration, and Continuous Deployment with Amazon SageMaker in a secure environment Amazon SageMaker offers Machine Learning application developers and Machine Learning operations engineers the ability to orchestrate SageMaker jobs and author reproducible Machine Learning pipelines, deplo...
github_jupyter
# Spatial joins Goals of this notebook: - Based on the `countries` and `cities` dataframes, determine for each city the country in which it is located. - To solve this problem, we will use the the concept of a 'spatial join' operation: combining information of geospatial datasets based on their spatial relationship. ...
github_jupyter
# Import Libraries ``` import torch import torch.autograd as autograd # computation graph from torch import Tensor # tensor node in the computation graph import torch.nn as nn # neural networks import torch.optim as optim # optimizers e.g. gradient descent, AD...
github_jupyter
# imports ``` import tensorflow as tf from tensorflow import keras import sklearn from sklearn.metrics import roc_curve, auc, log_loss, precision_score, f1_score, recall_score, confusion_matrix from sklearn.model_selection import KFold, StratifiedKFold import matplotlib as mplb import matplotlib.pyplot as plt #plt...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.cluster import KMeans from sklearn.svm import SVC from sklearn import metrics from mlxtend.plotting import plot_decision_regions from sklearn import preprocessing, metrics...
github_jupyter
``` from Models import Classification_Module3 as Classification_Module from Models import Focus_Module3 as Focus_Module from Mosaic import mosaic_data, MosaicDataset,split_foreground_background from torch.utils.data import Dataset,DataLoader import numpy as np import torch import torchvision import torchvision.transfor...
github_jupyter
<a href="https://colab.research.google.com/github/Machine-Learning-Tokyo/CNN-Architectures/blob/master/Implementations/ResNet/ResNet_implementation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Implementation of ResNet We will use the [tensorfl...
github_jupyter
# Numpy and Pandas versus Python dictionary We measure the memory size and access times for features of Text-Fabric. How much space does a loaded feature occupy in RAM? How fast can we look up the value of a feature for a given node? It turns out that nothing beats the Python dictionary. ``` import gzip from timei...
github_jupyter
# Using Dynamic IP on the Composable Pipeline ---- <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 your how to load dynamic IP and compose branched pipelines ## Aims * Load dynamic IP * Compose branched pipelines ## T...
github_jupyter
# Meteor observation converter This notebook converts fireball observations to the Global Fireball Exchange (GFE) format or between camera formats, including from UFOAnalyzer (UFO), FRIPON, RMS, CAMS, MetRec, AllSkyCams and Desert Fireball Network (DFN) formats. It will prompt for an input file which must be in one ...
github_jupyter
``` #notebook based on zflemings:https://nbviewer.jupyter.org/github/zflamig/dask-era5/blob/main/notebook/era5_fargate_dask.ipynb import xarray as xr import fsspec import dask import s3fs import numpy as np xr.set_options(display_style="html") #display dataset nicely #ds = xr.open_zarr('https://era5-pds.s3.us-east-1.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
``` %%HTML <style> div#notebook-container.container { /* This acts as a spacer between cells, that is outside the border */ margin: 2px 0px 2px 0px; list-style: none; padding: 0; margin: 0; -ms-box-orient: horizontal; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -moz...
github_jupyter
``` from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import pandas as pd import numpy as np import pkg_resources import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import model_bias_analysis # autoreload makes it easier to i...
github_jupyter
# Python: Handling missing values **Goal**: Clean and organise your data! <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Introduction-to-dataset" data-toc-modified-id="Introduction-to-dataset-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Introduct...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat %matplotlib inline h = 10 x = y = np.array([h*i for i in range(64)]) das_template_x = np.array([5*np.sqrt(2)*i for i in range(12)]) das_template_y = np.array([5*np.sqrt(2)*i for i in range(12)]) das_template_x2 = np.hstack([das_template...
github_jupyter
# 05 - PCCA and TPT analysis <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" title='This work is licensed under a Creative Commons Attribution 4.0 International License.' align="right"/...
github_jupyter
# 🎯 Uplift modeling `metrics` <br> <center> <a href="https://colab.research.google.com/github/maks-sh/scikit-uplift/blob/master/notebooks/uplift_metrics_tutorial.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg"> </a> <br> <b><a href="https://github.com/maks-sh/scikit...
github_jupyter
## Example: Joint inference of $p(G, \Theta | \mathcal{D})$ for Gaussian Bayes nets Setup for Google Colab. Selecting the **GPU** runtime available in Google colab will make inference significantly faster. ``` %cd /content !git clone https://github.com/larslorch/dibs.git %cd dibs %pip install -e . --quiet ``` DiBS t...
github_jupyter
``` #import csv from the dataset import pandas as pd df=pd.read_csv('c:/Users/Raghav.sharma/Desktop/dmLab/combinedfile2.csv') df.head() import matplotlib.pyplot as plt import seaborn as sns sns.set(font_scale=1) df1= corr=df.loc[:,["GENDER","RACE","ETHNIC","EDUC","EMPLOY","LIVARAG","PRIMINC","ARRESTS","STFIPS","REGION"...
github_jupyter
<a href="https://colab.research.google.com/github/maiormarso/DS-Unit-2-Linear-Models/blob/master/module2-regression-2/LS_DS9_212_assignment_regression_classification_2_(1).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Lambda School Data Science *...
github_jupyter
``` import torch import pandas as pd import numpy as np import seaborn as sns import os sns.set(style="darkgrid") import matplotlib.pyplot as plt from glob import glob %matplotlib inline def get_title(filename): """ >>> get_title("logs/0613/0613-q1-0000.train") '0613-q1-0000' """ return os.path.s...
github_jupyter
## Learning the Alphabet This is an example of a simple [LSTM](https://en.wikipedia.org/wiki/Long_short-term_memory) that is powerful enough to learn the alphabet. It is trained with strings that look like the alphabet. While this seems trivial, RNNs are capable of learning more complex text sequences, such as the wo...
github_jupyter
# NetCDF files NetCDF is a binary storage format for many different kinds of rectangular data. Examples include atmosphere and ocean model output, satellite images, and timeseries data. NetCDF files are intended to be device independent, and the dataset may be queried in a fast, random-access way. More information abo...
github_jupyter
# Relationship Extraction In this notebook, we'll train, deploy and use an relationship extraction model using transformers from the [transformers](https://huggingface.co/transformers/) library which uses PyTorch. **Note**: When running this notebook on SageMaker Studio, you should make sure the 'SageMaker JumpStart ...
github_jupyter
``` %matplotlib inline import importlib, utils2; importlib.reload(utils2) from utils2 import * np.set_printoptions(4) cfg = K.tf.ConfigProto(gpu_options={'allow_growth':True}) K.set_session(K.tf.Session(config=cfg)) def tokenize(sent): return [x.strip() for x in re.split('(\W+)?', sent) if x.strip()] def parse_stor...
github_jupyter