text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` from utils import * import tensorflow as tf from sklearn.cross_validation import train_test_split import time trainset = sklearn.datasets.load_files(container_path = 'data', encoding = 'UTF-8') trainset.data, trainset.target = separate_dataset(trainset,1.0) print (trainset.target_names) print (len(trainset.data)) p...
github_jupyter
# OCR (Optical Character Recognition) - Implantação ## Utilização das bibliotecas [opencv](https://opencv.org/) e [Tesseract OCR](https://tesseract-ocr.github.io/) para o reconhecimento de texto em imagens e da biblioteca [JiWER](https://github.com/jitsi/jiwer) para cálculo de mérticas de perfomance * Mais detlalh...
github_jupyter
``` from __future__ import print_function import os import sys import time import argparse import datetime import math import pickle import torchvision import torchvision.transforms as transforms from utils.autoaugment import CIFAR10Policy import torch import torch.utils.data as data import numpy as np import torch...
github_jupyter
# Chernoff Faces This notebook is the start of three in total to understand if transforming numerical data to images would improve classification tasks through deep learning techniques such as convolutional neural networks (CNNs). This notebook creates 4 data sets sampled from multi-level gaussian models, and each dat...
github_jupyter
# IEX Cloud Example Notebooks In these notebooks, we'll explore some simple functionality using [IEX Cloud](https://iexcloud.io/) data. We'll utilize the official python library, [pyEX](https://github.com/iexcloud/pyEX), as well as some common libraries from the scientific python stack like pandas, matplotlib, etc. I...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import numpy as np import tensorflow as tf import json with open('dataset-bpe.json') as fopen: data = json.load(fopen) train_X = data['train_X'] train_Y = data['train_Y'] test_X = data['test_X'] test_Y = data['test_Y'] EOS = 2 GO = 1 vocab_size = 32000 train_Y ...
github_jupyter
# Let's figure out these freaking learning rates ``` %load_ext autoreload %autoreload 2 import re, os import numpy as np import xarray as xr import tensorflow.keras as keras import datetime import pdb import matplotlib.pyplot as plt from src.utils import * from src.score import * from src.data_generator import * from ...
github_jupyter
``` import os from shutil import copyfile from PIL import Image, ImageDraw,ImageFont import matplotlib.pyplot as plt path = 'scd_addit' my_list = os.listdir(path) for i in range(50): directory_path=path+'_sam/'+str(i) if not os.path.exists(directory_path): os.makedirs(directory_path) for j,dir in e...
github_jupyter
``` import pandas as pd url = 'https://github.com/eueung/pilrek/raw/master/pilrek.csv' df = pd.read_csv(url) df.tail() import matplotlib.pyplot as plt %matplotlib inline df.shape df.dtypes df.isna().sum() #Menghitung nilai modus dari nama calon rektor CaRekPilihan_mode = df['CaRek Pilihan'].mode() print(CaRekPilihan_m...
github_jupyter
# Resumo, Teoria e Prática - Equações Diferenciais > Autor: Gil Miranda<br> > Contato: gilsmneto@gmail.com<br> > Repo: [@mirandagil](https://github.com/mirandagil/university-courses/analise-numerica-edo-2019-1)<br> > Fontes bibliográficas: * Rosa, R. (2017). <i>Equações Diferenciais</i>. * Trefethen, L. & Bau, D. (1997...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os; import sys; sys.path.append('../') import warnings import pandas as pd warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning) import socceraction.spadl.api as spadl ## Configure file and folder names datafolder = "../data" statsbomb_json = os.pa...
github_jupyter
# Нейросети и PyTorch (Часть 2) > 🚀 В этой практике нам понадобятся: `numpy==1.21.2, pandas==1.3.3, matplotlib==3.4.3, scikit-learn==0.24.2, torch==1.9.1` > 🚀 Установить вы их можете с помощью команды: `!pip install numpy==1.21.2, pandas==1.3.3, matplotlib==3.4.3, scikit-learn==0.24.2, torch==1.9.1` # Содержание ...
github_jupyter
``` file_path="/home/arun/workspace/projects/janaganana-data/data/education_level/C-08/csvs/education_all_india.csv" # Reading csv file for pca data import pandas as pd df = pd.read_csv(file_path) df.head(4) # only interested in literacy of all ages # if age specific is required then additional conditions need to be a...
github_jupyter
``` """ You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab. Instructions for setting up Colab are as follows: 1. Open a new Python 3 notebook. 2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL) 3. Connect to an in...
github_jupyter
``` %%capture !pip install transformers !pip install pypinyin !pip install jieba !pip install paddlepaddle %%capture import sys sys.path.append("../") import re,time,json from collections import defaultdict from torch.utils.data import DataLoader from pypinyin import pinyin, Style from tqdm import tqdm import pickle ...
github_jupyter
&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&ensp; [Home Page](Start_Here.ipynb) [Previous Notebook](Multi-stream_pipeline.ipynb) &emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&e...
github_jupyter
``` """ The MIT License (MIT) Copyright (c) 2021 NVIDIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
github_jupyter
## pQTL When trying to understand the mechanisms underlying the association of genetic variants with phenotypes, it can be useful to see whether the variants are also associated with the abundance of a transcript or of a protein. Loci associated with transcript and protein abundances are called expression quantative t...
github_jupyter
## Introduction This tutorial is primarily focussed to introduce you to "Natural Language Processing (NLP)". Natural language, i.e. language used by humans for daily communications (like Japanese, English, German, etc.), have evolved over the years and NLP is an attempt for computers to fully understand human language...
github_jupyter
# Demo: Simulation of Tyrosine NMR Spectrum This notebook shows how the **nmrsim** library can be used to compose an entire <sup>1</sup>H NMR spectrum from scratch. The nmrsim.plt routines are convenient for quick plots, but for entire spectrums their small size and low resolution is noticeable (e.g. misleading sign...
github_jupyter
# Python 入門 本章では、プログラミング言語 Python の基礎的な文法を学んでいきます。 次章以降に登場するコードを理解するにあたって必要となる最低限の知識について、最短で習得するのが目標です。 より正確かつ詳細な知識を確認したい場合には、[公式のチュートリアル](https://docs.python.jp/3/tutorial/index.html)などを参照してください。 Pythonにはバージョンとして 2 系と 3 系の 2 つの系統があり、互換性のない部分もあります。 本チュートリアルでは、3 系である **Python 3.6** 以上を前提とした解説を行っています。 ## Python の特徴 プ...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Challenge Notebook ## Problem: Implement a priority queue backed by an array. * [Constraints](#Constraints) * [Test Cases](#Test-Cases)...
github_jupyter
# Converting Ó Raghallaigh (2010) > "Re-implementation of the 'global' phonetiser, plus Kerry" - toc: false - branch: master - badges: true - comments: true - categories: [irish, g2p, kerry] This notebook contains a re-implementation of the "global" phonetiser from Brian Ó Raghallaigh's Ph.D. thesis using [rbg2p](htt...
github_jupyter
#Step 01. Install All Dependencies This installs Apache Spark 2.3.3, Java 8, Findspark library that makes it easy for Python to work on the given Big Data. ``` import os #OpenJDK Dependencies for Spark os.system('apt-get install openjdk-8-jdk-headless -qq > /dev/null') #Download Apache Spark os.system('wget -q http:...
github_jupyter
## Analyze A/B Test Results This project will assure you have mastered the subjects covered in the statistics lessons. The hope is to have this project be as comprehensive of these topics as possible. Good luck! ## Table of Contents - [Introduction](#intro) - [Part I - Probability](#probability) - [Part II - A/B Te...
github_jupyter
# Using AWS S3 to read/write market data with findatapy May 2021 - Saeed Amen - https://www.cuemacro.com - saeed@cuemacro.com ## What is S3? S3 is basically storage in the cloud, which is managed by AWS. Dump as much data as want from anywhere on the web and you don't need to worry about scaling your storage, which ...
github_jupyter
``` %matplotlib inline import inspect, os, sys, copy, pytz, re, glob, random, praw, csv import simplejson as json import pandas as pd from dateutil import parser import datetime import matplotlib.pyplot as plt # Matplotlib for plotting import matplotlib.dates as md import numpy as np import seaborn as sns from collec...
github_jupyter
# Formal Simulated Inference 1. Define F (i.e. your model and assumptions) 2. Formalize test 3. Describe test statistic 4. A. Sample data from F∈ℱ0 B. Sample data from F∈ℱA 5. A. Plot power vs n (i.e. perspective power analysis) B. Plot power vs n (i.e. perspective power analysis) 6. Apply to data ## Step 1: Def...
github_jupyter
# dataprep.py example This notebook will show how the functions contained within the `dataprep.py` module are used to generate hdf5 files for storing raw data and peak fitting results. This module is also the primary way in which the functions contained within spectrafit.py are utilized. ``` import os import h5py imp...
github_jupyter
``` from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) ``` # Make Segmentation Figures ### Tiles ``` import cv2 import numpy import os, sys, glob import numpy as np %matplotlib inline from matplotlib import pyplot as plt imglist = sorted(glob.glob('/...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys sys.path.append('/home/azureuser/cloudfiles/code/Users/src/') import ee # Trigger the authentication flow. ee.Authenticate() # Initialize the library. ee.Initialize() """ Detect Methane hotspots ------------------------------ Functions to load and detect methane hotsp...
github_jupyter
``` # write raw rbnf source code. from rbnf.easy import build_parser, Language, build_language from typing import NamedTuple, List my_lisp_definition = """ ignore [space] space := R'\s' term := R'[^\(\)\s]' sexpr ::= '(' [sexpr as head sexpr* as tail] ')' | term as atom rewrite if atom: ...
github_jupyter
# Unity3D Game with Amazon SageMaker RL --- ## Introduction [Unity](https://unity.com/) is currently the most popular gaming engine used by game developers around the world. Unity engine can be used to create 3D, 2D, virtual reality, and augmented reality games, as well as simulations and other experiences. [ML-Agent...
github_jupyter
# Codealong 06 ``` import os import numpy as np import pandas as pd import csv import matplotlib.pyplot as plt from sklearn import neighbors, metrics, grid_search, cross_validation pd.set_option('display.max_rows', 10) pd.set_option('display.notebook_repr_html', True) pd.set_option('display.max_columns', 10) %matplo...
github_jupyter
# IST256 Lesson 07 ## Files - Zybook Ch7 - P4E Ch7 ## Links - Participation: [https://poll.ist256.com](https://poll.ist256.com) - Zoom Chat! # Agenda ### Go Over Homework H06 ### New Stuff - The importance of a persistence layer in programming. - How to read and write from files. - Techniques for reading a file...
github_jupyter
# Example: PCA applied to MNIST This notebook shows how PCA can be applied to a non-trivial data set to reduce its dimensionality. PCA (and its variations, like Incremental PCA) is a useful tool to reduce the dimensionality of your feature space to boost model training performance. In this example, we will examine how...
github_jupyter
# Seasonality, Trend and Noise > You will go beyond summary statistics by learning about autocorrelation and partial autocorrelation plots. You will also learn how to automatically detect seasonality, trend and noise in your time series data. This is the Summary of lecture "Visualizing Time-Series data in Python", via ...
github_jupyter
``` # default_exp metrics ``` # Metrics > This contains metrics not included in fastai. ``` #export import sklearn.metrics as skm from fastai.metrics import * from tsai.imports import * #export mk_class('ActivationType', **{o:o.lower() for o in ['No', 'Sigmoid', 'Softmax', 'BinarySoftmax']}, doc="All possi...
github_jupyter
# DataFlow API walkthrough Suhas Somnath <br> 4/6/2022 <br> Oak Ridge National Laboratory ## 0. Prepare to use DataFlow's API: 1. Install the ``ordflow`` python package from PyPi via: ``pip install ordflow`` 2. Generate an API Key from DataFlow's web interface **Note**: API Keys are not reusable across DataFlow se...
github_jupyter
# Stock Entity Recognition Unmasked ``` import pandas import re import json import math import numpy import os import tensorflow as tf from itertools import chain from multiprocessing import Pool from functools import partial from transformers import TFBertForTokenClassification, BertTokenizerFast from sklearn.model...
github_jupyter
# Fuzzingbook Release Notes This book comes with version numbers; these correspond to the version numbers in [the Python pip package](Importing.ipynb). ## Version 1.0 (in progress) * We now support (but also require) **Python 3.9 or later**. Earlier versions still required Python 3.6 due to some outdated modules suc...
github_jupyter
# Matching Market - testing Parameter NL production decline This simple model consists of a buyer, a supplier, and a market. The buyer represents a group of customers whose willingness to pay for a single unit of the good is captured by a vector of prices _wta_. You can initiate the buyer with a set_quantity functio...
github_jupyter
# Classification data using scikit-learn Classification problems are those in which the feature to be predicted contains categories of values. Each of these categories are considered as a class into which the predicted value will fall into and hence has its name, classification. In this notebook, we'll use scikit-le...
github_jupyter
# --------------------------------------------------------------- # python best courses https://courses.tanpham.org/ # --------------------------------------------------------------- # 100 numpy exercises This is a collection of exercises that have been collected in the numpy mailing list, on stack overflow and in th...
github_jupyter
<div dir='rtl'> # الوصف </div> <div dir='rtl'> يُستخدم هذا الدفتر لطلب حساب متوسط السلاسل الزمنية لطبقة بيانات WaPOR لمنطقة باستخدام WaPOR API. ستحتاج إلى WaPOR API Token لاستخدام هذا الكمبيوتر المحمول </div> <div dir='rtl'> # الخطوة 1: اقرأ APIToken </div> <div dir='rtl'> احصل على APItoken من https...
github_jupyter
``` %matplotlib inline import numpy as np def _idcg(l): return sum((1.0 / np.log(i + 2) for i in range(l))) _idcgs = [_idcg(i) for i in range(101)] def ndcg(gt, rec): dcg = 0.0 for i, r in enumerate(rec): if r in gt: dcg += 1.0 / np.log(i + 2) return dcg / _idcgs[len(gt)] import ...
github_jupyter
### Practice: gym interfaces _Reference: based on Practical RL_ [week01](https://github.com/yandexdataschool/Practical_RL/tree/master/week01_intro) ``` # In Google Colab, uncomment this: # !wget https://bit.ly/2FMJP5K -O setup.py && bash setup.py # This code creates a virtual display to draw game images on. # If you...
github_jupyter
``` %matplotlib inline ``` # Initial Data Cleaning and Exploration Code for the initial data cleaning and exploration done before modeling _Author: Jimmy Charité_ _Email: jimmy.charite@gmail.com_ # Directory & Packages ``` import os import pandas as pd import numpy as np import seaborn as sns import matplotlib....
github_jupyter
# Counts vs. angle W vs. angle for Figure 6 in the paper. Enable interactive plots ``` %matplotlib notebook import os import sys import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator) import pandas as pd import scipy.io as sio os.getc...
github_jupyter
``` tupla = ([1, 2, 3], [2, 3, 4]) tupla[1] = [2, 4, 5] arr = tupla[1] arr += [2] tupla tupla[0] += [4] tupla tupla[0].append(5) tupla tokens1 = [1, 1, 2, 3, 5] tokens2 = [1, 2, 3, 3, 4] from collections import Counter from random import randint tokens1 = [randint(0, 50) for _ in range(randint(25, 40))] tokens2 = [rand...
github_jupyter
``` import numpy as np from torch.utils.data import Dataset import torchvision import os import h5py import pickle # TODO or use h5py instead? import trimesh import config as cfg import dataset.augmentation as Transforms class DatasetModelnet40(Dataset): def __init__(self, split, noise_type): dataset...
github_jupyter
# Lambda School Data Science Unit 4 Sprint Challenge 4 ## RNNs, CNNs, AutoML, and more... In this sprint challenge, you'll explore some of the cutting edge of Data Science. *Caution* - these approaches can be pretty heavy computationally. All problems were designed so that you should be able to achieve results withi...
github_jupyter
# Dropout Dropout [1] is a technique for regularizing neural networks by randomly setting some features to zero during the forward pass. In this exercise you will implement a dropout layer and modify your fully-connected network to optionally use dropout. [1] Geoffrey E. Hinton et al, "Improving neural networks by pre...
github_jupyter
# Modeling with `scikit-learn` <br> <center> <img src="https://raw.githubusercontent.com/uc-r/Advanced-R/f1001a5b40b5e3803e4cd01a40c7129fee3afb39/docs/images/process-icon.svg" alt="fortune-teller.gif" width="1200" height="1200"> </center> # Introduction to Machine Learning ## Introduction Machine learning (ML) conti...
github_jupyter
#Ejemplo 6: Predicción de spam --- **Objetivo y comprensión del problema** El objetivo del problema consisten en predecir la posibilidad de que un texto corresponda a un mensaje de spam. Cada una de las tuplas tiene un texto y una clasificación que se utilizará en el entrenamiento. Se trata de un problema de clasifi...
github_jupyter
# MLServer - Retrieve and Classify This notebook retrieves data from an Azure Function server, performs classification using a machine learning model and uploads the results back to the cloud. All of that is performed using API REST endpoints exposed in Azure. Segmentation model is DeepLabV3+, at https://github.com/...
github_jupyter
# Exploratory Data Analysis of Iris ## Importing the Libraries ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns data=pd.read_csv('iris.csv') ``` ## Understanding the data ``` # five elements from top data.head(10) # five elements from end data.tail(3) # shape of the d...
github_jupyter
``` import matplotlib as mpl import matplotlib.pyplot as plt %matplotlib inline import numpy as np import sklearn import pandas as pd import os import sys import time import tensorflow as tf from tensorflow import keras print(tf.__version__) print(sys.version_info) for module in mpl, np, pd, sklearn, tf, keras: pr...
github_jupyter
## Traditional Feedforward neural network to approximate a black box function This is just a toy example to test the basic functionality of Bokeh interactive plot! ``` import torch import torch.nn as nn import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variabl...
github_jupyter
``` from SentenceParserPython3 import SentenceParser import pandas as pd import numpy as np from bs4 import BeautifulSoup import sys import re def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '='): percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration ...
github_jupyter
## Second Attempt on Language Detection This code shows the second attempt on processing the corpora and trying to come up with a model for the europar.test file. This code uses files in the /txt directory. To build a model, this uses the most common words and most common letters used on each language and builds a f...
github_jupyter
Deep Learning ============= Assignment 1 ------------ The objective of this assignment is to learn about simple data curation practices, and familiarize you with some of the data we'll be reusing later. This notebook uses the [notMNIST](http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html) dataset to be used...
github_jupyter
<img align="centre" src="../../figs/Github_banner.jpg" width="100%"> # Southern Africa Cropland Mask ## Background The notebooks in this folder provide the means for generating a cropland mask (crop/non-crop) for the Southern Africa study region (Figure 1), for the year 2019 at 10m resolution. To obtain classificati...
github_jupyter
<h1><center><font size="6">Santander Customer Transaction Prediction</font></center></h1> <h1><center><font size="5">Can you identify who will make a transaction?</font></center></h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Another_new_Santander_bank_-_geograph.org.uk_-_1710962.jpg/640px-An...
github_jupyter
# Scraping Job Postings from LinkedIn This code is adapted and modified from the following article: https://maoviola.medium.com/a-complete-guide-to-web-scraping-linkedin-job-postings-ad290fcaa97f and Cohort 2's work. ### Data Source LinkedIn job post board. This data collection is focusing on job posts near Rancho C...
github_jupyter
<a href="https://colab.research.google.com/github/FairozaAmira/AI-programming-1-a/blob/master/Lecture08.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # 第8回目の講義中の練習問題回答 ## `for` ループ 1. `for`ループを使って、1 から 5 まで表示しなさい。 ``` for N in [1, 2, 3, 4, 5]: ...
github_jupyter
# Introductory applied machine learning (INFR10069) # Lab 0: Introduction To complete this lab you should: * Set up your IAML environment ready for the course * __Read the text__ and run all the cells in this notebook and have a play with all the objects created (Don't worry about messing up this notebook - you can ...
github_jupyter
# Present Value of Liabilities and Funding Ratio In this lab session, we'll examine how to discount future liabilities to compute the present value of future liabilities, and measure the funding ratio. The funding ratio is the ratio of the current value of assets to the present value of the liabilities. In order to ...
github_jupyter
<h1> CREAZIONE MODELLO SARIMA SPAGNA ``` import pandas as pd df = pd.read_csv('../../csv/nazioni/serie_storica_sp.csv') df.head() df['TIME'] = pd.to_datetime(df['TIME']) df.info() df=df.set_index('TIME') df.head() ``` <h3>Creazione serie storica dei decessi totali ``` df = df.groupby(pd.Grouper(freq='M')).sum() df.h...
github_jupyter
``` import glob import os import librosa import numpy as np !pip install pretty_midi import pretty_midi from google.colab import drive drive.mount('/content/drive', force_remount=True) ``` **Please update the start path and destination path** ``` start ='/content/drive/MyDrive/MUS' # Divide all 9 directories of the M...
github_jupyter
# SWELL-KW GRU Adapted from Microsoft's notebooks, available at https://github.com/microsoft/EdgeML authored by Dennis et al. ``` import pandas as pd import numpy as np from tabulate import tabulate import os import datetime as datetime import pickle as pkl import pathlib from __future__ import print_function import ...
github_jupyter
![APSSDC-LOGO](https://drive.google.com/uc?export=download&id=15AKQ6_-BixW4K6mL6RPphF5EKXqYF2zj) <h1><center>Day05 Machine Learning Using Python</center></h1> ## Day05 Objectives Classification models - 1 - Logistic regression - Support Vector Machines ``` import pandas as pd import numpy as np import seaborn as s...
github_jupyter
# Create a corpus file from the English wikipedia dump In this notebook we'll: 1. Process a wikipedia dump that has been transformed into a series of JSONL files 1. Select text section that have contiguous group of sentences, so as to yield a higher quality embedding later on 1. Tokenize the senteces and words 1. Form...
github_jupyter
``` # pandas import pandas as pd from pandas import Series,DataFrame # numpy, matplotlib, seaborn import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_style('whitegrid') %matplotlib inline from IPython.display import display # remove warnings import warnings warnings.filterwarnings('ignor...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt %matplotlib inline pd.options.display.max_colwidth=300 # Shingle generators # Arguments : Message string, shingle size {in words} # Returns : All shingles formed with k words def shingle_generator(message, k): message = me...
github_jupyter
# Kubeflow pipelines **Learning Objectives:** 1. Learn how to deploy a Kubeflow cluster on GCP 1. Learn how to create a experiment in Kubeflow 1. Learn how to package you code into a Kubeflow pipeline 1. Learn how to run a Kubeflow pipeline in a repeatable and traceable way ## Introduction In this notebook,...
github_jupyter
# Dynamic Programming Basically we solve the Bellman optimality equation using these methods: * Value Iteration * Policy Iteration From the perspective of the quality of the policy found both methods will work, but they are the base of more advanced methodologies. ### References * [Artificial Intelligence](https://git...
github_jupyter
# Vitessce Widget Tutorial # Visualization of single-cell RNA seq data ## 1. Import dependencies We need to import the classes and functions that we will be using from the corresponding packages. ``` import os from os.path import join from urllib.request import urlretrieve from anndata import read_h5ad import scanp...
github_jupyter
## Task: Question Answering for Game of Thrones <img style="float: right;" src="https://upload.wikimedia.org/wikipedia/en/d/d8/Game_of_Thrones_title_card.jpg"> Question Answering can be used in a variety of use cases. A very common one: Using it to navigate through complex knowledge bases or long documents ("search ...
github_jupyter
# Lesson 2 - Image Classification Models from Scratch ## Lesson Video: ``` #hide_input from IPython.lib.display import YouTubeVideo YouTubeVideo('_SKqrTlXNt8') #hide #Run once per session !pip install fastai wwf -q --upgrade #hide_input from wwf.utils import state_versions state_versions(['fastai', 'fastcore', 'wwf']...
github_jupyter
# CER044 - Install signed Controller certificate This notebook installs into the Big Data Cluster the certificate signed using: - [CER034 - Sign Controller certificate with cluster Root CA](../cert-management/cer034-sign-controller-generated-cert.ipynb) NOTE: At the end of this notebook the Controller pod and ...
github_jupyter
# Goal ## Questions * How is incorporator identification accuracy affected by the percent isotope incorporation of taxa? * How variable is sensitivity depending on model stochasticity * Each simulation has differing taxa as incorporators, therefore, the incorporators then differ by GC and abundance between simulati...
github_jupyter
## Dependencies ``` !pip install --quiet /kaggle/input/kerasapplications !pip install --quiet /kaggle/input/efficientnet-git import warnings, glob from tensorflow.keras import Sequential, Model import efficientnet.tfkeras as efn from cassava_scripts import * seed = 0 seed_everything(seed) warnings.filterwarnings('ig...
github_jupyter
``` !pip install autokeras !pip install git+https://github.com/keras-team/keras-tuner.git@1.0.2rc1 ``` ## A Simple Example The first step is to prepare your data. Here we use the [California housing dataset](https://scikit-learn.org/stable/datasets/index.html#california-housing-dataset) as an example. ``` from sklear...
github_jupyter
# Scikit-Learn IRIS Model * Wrap a scikit-learn python model for use as a prediction microservice in seldon-core * Run locally on Docker to test * Deploy on seldon-core running on a kubernetes cluster ## Dependencies * [S2I](https://github.com/openshift/source-to-image) ```bash pip install sklearn pip inst...
github_jupyter
``` from uberpy import Uber with open('uber.txt','r') as f: client_id = f.readline().strip() server_token = f.readline().strip() secret= f.readline().strip() uber = Uber(client_id, server_token, secret) from pprint import pprint import pandas as pd import random from pyDOE import * import math ...
github_jupyter
The goal of this notebook is to demonstrate how to obtain a superpixel segmentation of a raster and then store these as a vector format for visualization and later analyses. A nice example of superpixel segmentation using the module we are using can be found [here](https://scikit-image.org/docs/dev/auto_examples/segme...
github_jupyter
``` import numpy as np from tqdm import tqdm from sklearn.metrics import roc_auc_score from numpy.testing import assert_almost_equal from myfunc.my_roc_auc import my_roc_auc ``` # Scikit-learnと自作のAUC比較 ## サンプルデータで一致確認 ``` # 実装がsklearnのAUCと一致するかテスト n_samples = 1000 np.random.seed(n_samples) # generate sample data ...
github_jupyter
# Quick Numbers for Paper In today's meeting we are going through the paper looking for holes. I am just taking a quick look and filling some of them. ``` import os import sys import re from pathlib import Path from io import StringIO from yaml import load from IPython.display import display, HTML, Markdown import n...
github_jupyter
<table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/PreferredAI/tutorials/blob/master/recommender-systems/07_explanations.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />Run in Google Colab</a> </td> <td> <a tar...
github_jupyter
# 2 qubits gate Let's check the 2 qubits gate. ## What we'll learn this time 1. 2qubits gate 2. Implementation example ## Install Blueqat Install Blueqat from pip. ``` !pip install blueqat ``` ## Two qubit gate Two qubits gate is mainly one qubit gate with a control bit added to it. ### CX, CY, CZ CX, CY, CZ gates...
github_jupyter
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) # Gaussian Probabilities ``` #format the book %matplotlib inline from __future__ import division, print_function from book_format import load_style load_style() ``` ## Introduction...
github_jupyter
<center> <img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" /> </center> # Write and Save Files in Python Estimated time needed: **25** minutes ## Objectives After completing this l...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import pandas as pd import rosbag import pymap3d as pm import numba as nb from scipy.signal import savgol_filter %matplotlib inline def wrap_angle(angle): return (angle + np.pi) % (2 * np.pi) - np.pi @nb.njit() def to_euler(x, y, z, w): """Dari Coursera: ...
github_jupyter
# Classes Classes allow you to define how to package data with functions to create objects. An object is an instance of a class, which contains its own data, and its own copy of functions that can operate on that data. You use classes to define objects that represent the concepts and things that your program will wor...
github_jupyter
# # Appendix E - Avoid hyperparameters ``` import pandas as pd import networkx as nx import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import SpectralClustering from sklearn.metrics import pairwise_distances from sklearn.cluster import KMeans from numba import jit, prange import plotly.graph_obje...
github_jupyter
``` import pandas as pd import numpy as np import os import regex as re from collections import Counter, defaultdict import sys CONST_A = 0 CONST_C = 1 CONST_G = 2 CONST_T = 3 CONST_NT_MAP = ['A', 'C', 'G', 'T'] def remove_duplicates_round(df,hamm_thres=4,merge_counts=False): seqs = list(df.Seq.values) count...
github_jupyter
``` #copied from https://colab.research.google.com/drive/1pTuQhug6Dhl9XalKB0zUGf4FIdYFlpcX#scrollTo=Z474sSC6oe7A # import tensorflow as tf # # Get the GPU device name. # device_name = tf.test.gpu_device_name() # # The device name should look like the following: # if device_name == '/device:GPU:0': # print('Found ...
github_jupyter
# Polynomial Regression using MinMax Scaler This code template is for the regression analysis using Polynomial Regression and feature rescaling technique called MinMaxScaler ### Required Packages ``` import warnings import numpy as np import pandas as pd import seaborn as se import matplotlib.pyplot as plt from...
github_jupyter
>[Prerequisites (downloading tensorflow_models and checkpoints)](#scrollTo=T_cETKXHDTXu) >[Checkpoint based inference](#scrollTo=fxMe7_pkk_Vo) >[Frozen inference](#scrollTo=PlwvpK3ElBk6) # Prerequisites (downloading tensorflow_models and checkpoints) ``` !git clone https://github.com/tensorflow/models from __future...
github_jupyter