text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Bandits from Logged Data - M. Dudik J. Langford, and L. Li, "[Doubly Robust Policy Evaluation and Learning](https://arxiv.org/abs/1103.4601)" (2017). - A. Swaminathan and T. Joachims, "[The Self-Normalized Estimator for Counterfactual Learning](https://www.microsoft.com/en-us/research/publication/self-normalized-es...
github_jupyter
``` import numpy as np import copy import matplotlib.pyplot as plt %matplotlib nbagg from chickpea import Waveform, Element, Sequence, Segment ``` ## Introducing: Segments A segment is part of a 'waveform' which represents a time slice on one channel of waveform generator with up to two markers also specified. Many s...
github_jupyter
# Семинар 10 # Оптимизация на множествах простой структуры ## На прошлом семинаре... - Метод Ньютона - Квазиньютоновские методы ## Методы решения каких задач уже известны или скоро будут известны - Безусловная минимизация: функция достаточно гладкая, но ограничений на аргумент нет. - Линейное программирование: лине...
github_jupyter
### Thickness budget in temperature space ``` %load_ext autoreload %autoreload 2 import xarray as xr import numpy as np from matplotlib import pyplot as plt import budgetcalcs as bc import calc_wmt as wmt import datetime #import cftime rootdir = '/archive/gam/MOM6-examples/ice_ocean_SIS2/Baltic_OM4_025/1yr/' averaging...
github_jupyter
ML Course, Bogotá, Colombia (© Josh Bloom; June 2019) ``` %run ../talktools.py ``` ## Generative Adversarial Networks One of the downsides of VAEs is that the generated samples are interpolated between real samples as you walk through the latent space. This can lead to unrealistic looking images (what's half w...
github_jupyter
# Data Preparation: MCI Patient Selection ADNIMERGE patient selection according to Massi's R screening file. This notebook is to serve as to get familiar with the ADNI dataset, the ADNIMERGE file, and select the MCI patients of interest for our models. Massi used the RID variable to see which rows refers to the same ...
github_jupyter
### Loading common data formats [**Neal Caren**](mailto:neal.caren@gmail.com) University of North Carolina, Chapel Hill It is possible to turn many sorts of data into a Pandas dataframe for subsequent anaysis. The most basic method is reading comma-delimited text files, or csv files. This is accomplished with t...
github_jupyter
# Machine Learning API > ICDSS Machine Learning Workshop Series: Coding Models on `scikit-learn`, `keras` & `fbprophet` * [Pipeline](#pipeline) * [Preprocessing](#pipe:preprocessing) * [Estimation](#pipe:estimation) * [Supervised Learning](#pipe:supervised-learning) * [Unsupervised Learning](#...
github_jupyter
This notebook contains an example of using `redbiom` through it's Python API to extract a subset of American Gut Project samples. These data are then loaded into QIIME 2 for a mini beta-diversity analysis using UniFrac. This assumes we're using a QIIME 2 2018.11 environment that additionally has `redbiom` 0.3.0 install...
github_jupyter
# Update Vaccination Data in ArcGIS Online from GitHub This script will help you automatically update the data within your ArcGIS Online account that we uploaded from the [Publishing Vaccination Data from GitHub to ArcGIS](Get to Publish World Vaccination Data.ipynb) tutorial. The only thing you need to change **if ...
github_jupyter
# Black Scholes Exercise 6: MPI implementation Use MPI to parallelize and distribute the work ``` # Boilerplate for the example import cProfile import pstats import numpy as np try: import numpy.random_intel as rnd except: import numpy.random as rnd # make xrange available in python 3 try: xrange except...
github_jupyter
``` import warnings warnings.filterwarnings("ignore") import torchaudio as ta ta.set_audio_backend("sox_io") import torch from torch.utils.data import DataLoader import torch.nn as nn import torch.nn.functional as F import torch.autograd.profiler as profiler # import pytorch_lightning as pl import numpy as np import ...
github_jupyter
``` %matplotlib inline import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import glob import pickle import operator import matplotlib import scipy.stats as stats import statsmodels.stats.multitest as multi from itertools import chain from sklearn.preprocessing import ...
github_jupyter
# Azure Monitor Log Analytics Workspace Summary Get a birds-eye view of the utilization and cost of your Log Analytics workspaces. ## Parameters **resource_filter**: Optional KQL where clause to limit Azure Monitor workspace resources in scope. ``` resource_filter = None ``` ## Setup ``` from azmeta.access import...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import numpy as np ``` ### Scatterplot Cost Model ``` from numpy import dtype cardinality = { 'dummyfloat1': 1, 'dummyfloat2': 1, 'id': 48895, 'name': 47906, 'host_id': 37457, 'host_name': 11453, 'neighbourhood_group': 5, 'neighbourhood': 221, 'latitude...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path from fetch import get_onedrive_directlink, fetch_beijing_AQ_data, fetch_flue_gas_data ``` ## Beijing Air Quality Dataset https://archive.ics.uci.edu/ml/datasets/Beijing+Multi-Site+Air-Quality+Data...
github_jupyter
# Display a circuit that runs a Teleport circuit This sample visualizes the trace of a quantum program that runs a Teleport circuit. First, import the widget: ``` from quantum_viz import Viewer ``` The below cell creates a trace for a Teleport circuit. ``` teleport = { "qubits": [ { "id": 0...
github_jupyter
``` import tensorflow as tf import numpy as np import keras import pandas as pd import matplotlib.pyplot as plt from sklearn.utils import shuffle import os import cv2 import random import keras.backend as K import sklearn %matplotlib inline # train_no = int(len(train_data)*0.9) # training_data = train_data[:train_no] #...
github_jupyter
# _*Vehicle Routing*_ ## The Introduction Logistics is a major industry, with some estimates valuing it at USD 8183 billion globally in 2015. Most service providers operate a number of vehicles (e.g., trucks and container ships), a number of depots, where the vehicles are based overnight, and serve a number of client...
github_jupyter
# Residual Analysis By Chris Fenaroli and Max Margenot Part of the Quantopian Lecture Series: * [www.quantopian.com/lectures](https://www.quantopian.com/lectures) * [github.com/quantopian/research_public](https://github.com/quantopian/research_public) --- ## Linear Regression Linear regression is one of our m...
github_jupyter
``` import pandas as pd import numpy as np import scanpy as sc import os from sklearn.cluster import KMeans from sklearn.cluster import AgglomerativeClustering from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import adjusted_mutual_info_score from sklearn.metrics.cluster import homog...
github_jupyter
``` import pandas as pd import numpy as np import os import pickle import platform from sklearn.preprocessing import StandardScaler from mabwiser.mab import MAB, LearningPolicy from mabwiser.linear import _RidgeRegression, _Linear class LinTSExample(_RidgeRegression): def predict(self, x): if self.scaler ...
github_jupyter
``` import numpy as np ``` ### Create an array from an iterable Such as - ```list``` - ```tuple``` - ```range``` iterator Notice that not all iterables can be used to create a numpy array, such as ```set``` and ```dict``` ``` arr = np.array([1,2,3,4,5]) print(arr) arr = np.array((1,2,3,4,5)) print(arr) arr = np.arra...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
<h1> Getting started with TensorFlow </h1> In this notebook, you play around with the TensorFlow Python API. ``` import tensorflow as tf import numpy as np print tf.__version__ ``` <h2> Adding two tensors </h2> First, let's try doing this using numpy, the Python numeric package. numpy code is immediately evaluated...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
##### 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
# KDD Cup 1999 Data http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html ``` import pandas as pd import matplotlib.pyplot as pyplot from sklearn import datasets import sklearn.preprocessing as sp from sklearn.externals import joblib % matplotlib inline ``` |ファイル名|ファイル内容| |---|---| |kddcup.data|フルデータ| |kddcup.dat...
github_jupyter
``` import pandas as pd import numpy as np from google.colab import files uploaded = files.upload() data_pd = pd.read_csv('WA_Fn-UseC_-Telco-Customer-Churn.csv', index_col=False) df = data_pd for col_name in df.columns: if(df[col_name].dtype == 'object'): df[col_name]= df[col_name].astype('category') ...
github_jupyter
<a href="https://colab.research.google.com/github/keivanipchihagh/Google-ML-Crash-Course/blob/master/NumPy_UltraQuick_Tutorial.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Copyright 2020 Google LLC. Double-click here for license infor...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Rishit-dagli/TFUG-Mysuru-2020/blob/master/TFQuantum_starter.ipynb) # Getting started with [TensorFlow Quantum](https://www.tensorflow.org/quantum) In this notebook you will build your first hybrid qua...
github_jupyter
# Matrix Factorization for Recommender Systems - Part 1 **Table of contents of this tutorial series on matrix factorization for recommender systems:** - [Part 1 - Traditional Matrix Factorization methods for Recommender Systems](/examples/matrix-factorization-for-recommender-systems-part-1) - [Part 2 - Factorization ...
github_jupyter
# Preparing the data ``` # Importing the libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt # Loading the data # https://archive.ics.uci.edu/ml/datasets/statlog+(australian+credit+approval) df = pd.read_csv("Credit_Card_Applications.csv") df.head() # Split the data X = df.iloc[:, :-1].va...
github_jupyter
<img src="https://firebasestorage.googleapis.com/v0/b/deep-learning-crash-course.appspot.com/o/Logo.png?alt=media&token=06318ee3-d7a0-44a0-97ae-2c95f110e3ac" width="100" height="100" align="right"/> ## 4 Neural Networks in TensorFlow - Advanced Techniques <img src="https://firebasestorage.googleapis.com/v0/b/deep-lea...
github_jupyter
# Nettoyage du text Etapes de néttoyage: 1. Mettre en minuscle le texte 2. Enlever les contractions 3. Enlever les espaces 4. Tokeniser le texte 5. Lemmatiser les mots 6. Enlever les éléments ininteréssant (chiffres, ponctuation, mots non anglais et lettres isolées) ``` import pickle import re import string import wa...
github_jupyter
# First steps with `funflow` ## Introduction `funflow` is a Haskell library for defining and running _workflows_. A workflow specifies a pipeline of _tasks_ structured in a Direct Acyclic Graph (DAG). Workflows in `funflow` have the great property of being __composable__ which means that you can easily share and ...
github_jupyter
# Create a month/day by Year view of the daily sea ice index data. ``` tmp_dir = "../data" !mkdir -p ../data !wget -P ../data -qN ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02135/north/daily/data/NH_seaice_extent_final.csv !wget -P ../data -qN ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02135/north/daily/data/NH_se...
github_jupyter
# Geodatenhandling 2 **Inhalt:** Geopandas für Fortgeschrittene **Nötige Skills** - Basic pandas skills - Funktionen und pandas - Erste Schritte mit Geopandas - Geodatenhandling 1 **Lernziele** - Punkte, Linien, Polygone revisited - Eigenschaften von geometrischen Shapes - Shapes modifizieren und kombinieren - Geoda...
github_jupyter
# 1. DATA TYPES ![image.png](attachment:image.png) <a name='variables'></a>Variables === A variable holds a value. Python automatically assign type to a variable based on the values <a name='example'></a>Example --- ``` message = "Hello Python world!" print(message) type(message) ``` A variable holds a value. You...
github_jupyter
##### Copyright 2020 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# Basic Bayesian Linear Regression Implementation ``` # Pandas and numpy for data manipulation import pandas as pd import numpy as np # Matplotlib and seaborn for visualization import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns # Linear Regression to verify implementation from sklearn.linear_...
github_jupyter
# Padim Example #### Import dependencies ``` import os import anodet import numpy as np import torch import cv2 from torch.utils.data import DataLoader import matplotlib.pyplot as plt ``` # ## Training In this notebook the MVTec dataset will be used. It can be downloaded from: https://www.mvtec.com/company/resear...
github_jupyter
# Flax Basics This notebook will walk you through the following workflow: * Instantiating a model from Flax built-in layers or third-party models. * Initializing parameters of the model and manually written training. * Using optimizers provided by Flax to ease training. * Serialization of parameters and other...
github_jupyter
``` # Install TensorFlow # !pip install -q tensorflow-gpu==2.0.0-beta1 try: %tensorflow_version 2.x # Colab only. except Exception: pass import tensorflow as tf print(tf.__version__) # More imports from tensorflow.keras.layers import Input, SimpleRNN, GRU, LSTM, Dense, Flatten from tensorflow.keras.models import...
github_jupyter
# Harmonizome ETL: CORUM Created by: Charles Dai <br> Credit to: Moshe Silverstein Data Source: http://mips.helmholtz-muenchen.de/corum/#download ``` # appyter init from appyter import magic magic.init(lambda _=globals: _()) import sys import os from datetime import date import numpy as np import pandas as pd impor...
github_jupyter
# Spam Filtering Using The [Enron Dataset][1] [1]: http://www.aueb.gr/users/ion/data/enron-spam/ ``` from pymldb import Connection mldb = Connection('http://localhost/') ``` Let's start by loading the dataset. We have already merged the different email files in a sensible manner into a .csv file, which we've made ava...
github_jupyter
``` #for Manupulation import numpy as np import pandas as pd #for visulaization import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline #For reading the csv file df = pd.read_csv('TRAIN (2).csv') df.head() df.shape #Creating copy of Train Data Set data = df.copy() df.isnull().sum() df.describe().tra...
github_jupyter
# Data Analysis ## Link to data: https://www.kaggle.com/fedesoriano/company-bankruptcy-prediction ``` # Import packages import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from pprint import pprint from pickle import dump from ran...
github_jupyter
##### Copyright 2019 The TF-Agents 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
``` # https://www.tensorflow.org/extend/estimators from __future__ import absolute_import from __future__ import division from __future__ import print_function # tensorflow import tensorflow as tf import tensorflow.contrib.rnn as rnn import tensorflow.contrib.learn as tflearn import tensorflow.contrib.layers as tflaye...
github_jupyter
Copyright © 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 # Fleet Maintenance: Build and Import Trained Models into SAS Model Manager This notebook provides an example of how to build and train a Python model and then import the model into SAS Model Manager using t...
github_jupyter
# Quantum jump duration estimation from direct deconvolution of signal ``` import matplotlib.pyplot as plt import numpy as np from uncertainties import unumpy from uncertainties import ufloat %matplotlib inline ``` ## Signal import and frequency analysis ``` data_file = 'data/raw_data/selected_g2/20170529_FWMg2_MP...
github_jupyter
So far, we've only studied word embeddings, where each word is represented by a vector of numbers. For instance, the word cat might be represented as ```python cat = [0.23, 0.10, -0.23, -0.01, 0.91, 1.2, 1.01, -0.92] ``` But how would you represent a **sentence**? There are many different ways to represent sentences...
github_jupyter
``` # Makes print and division act like Python 3 from __future__ import print_function, division # Import the usual libraries import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as mpatches # Enable inline plotting %matplotlib inline from IPython.display import display, Lat...
github_jupyter
## Lesson 6 - Taking Input, Reading and Writing Files, Functions ### Readings * Shaw: [Exercises 11-26](https://learnpythonthehardway.org/python3/ex11.html) * Lutz: Chapters 9, 14-17 ### Table of Contents * [Taking Input](#input) * [Reading Files](#reading) * [Writing Files](#writing) * [Functions](#functions) <a ...
github_jupyter
``` ! git clone https://github.com/singhnaveen098/Hamoye_capstone_project_smote.git train_path = 'Hamoye_capstone_project_smote/Data/train/' val_path = 'Hamoye_capstone_project_smote/Data/val/' test_path = 'Hamoye_capstone_project_smote/Data/test/' import tensorflow as tf import os import matplotlib.pyplot as plt impor...
github_jupyter
# Building a Regression Model for a Financial Dataset In this notebook, you will build a simple linear regression model to predict the closing AAPL stock price. The lab objectives are: * Pull data from BigQuery into a Pandas dataframe * Use Matplotlib to visualize data * Use Scikit-Learn to build a regression model `...
github_jupyter
``` %matplotlib inline ``` # Comparing random forests and the multi-output meta estimator An example to compare multi-output regression with random forest and the `multioutput.MultiOutputRegressor <multiclass>` meta-estimator. This example illustrates the use of the `multioutput.MultiOutputRegressor <multiclass>` ...
github_jupyter
## Overview of the dataframe ``` import pandas #Use pandas to read data from csv file into dataframe #Parse_dates tells df to read particular column as a datetime object column df = pandas.read_csv("reviews.csv", parse_dates=["Timestamp"]) #Access the first 5 elements using .head() df.head() #Tells us shape of the dat...
github_jupyter
# Update the image WCS and coordinates from file using Gaia This notebook shows how to use <a href="https://docs.astropy.org/en/stable/wcs/index.html">astropy.wcs</a> and <a href="https://astroquery.readthedocs.io/en/latest/gaia/gaia.html">astroquery.gaia</a> to update an image WCS using Gaia DR3.<br> The updated WCS ...
github_jupyter
``` import os import numpy as np import pandas as pd import seaborn as sns import matplotlib.pylab as plt import matplotlib from luescher_nd.database.utilities import DATA_FOLDER matplotlib.use("pgf") sns.set( context="paper", style="ticks", font_scale=1/1.7, rc={ # "mathtext.fontset": "cm", ...
github_jupyter
# Computação vetorizada ## Objetivos - Compreender as capacidades da computação vetorizada; - Associar conceitos abstratos de Matemática a estruturas computacionais; - Saber estruturar dados em arrays multidimensionais; ## Introdução A computação científica é uma ciência interdisciplinar que procura resolver probl...
github_jupyter
# Figure 3 Run the steps below to generate the data and plot of Figure 3. **Lennart van Sluijs** // 2019 Jan 8 // Leiden Observatory // vansluijs@strw.leidenuniv.nl ``` #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import numpy as np from astropy.io import fits from sts_class import SpectralTimeSeries fr...
github_jupyter
# CTC Language Model <div class="alert alert-info"> This tutorial is available as an IPython notebook at [malaya-speech/example/ctc-language-model](https://github.com/huseinzol05/malaya-speech/tree/master/example/ctc-language-model). </div> <div class="alert alert-warning"> This module is not language independ...
github_jupyter
# Convolutional Autoencoder ![](https://cdn-images-1.medium.com/max/800/1*LSYNW5m3TN7xRX61BZhoZA.png) In this example we will demonstrate how you can create a convolutional autoencoder in Gluon ``` import random import matplotlib.pyplot as plt import mxnet as mx from mxnet import autograd, gluon ``` ## Data We wi...
github_jupyter
``` import open3d as o3d import numpy as np import copy import os import sys # monkey patches visualization and provides helpers to load geometries sys.path.append('..') import open3d_tutorial as o3dtut # change to True if you want to interact with the visualization windows o3dtut.interactive = not "CI" in os.environ ...
github_jupyter
# AutoKeras **This code worked with the AutoKeras version in Nov 2019 and has since been depreciated. Please refer to the June 2020 version [code/chapter-5/5-autokeras.ipynb](https://github.com/PracticalDL/Practical-Deep-Learning-Book/blob/master/code/chapter-5/5-autokeras.ipynb)** As AI is automating more and more ...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import Dataset, DataLoader fro...
github_jupyter
# Further topics We want to list some further topics of current interest in Scientific Computing that we did not cover in this module. The list can not be exhaustive and there will be things of importance that I am leaving out. But it should give some pointers for those who are interested in diving more into the resea...
github_jupyter
# Notebook 3: Bayesian Statistics [Bayesian Decision Analysis](https://allendowney.github.io/BayesianDecisionAnalysis/) Copyright 2021 Allen B. Downey License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) ``` import numpy as np import...
github_jupyter
# <font color=blue>Assignments for "Data Exploration - Multivariate Analysis"</font> In this assignment, you will work on the `Students Performance` ([dataset](https://www.kaggle.com/spscientist/students-performance-in-exams/home)). You can reach the explanations of this data from Kaggle again. To complete this assig...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import numpy as np # load voter info data voter_info = pd.read_csv('voter_info.csv', sep='\t') # bar graph of the mean number of times moved for each age group age_groups = [18, 26, 33, 40, 50, 150]; ages = np.ones([5, 2]) mean_address_counts = np.zeros(5) for i i...
github_jupyter
Test runs for Task1 of the shared task ``` import pickle import json from collections import Counter import pandas as pd import pickle import re import numpy as np from collections import Counter, defaultdict, OrderedDict from nltk import word_tokenize, pos_tag import editdistance import csv from sklearn.metrics ...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Deep Learning ## Project: Build a Traffic Sign Recognition Classifier In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i...
github_jupyter
``` %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import numpy.linalg as la ``` # Dimension Reduction ``` np.random.seed(123) np.set_printoptions(3) ``` ### PCA from scratch Principal Components Analysis (PCA) basically means to find and rank all the eigenvalues and ...
github_jupyter
# Latent Dirichlet Allocation Demo ## Import dependencies ``` import os import time import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.datasets import fetch_20newsgroups from sklearn.manifold import TSNE import bokeh.plotting as bp from bokeh.plotting import save from bokeh.mo...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import healpy as hp import sys sys.path.append('/Users/mehdi/github/LSSutils') from LSSutils import dataviz as dv from glob import glob plt.rc('font', family='serif', size=15) from LSSutils.catalogs.datarelease import cols_dr8_rand as labels !ls -lt ../pk*zbin1*.tx...
github_jupyter
# Operators > API details. ``` #default_exp operators #export from smpr3d.kernels import * import torch as th import numpy as np import math as m import numba.cuda as cuda #export def calc_psi(r, t, z, out): out[:] = 0 K = r.shape[0] MY, MX = out.shape gpu = cuda.get_current_device() threadsperbl...
github_jupyter
# Better ML Engineering with ML Metadata ## Learning Objectives 1. Download the dataset 2. Create an InteractiveContext 3. Construct the TFX Pipeline 4. Query the MLMD Database ## Introduction Assume a scenario where you set up a production ML pipeline to classify penguins. The pipeline ingests your training da...
github_jupyter
# Getting Started with Matplotlib We need `matplotlib.pyplot` for plotting. ``` import matplotlib.pyplot as plt import pandas as pd ``` ## About the Data In this notebook, we will be working with 2 datasets: - Facebook's stock price throughout 2018 (obtained using the [`stock_analysis` package](https://github.com/ste...
github_jupyter
# 机器学习工程师纳米学位 ## 模型评价与验证 ## 项目 1: 预测波士顿房价 欢迎来到机器学习工程师纳米学位的第一个项目!在此文件中,有些示例代码已经提供给你,但你还需要实现更多的功能来让项目成功运行。除非有明确要求,你无须修改任何已给出的代码。以**'练习'**开始的标题表示接下来的内容中有需要你必须实现的功能。每一部分都会有详细的指导,需要实现的部分也会在注释中以**'TODO'**标出。请仔细阅读所有的提示! 除了实现代码外,你还**必须**回答一些与项目和实现有关的问题。每一个需要你回答的问题都会以**'问题 X'**为标题。请仔细阅读每个问题,并且在问题后的**'回答'**文字框中写出完整的答案。你的项目将会根...
github_jupyter
<a href="https://colab.research.google.com/github/PytorchLightning/pytorch-lightning/blob/master/notebooks/03-basic-gan.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # PyTorch Lightning Basic GAN Tutorial ⚡ How to train a GAN! Main takeaways: 1....
github_jupyter
<a href="https://colab.research.google.com/github/LucasDatilioCarderelli/Maratona_BehindTheCode_IBM20/blob/main/Desafio%206/DF6_Lit_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Install ``` !pip install tpot import pandas as pd import numpy a...
github_jupyter
``` #hide import ds4se.facade as facade import pandas as pd ``` # ds4se > Data Science for Software Engieering (ds4se) is an academic initiative to perform exploratory analysis on software engineering artifacts (e.g., requirements, issues, source code, or test cases) and metadata (e.g., repository logs, databases log...
github_jupyter
# Develop Deep Learning Models for Natural Language in Python ## Chapter 10 - Project: Develop a Neural Bag-of-Words Model for Sentimental Analysis ``` import re import os import numpy as np from random import shuffle ``` ### 10.4 - Bag-of-Words ReprRepresentation #### Load Data ``` # Most Data preperation was don...
github_jupyter
# Tutorial Part 10: Exploring Quantum Chemistry with GDB1k Most of the tutorials we've walked you through so far have focused on applications to the drug discovery realm, but DeepChem's tool suite works for molecular design problems generally. In this tutorial, we're going to walk through an example of how to train a ...
github_jupyter
``` !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt-get -y install -qq google-drive-ocamlfuse fuse from google.colab import auth auth.authenticate_user() from oauth...
github_jupyter
# Parallel Recursive Filtering of Infinite Input Extensions ## All functions needed and defined by the paper are in this notebook ### It also includes original functions from previous papers #### This an auxiliary notebook, it runs from other notebooks, it depends on the following imports: math; cmath; numpy as np; sci...
github_jupyter
**Chapter 4 – Training Linear Models** _This notebook contains all the sample code and solutions to the exercices in chapter 4._ # Setup First, let's make sure this notebook works well in both python 2 and 3, import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figur...
github_jupyter
# NeMo voice swap demo This notebook shows how to use NVIDIA NeMo (https://github.com/NVIDIA/NeMo) to construct a toy demo which will swap a voice in the audio fragment with a computer generated one. At its core the demo does: * Automatic speech recognition of what is said in the file. E.g. converting audio to text ...
github_jupyter
<table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ShopRunner/collie/blob/main/tutorials/02_matrix_factorization.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" /> Run in Google Colab</a> </td> <td> <a target="_blank" href="https://github.co...
github_jupyter
``` import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from sklearn.preprocessing import MinMaxScaler from datetime import datetime from datetime import timedelta sns.set() df = pd.read_csv('../dataset/GOOG-year.csv') date_ori = pd.to_datetime(df.iloc[:,...
github_jupyter
``` import sys sys.path.append('../scripts/') from kf import * #誤差楕円を描くのに利用 def make_ax(): #axisの準備 fig = plt.figure(figsize=(4,4)) ax = fig.add_subplot(111) ax.set_aspect('equal') ax.set_xlim(-5,5) ax.set_ylim(-5,5) ax.set_xlabel("X",fontsize=10) ax.set_ylabel("Y",fon...
github_jupyter
# An example of how to plot result with the result .csv file ## Importations and configurations ``` %matplotlib notebook import matplotlib as plt plt.interactive(True) import numpy as np import sys sys.path.append("../") from source import functions func = functions.Comparison() import datetime import pandas as p...
github_jupyter
``` %matplotlib inline import numpy as np import itertools import tensorflow as tf from six.moves import cPickle as pickle from six.moves import range import random import matplotlib.pyplot as plt from tensorflow.contrib.layers import flatten from PIL import Image, ImageOps from scipy.ndimage.interpolation import shift...
github_jupyter
# Introduction This notebook includes experiments on auxiliary learning. Please see the corresponding [repository](https://github.com/vivien000/auxiliary-learning) and the associated blog post. ``` # Set to True to save the experiments' results on Google Drive google_drive = True #@title Tensorboard launch and utili...
github_jupyter
# Settings ``` EXP_NO = 19 SEED = 1 N_SPLITS = 5 TARGET = 'target' GROUP = 'art_series_id' REGRESSION = True assert((TARGET, REGRESSION) in (('target', True), ('target', False), ('sorting_date', True))) ``` # Library ``` from collections import defaultdict from functools import partial import gc import glob import j...
github_jupyter
``` import numpy as np import scipy as sp import scipy.stats import itertools import logging import matplotlib.pyplot as plt import pandas as pd import torch.utils.data as utils import math import time import tqdm import torch import torch.optim as optim import torch.nn.functional as F from argparse import ArgumentPar...
github_jupyter
# Futures long-only performance summary This notebook summarises long-only performance statistics for major futures contracts provided by various data sources. Daily returns are computed by rolling the front contract before either the first notice day or the last trade day to avoid deliveries. Concretely, a daily retu...
github_jupyter
<a href="https://colab.research.google.com/github/hendradarwin/covid-19-prediction/blob/master/series-dnn_and_rnn/Forecast_3._rnn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Pediction New Death Cases Global Covid-19 Cases ## Load Data and Im...
github_jupyter