text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
<img src="logos/Icos_cp_Logo_RGB.svg" width="400" align="left"/> <img src="logos/NOAA_logo.png" width="90" align="right"/> <a id='introduction'></a> <br> # Curve fitting methods for CO$_2$ time series This notebook includes examples of curve fitting methods for time series. For more detailed information regarding ...
github_jupyter
``` # 3rd Party from baybars.timber import get_logger import numpy as np import tensorflow as tf LABEL_MAP = { 0: 'T-shirt/top', 1: 'Trouser', 2: 'Pullover', 3: 'Dress', 4: 'Coat', 5: 'Sandal', 6: 'Shirt', 7: 'Sneaker', 8: 'Bag', 9: 'Ankle boot', } class UnsupportedModeException(Exception): p...
github_jupyter
## _*BeH2 plots of various orbital reduction results*_ This notebook demonstrates using the Qiskit Aqua Chemistry to plot graphs of the ground state energy of the Beryllium Dihydride (BeH2) molecule over a range of inter-atomic distances using ExactEigensolver. Freeze core reduction is true and different virtual orbit...
github_jupyter
# 第二讲 - 矩阵消元及其与矩阵乘法的关系 - 消元法解方程组 - 矩阵简化 - 反向替代 - 矩阵乘法 ## 消元法解方程组 $$x+2y+z=2\quad(1)\\3x+8y+z=12\quad(2)\\4y+z=2\quad(3)$$ 提取出矩阵: $$A=\begin{bmatrix}1&2&1\\3&8&1\\0&4&1\end{bmatrix}$$ 下面先做一些初始化工作: ``` import numpy as np from sympy import * init_printing() x, y, z = symbols('x y z') lhs = (x + 2*y + z, 3*x + 8*y +...
github_jupyter
## PCA and other test on the computed Dataframe ``` import pandas as pd import operator import numpy as np %matplotlib inline import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns; sns.set() from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn.pr...
github_jupyter
``` # ms-python.python added import os try: os.chdir(os.path.join(os.getcwd(), 'day 11')) print(os.getcwd()) except: pass from computerrefractored import Computer import matplotlib.pyplot as plt from collections import defaultdict import numpy as np from collections import namedtuple def dimensions(obj): minim =...
github_jupyter
``` # default_exp desc.stats ``` # Exploration Statistics > This module comprises all the functions for calculating descriptive statistics. ``` !pip install dit !pip install sentencepiece # export # Imports from scipy.stats import sem, t, median_abs_deviation as mad from statistics import mean, median, stdev import ...
github_jupyter
``` import pickle import boto3 import pandas as pd import numpy as np import matplotlib.pyplot as plt from pyspark.sql import SparkSession sc = spark.sparkContext from pyspark.sql import SQLContext from pyspark.sql import functions as F from pyspark.sql.window import Window from pyspark.sql.types import IntegerType, St...
github_jupyter
``` # Copyright 2019 Google Inc. 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 applicable law...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import cPickle as pickle import codecs import skfuzzy as fuzz import time from matplotlib import pyplot as plt from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import pickle from glob import glob import re from concurrent.futures import ProcessPoolExecutor, as_completed import numpy as np import pandas as pd from scipy import stats from sklearn.metrics import pairwise_distances import settings as conf output_dir = os.path.joi...
github_jupyter
# Movie Ratings Network This notebook is used to create the movie networks based on the ratings. It use the same approach as suggested in [[1](https://arxiv.org/pdf/1408.1717.pdf)] ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt DATA_PATH = '../data/ml-100k-convert/' GENERATED_PATH = '../g...
github_jupyter
# Setup ## Imports ``` import os.path from glob import glob from tqdm import tqdm_notebook from sklearn.metrics import confusion_matrix from vaiutils import path_consts, smooth_plot, plot_images from vaidata import pickle_load, pickle_dump from keras.preprocessing.text import Tokenizer from keras.utils.np_utils impo...
github_jupyter
# Models and Maps ## Models Let's again consider the car dataset from second notebook. In that notebook we plotted *qsec* as a function of *hp*. However we might be interested a better model. Let's load the data. ``` library(tidyverse) data(mtcars) mtcars_tbl <- as_tibble(rownames_to_column(mtcars,var='model')) ...
github_jupyter
``` import modin.pandas as pd import nums import nums.numpy as nps nums.init() ``` # Preparation ### Load and preprocess dataset with Modin. ``` %%time higgs_train = pd.read_csv("training.zip") higgs_train.loc[higgs_train['Label'] == 'b', 'Label'] = 0 higgs_train.loc[higgs_train['Label'] == 's', 'Label'] = 1 higgs_t...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/tutorials/machine-learning-pipelines-advanced/tutorial-pipeline-batch-scoring-classification.png) # Use Azure Machine ...
github_jupyter
``` import pandas as pd import os import pickle import numpy as np import scipy.sparse as sp import scipy.io as spio import matplotlib.pyplot as plt import matplotlib.cm as cm import isolearn.io as isoio import isolearn.keras as iso import scipy.optimize as spopt from scipy.stats import pearsonr from analyze_rand...
github_jupyter
## Batched example 2 This notebook is the second of a series that shows how [GSSHA_Workflow.ipynb](../GSSHA_Workflow.ipynb) can be parameterized at the command line that builds on [GSSHA_Workflow_Batched_Example1](GSSHA_Workflow_Batched_Example1.ipynb). This notebook uses the same principles as the first example but m...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # BlackHoles@Home Tutorial: Compiling the `BOINC` server on...
github_jupyter
``` # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
github_jupyter
# Calculate performance of signature Gregory Way, 2021 I previously identified a series of morphology features that were significantly different between sensitive and resistant clones. I also applied this signature to all profiles from training, testing, validation, and holdout sets. Here, I evaluate the performance ...
github_jupyter
# Parametrized Sequences ``` import numpy as np import pulser from pulser import Pulse, Sequence, Register from pulser.waveforms import RampWaveform, BlackmanWaveform, CompositeWaveform from pulser.devices import Chadoq2 ``` From simple sweeps to variational quantum algorithms, it is often the case that one wants to ...
github_jupyter
# Saddle plot ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline import bioframe import cooler import cooltools import cooltools.eigdecomp import cooltools.expected import cooltools.saddle # download a Hi-C dataset from Schwarzer et.al. "Two independent modes of chromosome organization are r...
github_jupyter
``` import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import argparse import time import os #setup training parameters parser = argparse.ArgumentParser(description='PyTorch MNIST Training') parser.add_argument('--batch-size', typ...
github_jupyter
# Evaluation The evaluation strategy is as follows. There are 30 classes of images in the RSICD dataset. We construct a synthetic set of captions that use the pattern "An arial photograph of a `class_type`" for each of the 30 classes. We feed each image and the synthetic captions into the model under evaluation, and g...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.naive_bayes import GaussianNB from sklearn.naive_bayes import MultinomialNB from sklearn.metrics import classification_report, confusion_matrix from sklearn.svm import SVC from sklearn.linear_model...
github_jupyter
``` # from utils import * import os os.chdir("../../scVI/") os.getcwd() import pickle import numpy as np import pandas as pd from copy import deepcopy save_path = '../CSF/Notebooks/' celllabels = np.load(save_path + 'meta/celllabels.npy') celltypes, labels = np.unique(celllabels,return_inverse=True) # from numpy i...
github_jupyter
## BiRNN Overview <img src="https://ai2-s2-public.s3.amazonaws.com/figures/2016-11-08/191dd7df9cb91ac22f56ed0dfa4a5651e8767a51/1-Figure2-1.png" alt="nn" style="width: 600px;"/> References: - [Long Short Term Memory](http://deeplearning.cs.cmu.edu/pdfs/Hochreiter97_lstm.pdf), Sepp Hochreiter & Jurgen Schmidhuber, Neur...
github_jupyter
``` # connect to google colab from google.colab import drive drive.mount("/content/drive") # base path DATA_PATH = './drive/MyDrive/fyp-code/codes/data/emotion_classification/' import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix, cohen_kappa_score import seaborn as sns ``` ## Import the...
github_jupyter
# test note * jupyterはコンテナ起動すること * テストベッド一式起動済みであること ``` !pip install --upgrade pip !pip install --force-reinstall ../lib/ait_sdk-0.1.3-py3-none-any.whl from pathlib import Path import pprint from ait_sdk.test.hepler import Helper import json # settings cell # mounted dir root_dir = Path('/workdir/root/ait') ait_n...
github_jupyter
# Relation extraction with BERT --- The goal of this notebook is to show how to use [BERT](https://arxiv.org/abs/1810.04805) to [extract relation](https://en.wikipedia.org/wiki/Relationship_extraction) from text. Used libraries: - [PyTorch](https://pytorch.org/) - [PyTorch-Lightning](https://pytorch-lightning.readth...
github_jupyter
``` import pandas as pd import numpy as np import nltk import json import re from sentence_transformers import SentenceTransformer from itertools import islice, cycle from pynndescent import NNDescent from collections import Counter from functools import reduce nltk.download('stopwords') nltk.download('punkt') item_da...
github_jupyter
# Part 12.2: Introduction to Q-Learning Q-Learning is a foundational technique upon which deep reinforcement learning is based. Before we explore deep reinforcement learning, it is essential to understand Q-Learning. Several components make up any Q-Learning system. * **Agent** - The agent is an entity that exists ...
github_jupyter
# Groupby と Resample - 参照 - [Group by: split-apply-combine — pandas 1.4.1 documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#group-by-split-apply-combine) - [Resampling — pandas 1.4.1 documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resamp...
github_jupyter
# Python Tutorial for Data Science ## Introduction to Machine Learning: Classification with k-Nearest Neighbors #### (Adapted from Data 8 Fall 2017 Project 3) #### Patrick Chao 1/21/18 # Introduction The purpose of this notebook is to serve as an elementary python tutorial introducing fundamental data science concept...
github_jupyter
# Python Basics Prepared by: Nickolas K. Freeman, Ph.D. This notebook provides a very basic introduction to the Python programming language. The following description of the Python language was taken from https://en.wikipedia.org/wiki/Python_(programming_language) on 1/6/2018, and serves as a good introduction to the ...
github_jupyter
# T2 - Calibration Models are simplifications of the real world, and quantities in the model (like the force of infection) represent the aggregation of many different factors. As a result, there can be uncertainty as to what value of the parameters most accurately reflects the real world - for instance, the population...
github_jupyter
# Module 1: Introduction to Exploratory Analysis <a href="https://drive.google.com/file/d/1r4SBY6Dm6xjFqLH12tFb-Bf7wbvoIN_C/view" target="_blank"> <img src="http://www.deltanalytics.org/uploads/2/6/1/4/26140521/screen-shot-2019-01-05-at-4-48-15-pm_orig.png" width="500" height="400"> </a> [(Page 17)](https://driv...
github_jupyter
# Pseudomonas experiment level analysis Main notebook to run experiment-level simulation experiment using *P. aeruginosa* gene expression data. ``` %load_ext autoreload %autoreload 2 import os import sys import ast import pandas as pd import numpy as np import random from plotnine import (ggplot, ...
github_jupyter
``` !pip install -Uq catalyst gym ``` # Seminar. RL, DQN. Hi! In the first part of the seminar, we are going to introduce one of the main algorithm in the Reinforcment Learning domain. Deep Q-Network is the pioneer algorithm, that amalmagates Q-Learning and Deep Neural Networks. And there is small review on gym envir...
github_jupyter
<a href="https://colab.research.google.com/github/Espanta/handson-ml/blob/master/Learning3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### Your name: <pre> Your Name </pre> ### Collaborators: <pre> Collaborators </pre> ``` import numpy as np...
github_jupyter
# Parameter plotting with LiionDB In this notebook we will show how to plot and compare parameters in a loop. A simplified interactive GUI is available online at [**www.liiondb.com**](www.liiondb.com) --- * LiionDB is a database of DFN-type battery model parameters that accompanies the review manuscript: [**Parameter...
github_jupyter
``` import tensorflow as tf from tensorflow.keras.preprocessing.sequence import pad_sequences from tensorflow.keras.layers import Embedding, LSTM, Dense, Bidirectional from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.models import Sequential from tensorflow.keras.optimizers import Adam i...
github_jupyter
``` import os import time import tensorflow as tf import numpy as np from glob import glob import datetime import random from PIL import Image import matplotlib.pyplot as plt from numpy import savetxt import pandas as pd import sys %matplotlib inline array_sum = [] from google.colab import drive drive.mount('/content/d...
github_jupyter
# Tutorial 7: Estimator ## Overview In this tutorial, we will talk about: * [Estimator API](#t07estimator) * [Reducing the number of training steps per epoch](#t07train) * [Reducing the number of evaluation steps per epoch](#t07eval) * [Changing logging behavior](#t07logging) * [Monitoring intermediate...
github_jupyter
# PyAutoGUI——让所有GUI都自动化 本教程译自大神[Al Sweigart](http://inventwithpython.com/)的[PyAutoGUI](https://pyautogui.readthedocs.org/)项目,Python自动化工具,更适合处理GUI任务,网页任务推荐: - [Selenium](https://selenium-python.readthedocs.org/)+Firefox记录(Chromedriver和Phantomjs也很给力,Phantomjs虽然是无头浏览器,但有时定位不准),然后用Python写单元测试 - [request](http://www.python...
github_jupyter
``` import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers import RMSprop from keras.utils import np_utils batch_size = 128 num_classes = 10 epochs = 10 # the data, shuffled and split between train and test sets (x_train, y_trai...
github_jupyter
# Creating a Sampled Dataset **Learning Objectives** - Sample the natality dataset to create train/eval/test sets - Preprocess the data in Pandas dataframe ## Introduction In this notebook we'll read data from BigQuery into our notebook to preprocess the data within a Pandas dataframe. ``` PROJECT = "cloud-training...
github_jupyter
# Étiquetage morpho-syntaxique ## Définition Opération par laquelle un programme associe automatiquement à un mot des étiquettes grammaticales, comme : - le genre - le nombre - la partie du discours (catégorie) - … Elle intervient après celle de segmentation en mots et se positionne comme pré-requis pour l’analyse s...
github_jupyter
# Initial Setup ``` import pyspark import pandas as pd import numpy as np from pyspark.ml.recommendation import ALSModel, ALS from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam from sklearn.preprocessing import OneHotEncoder, StandardScaler spark = pyspark.sql.Spar...
github_jupyter
``` import numpy as np import pandas as pd class PastSampler: ''' Forms training samples for predicting future values from past value ''' def __init__(self, N, K, sliding_window = True): ''' Predict K future sample using N previous samples ''' self.K = K s...
github_jupyter
## Using Random EMA to check End-of-Day: Exploratory Data Analysis - This notebook is dedicated to understanding End-of-Day EMA using Random EMA - For every Random EMA where the response is 'Yes', check to see + What is the fraction where the user clicked correct hour + What is the fraction where the user clic...
github_jupyter
<img src="http://akhavanpour.ir/notebook/images/srttu.gif" alt="SRTTU" style="width: 150px;"/> [![Azure Notebooks](https://notebooks.azure.com/launch.png)](https://notebooks.azure.com/import/gh/Alireza-Akhavan/class.vision) # <div style="direction:rtl;text-align:right;font-family:B Lotus, B Nazanin, Tahoma">عملیات بی...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import scipy from scipy import ndimage from sklearn.datasets import fetch_openml mnist = fetch_openml('mnist_784') x = mnist.data y = mnist.target e_k = np.zeros_like(x) s_k = np.zeros_like(x) n_k = np.zeros_like(x) nw_k = np.zeros_like(x) ne_k = np.zeros_like(x) s...
github_jupyter
``` #notebook to fetch reanalysis used in example import cdsapi import pyart import os import sys import netCDF4 import xarray as xr from matplotlib import pyplot as plt %matplotlib inline #NOTE.. you need a key from ECMWF #populate ~/.cdsapirc with #url: https://cds.climate.copernicus.eu/api/v2 #key: YOURKEYHASH de...
github_jupyter
### 1. Setting up the meta-BO environment ``` from matplotlib import pyplot as plt from meta_bo.meta_environment import RandomMixtureMetaEnv import numpy as np # setup meta-learning / meta-bo environment rds = np.random.RandomState(456) meta_env = RandomMixtureMetaEnv(random_state=rds) # sample functions / BO tasks ...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm as tqdm %matplotlib inline import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import random # from google.co...
github_jupyter
# 3M1 Introduction to optimization Luca Magri (lm547@cam.ac.uk), office ISO-44, Hopkinson Lab. (With many thanks to Professor Gábor Csányi.) [Booklist](https://www.vle.cam.ac.uk/mod/book/view.php?id=364091&chapterid=49051): - Antoniou, A. & Lu, W.-S. Practical Optimization: Algorithms and Engineering Applications, ...
github_jupyter
# Taxonomy of time series learning tasks * What is machine learning with time series? * How is it different from standard machine learning? ``` import matplotlib.pyplot as plt import numpy as np import pandas as pd %matplotlib inline ``` ## Learning objectives You'll learn about * different time series learning t...
github_jupyter
# Lesson 5: the trouble with slope area *This lesson has been written by Simon M. Mudd at the University of Edinburgh* *Last update 30/09/2021* In the past few lessons, we have learned: * Channels tend to have a higher gradient near their headwaters (i.e., parts of the network with low drainage area). * If the ...
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
``` %reload_ext autoreload %autoreload 2 %matplotlib inline import sys sys.path.append('..') import pdb, sys, inspect from enum import Enum import pandas as pd import torch from transformers import * from fastai2.text.all import * torch.cuda.set_device(1) print(f'Using GPU #{torch.cuda.current_device()}: {torch.cuda...
github_jupyter
<a name="top"></a> <div style="width:1000 px"> <div style="float:right; width:98 px; height:98px;"> <img src="https://raw.githubusercontent.com/Unidata/MetPy/master/src/metpy/plots/_static/unidata_150x150.png" alt="Unidata Logo" style="height: 98px;"> </div> <h1>Plotting on a Map with CartoPy</h1> <h3>Unidata Python ...
github_jupyter
``` %use dataframe, khttp // to see autogenerated code, uncomment the line below: //%trackExecution -generated ``` ## Get Data ``` val response = khttp.get("http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt") val cleanedText = response.text.replace("\"Molly\"", "Molly").replace("row.names", "row").r...
github_jupyter
# Automating GIS-processes - Final work **Aim of the work:** Aim of the final assignment is to apply the programming techniques and skills that we have learned during the course and create a GIS tool called *AccessHandler* (see below instructions). You can choose yourself what tools / techniques / modules you want to...
github_jupyter
``` %matplotlib widget import glob import os from mpl_toolkits.axes_grid1 import make_axes_locatable from astropy.io import fits from astropy.stats import sigma_clipped_stats from astropy.table import Table from astropy.visualization import ImageNormalize, SqrtStretch, LogStretch, LinearStretch, ZScaleInterval, Manual...
github_jupyter
``` import collections as cl import faiss import numpy as np import torch as th from misc import load_sift, save_sift ``` ### Load vectors extracted from fasttext ``` xq = load_sift('../data/siftLSHTC/predictions.hid.fvecs', dtype=np.float32) xb = load_sift('../data/siftLSHTC/predictions.wo.fvecs', dtype=np.float32...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import glob import numpy as np from collections import defaultdict import pickle import os dataset_name = 'fma_small' folder = "../exp/" + dataset_name selected = {'ytc': 5.5, 'fma_small': 7, 'gtzan': 5.8}[dataset_name] df = pd.read_csv(os.path.join(folder, "tf.cs...
github_jupyter
# Particle Swarm Optimization Algorithm (explained with Python!) [SPOILER] We will be using the [Particle Swarm Optimization algorithm](https://en.wikipedia.org/wiki/Particle_swarm_optimization) to obtain the minumum of some test functions ![PSO-2D](img/PSO_Example1.gif) First of all, let's import the libraries we'll...
github_jupyter
### Evaluating Used Cars with Classification #### Introduction In recent years, used car market is getting larger and larger. Many people begin purchasing used cars instead of new cars, since used cars are always cheaper than new cars, and a lot of used cars really have good reliability. However, there are still a bun...
github_jupyter
``` %reload_ext autoreload %autoreload 2 %matplotlib inline import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"; os.environ["CUDA_VISIBLE_DEVICES"]="0"; ``` # QA-Based Information Extraction As of v0.28.x, **ktrain** now includes a “universal” information extractor, which uses a Question-Answering model to extrac...
github_jupyter
``` import sys, os if 'google.colab' in sys.modules: # https://github.com/yandexdataschool/Practical_RL/issues/256 !pip uninstall tensorflow --yes !pip uninstall keras --yes !pip install tensorflow-gpu==1.13.1 !pip install keras==2.2.4 if not os.path.exists('.setup_complete'): !wget...
github_jupyter
``` from tensorflow.keras.layers import Dense Dense(10, activation="relu", kernel_initializer="he_normal") from tensorflow.keras.initializers import VarianceScaling from tensorflow.keras.layers import Dense he_avg_init = VarianceScaling(scale=2., mode='fan_avg', distribution='uniform') D...
github_jupyter
# Transfer Learning A Convolutional Neural Network (CNN) for image classification is made up of multiple layers that extract features, such as edges, corners, etc; and then use a final fully-connected layer to classify objects based on these features. You can visualize this like this: <table> <tr><td rowspan=2 st...
github_jupyter
# Kernel PCA ## Importing the libraries ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd ``` ## Importing the dataset ``` dataset = pd.read_csv('Wine.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, -1].values ``` ## Splitting the dataset into the Training set and Test set ``` f...
github_jupyter
# Metacells Vignette This vignette demonstrates step-by-step use of the metacells package to analyze scRNA-seq data. The latest version of this vignette is available in [Github](https://github.com/tanaylab/metacells/blob/master/sphinx/Manual_Analysis.rst). ## Preparation First, let's import the Python packages we'll...
github_jupyter
## cloudFPGA Studio ### Case study: Harris Corner Detector (Computer Vision) - NumpPy version with camera loop ### You don't need FPGA knowledge, just basic Python syntax !!! Note: Assuming that the FPGA is already flashed Configure the Python path to look for FPGA aceleration library ``` import time import sys impo...
github_jupyter
<a href="https://colab.research.google.com/github/maxigaarp/Gestion-De-Datos-en-R/blob/main/Clase_7_y_8_Depuracion_en_SQL.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` system("gdown https://drive.google.com/uc?id=1q089qSqKr7Ak29lUkzKSWjm2pcb_j...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np ``` Training and Testing Data ===================================== To evaluate how well our supervised models generalize, we can split our data into a training and a test set: <img src="figures/train_test_split_matrix.svg" width="100%"> ``` ...
github_jupyter
# Introduction In this notebook, we'll assign documents to domains in RDoC with the highest Dice similarity of their brain structures and mental function terms. # Load the data ``` import pandas as pd import numpy as np import sys sys.path.append("..") import utilities, partition framework = "rdoc" ``` ## Brain ac...
github_jupyter
# IBM Db2 Event Store - Data Analytics using Python API IBM Db2 Event Store is a hybrid transactional/analytical processing (HTAP) system. It extends the Spark SQL interface to accelerate analytics queries. This notebook illustrates how the IBM Db2 Event Store can be integrated with multiple popular scientific tool...
github_jupyter
<img style="float: center;" src="images/CI_horizontal.png" width="600"> <center> <span style="font-size: 1.5em;"> <a href='https://www.coleridgeinitiative.org'>Website</a> </span> </center> Ghani, Rayid, Frauke Kreuter, Julia Lane, Adrianne Bradford, Alex Engler, Nicolas Guetta Jeanrenaud, Graham Henke...
github_jupyter
``` ##### from collections import OrderedDict ## Pandas import pandas as pd from IPython.display import display from IPython.display import HTML from pandas.io.json import json_normalize pd.set_option('max_colwidth',255) pd.set_option('max_columns',10) #### Prep for the presentation ### Authenticate to Ambari #### Py...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import pandas as pd plt. clf() plt.figure(figsize=(15,10)) meanViola1 = np.array([76.712204564012, 271.962595069704, 104.464056106481]) medianViola1 = np.array([87.2101204224871, 267.298392954475, 73.4574594321263]) firstQtViola1 = np.array([66.392424612713, 188.28...
github_jupyter
# Assignment 3 All questions are weighted the same in this assignment. This assignment requires more individual learning then the last one did - you are encouraged to check out the [pandas documentation](http://pandas.pydata.org/pandas-docs/stable/) to find functions or methods you might not have used yet, or ask quest...
github_jupyter
``` import tabint from tabint.utils import * from tabint.dataset import * from tabint.feature import * from tabint.pre_processing import * from tabint.visual import * from tabint.learner import * from tabint.interpretation import * from tabint.inference import * from tabint.model_performance import * data = pd.read_csv...
github_jupyter
# Práctico 2: Recomendación de videojuegos En este práctico trabajaremos con un subconjunto de datos sobre [videojuegos de Steam](http://cseweb.ucsd.edu/~jmcauley/datasets.html#steam_data). Para facilitar un poco el práctico, se les dará el conjunto de datos previamente procesado. En este mismo notebook mostraremos el...
github_jupyter
<!--NAVIGATION--> <| [Main Contents](Index.ipynb) |> # Appendix: The computing Miniproject <span class="tocSkip"><a name="Apx:Miniproj"></a> <h1>Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Objectives" data-toc-modified-id="Objectives-1">Objectives</a></span></...
github_jupyter
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> Path Element</dd> <dt>Dependencies</dt> <dd>Matplotlib</dd> <dt>Backends</dt> <dd><a href='./Path.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/Path.ipynb'>Bokeh</a></dd> </dl> </div> ``` import ...
github_jupyter
<h1 align="center">TensorFlow Neural Network Lab</h1> <img src="image/notmnist.png"> In this lab, you'll use all the tools you learned from *Introduction to TensorFlow* to label images of English letters! The data you are using, <a href="http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html">notMNIST</a>, consi...
github_jupyter
``` from jupyter_innotater import * import numpy as np, os ``` ## Save button calls your supplied Python function ``` foodfns = sorted(os.listdir('./foods/')) targets = np.zeros((len(foodfns), 4), dtype='int') # (x,y,w,h) for each data row def my_save_hook(uindexes): np.savetxt("foodboxes.csv", targets, delimite...
github_jupyter
## Plots comparison of interpretability performance for CNNs with log-based activations Figures generated in this notebook: - Supplementary Fig. 11 ``` import os import numpy as np from six.moves import cPickle import matplotlib.pyplot as plt import helper from tfomics import utils results_path = os.path.join('../re...
github_jupyter
``` %load_ext autoreload %autoreload 2 from synthpop.census_helpers import Census from synthpop import categorizer as cat import pandas as pd import numpy as np import os pd.set_option('display.max_columns', 500) ``` ## The census api needs a key - you can register for can sign up ### http://api.census.gov/data/key_s...
github_jupyter
#### Copyright 2017 Google LLC. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
github_jupyter
``` import pandas import numpy as np import matplotlib.pyplot as plt; plt.rcdefaults() import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import confusion_matrix from collections import defaultdict, Counter, OrderedDict from operator import itemgetter import codecs import csv import itertools...
github_jupyter
<small><small><i> All the IPython Notebooks in **Python Introduction** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/01_Python_Introduction)** </i></small></small> # Python Variables and Constants In this class, you will learn about Python variables, constants, literals and...
github_jupyter
# Mini-batching In its purest form, online machine learning encompasses models which learn with one sample at a time. This is the design which is used in `river`. The main downside of single-instance processing is that it doesn't scale to big data, at least not in the sense of traditional batch learning. Indeed, proc...
github_jupyter
``` from models.DistMult import DistMult_Lite from models.Complex import Complex from models.ConvE import ConvE, ConvE_args from utils.loaders import load_data, get_onehots from utils.evaluation_metrics import SRR, auprc_auroc_ap import torch import numpy as np from sklearn.utils import shuffle from tqdm import tqdm ...
github_jupyter
# Quick Start Tutorial The GluonTS toolkit contains components and tools for building time series models using MXNet. The models that are currently included are forecasting models but the components also support other time series use cases, such as classification or anomaly detection. * 基于MXNet * 包含了预测模型,也支持其他类型的时序预测...
github_jupyter
# Mixup data augmentation ``` from fastai.gen_doc.nbdoc import * from fastai.callbacks.mixup import * from fastai.vision import * from fastai import * ``` ## What is Mixup? This module contains the implementation of a data augmentation technique called [Mixup](https://arxiv.org/abs/1710.09412). It is extremely effic...
github_jupyter