text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import numpy as np import matplotlib.pyplot as plt # Prepare 100 evenly spaced numbers from 0 to 200 x = np.linspace(0, 200, 100) y = x * 2 plt.figure() plt.plot(x,y) # Plot an outlier point plt.plot([100], [100000], 'o') plt.xlabel('x') plt.ylabel('y') plt.show() plt.figure() plt.plot(x,y) # Plot an outlier ...
github_jupyter
``` import numpy as np from numpy import random import matplotlib.pyplot as plt ``` # Uniform distribution ``` # get a single random number between 0 and 100 x = random.uniform(0, 100) print(x) # get 10 random numbers x = random.uniform(0, 100, size=10) print(x) # improve readability by writing all parameter names x ...
github_jupyter
``` import numpy as np l = [1, 2, 4,3] l2 = [[1,2], [3,4]] a = np.array(l2, dtype=np.float) print(type(a[1,1])) a.shape a = np.arange(24) print(a.ndim) b = a.reshape(2,4,3) print(b.ndim) print(b.shape) print(b.itemsize) print(b.dtype) print(b.size) print(b.flags) a = np.linspace(10, 20, 5, endpoint=False) print(a) a...
github_jupyter
<h1 align=center><font size = 5> Logistic Regression with Python</font></h1> In this notebook, you will learn Logistic Regression, and then, you'll create a model for a telecommunication company, to predict when its customers will leave for a competitor, so that they can take some action to retain the customers. <a ...
github_jupyter
``` import pandas as pd import numpy as np import os import git import sys repo = git.Repo("./", search_parent_directories=True) homedir = repo.working_dir #Key to give state & county name value for each FIPS code Key = pd.read_csv('Key.csv', index_col=0).sort_values(by=['FIPS']) Key.head() #County Covid Cases/Deaths...
github_jupyter
# Symbulate Lab 7 - Stochastic Processes This Jupyter notebook provides a template for you to fill in. Read the notebook from start to finish, completing the parts as indicated. To run a cell, make sure the cell is highlighted by clicking on it, then press SHIFT + ENTER on your keyboard. (Alternatively, you can cli...
github_jupyter
# Encodings creation notebook This notebook was used to get the encodings of the images using a VGG19 ``` import json, os import random from matplotlib.image import imread import numpy as np import tensorflow as tf from PIL import Image ``` Reading dataset json files ``` img_h = 224 img_w = 224 cwd = os.getcwd() d...
github_jupyter
<a href="https://colab.research.google.com/github/yohanesnuwara/pyreservoir/blob/master/notebooks/reservoir_pressure_analytical_solution_notebook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Reservoir Pressure Analytical Solution (John W. Lee's...
github_jupyter
# <center>LECTURE OVERVIEW</center> --- ## By the end of the day you'll be able to: - filter container elements using a combination of a `for` loop and an `if` statement - update values in a nested `list` using double `for` loops (aka nested loop) - use `if` statements with `list` and `dictionary` comprehensions - so...
github_jupyter
## 1. Loading the NIPS papers <p>The NIPS conference (Neural Information Processing Systems) is one of the most prestigious yearly events in the machine learning community. At each NIPS conference, a large number of research papers are published. Over 50,000 PDF files were automatically downloaded and processed to obta...
github_jupyter
# Scheduling Machine Learning Pipelines using Apache Airflow In this workshop, you will use Airflow to schedule a basic machine learning pipeline. The workshop consists of 3 assignments. 1. Schedule a basic 'hello world' example on Airflow 2. Schedule a machine learning pipeline on Airflow 3. Improve the the pipeline...
github_jupyter
<a href="https://colab.research.google.com/github/oughtinc/ergo/blob/notebooks-readme/covid-19-average-lockdown.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Setup ``` !pip install --quiet poetry # Fixes https://github.com/python-poetry/poetry...
github_jupyter
## Demonstrates some common TensorFlow errors This notebook demonstrates some common TensorFlow errors, how to find them, and how to fix them. ``` import tensorflow as tf print(tf.__version__) ``` # Shape error ``` def some_method(data): a = data[:,0:2] c = data[:,1] s = (a + c) return tf.sqrt(tf.matmul(s, ...
github_jupyter
``` import os import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits import mplot3d %matplotlib inline from sklearn import linear_model from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error module_path = os.path.abspath(os.path...
github_jupyter
# Milestone Project 2 - Complete Walkthrough Solution This notebook walks through a proposed solution to the Blackjack Game milestone project. The approach to solving and the specific code used are only suggestions - there are many different ways to code this out, and yours is likely to be different! ## Game Play To p...
github_jupyter
# Rust Programming Tutorial https://www.youtube.com/watch?v=vOMJlQ5B-M0&list=PLVvjrrRCBy2JSHf9tGxGKJ-bYAN_uDCUL # Hello World ``` pub fn main() { println!("Hello World!"); } main() ``` # Variables, Mutable ``` pub fn main() { let x = 45; println!("The value of x is {}", x); // x = 42; // <= e...
github_jupyter
``` # run this code to login to https://okpy.org/ and setup the assignment for submission from ist256 import okclient ok = okclient.Lab() ``` # Class Coding Lab: Iterations The goals of this lab are to help you to understand: - How loops work. - The difference between definite and indefinite loops, and when to use e...
github_jupyter
``` !pip install -U ../../../tm/SDGym import sdgym from sdgym import load_dataset from sdgym import benchmark from sdgym import load_dataset from timeit import default_timer as timer from functools import partial import numpy as np import pandas as pd import matplotlib.pyplot as plt import networkx as nx from synthsoni...
github_jupyter
``` import sqlite3 import pandas as pd import numpy as np import matplotlib.pyplot as plt import plotly.plotly as py import plotly.graph_objs as go from sklearn.cross_validation import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import accuracy_score from sklearn.cross_va...
github_jupyter
## Predict No Show For Hospital Appointments ### Data From IM Insurence #### Why: No show causes profit loss and resources wasted #### Key Findings: 1. Show/Noshow (SNS), Right figure 2. Randomforest Classifier outperforms other classification methods; final selected model has robust AUC 0.72 for both training and...
github_jupyter
# YNet - Dataset 7: Data from Experiment (2), Mitochondria = Cit1-mCherry ### Importing utilities: ``` %matplotlib inline %reload_ext autoreload %autoreload 2 import os from pathlib import Path import skimage.external.tifffile as tiff from common import Statistics, dataset_source from resources.conv_learner import ...
github_jupyter
# PROJECT 2 : TEAM 11 Members: Talia Tandler, SeungU Lyu ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py modu...
github_jupyter
``` from netgan.netgan import * import tensorflow as tf from netgan import utils import scipy.sparse as sp import numpy as np from matplotlib import pyplot as plt from sklearn.metrics import roc_auc_score, average_precision_score import time %matplotlib inline ``` #### Load the data ``` _A_obs, _X_obs, _z_obs = util...
github_jupyter
# Data Ingestor for IoT Telemetry and Failure Data This notebook ingests and preprocesses IoT device telemetry data in the Azure blob service and IoT device failure logs in Azure storage table to use in Feature Engineering and Model Training. This imitates a production scenario where telemetry is collected over a per...
github_jupyter
``` import csv import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator from google.colab import files !pip install -U -q kaggle !mkdir ~/.kaggle ``` The data for this exercise is available at: https://www.kaggle.com/datamunge/sign-language-mnist/home Sign up and ...
github_jupyter
<a href="https://colab.research.google.com/github/Pavithran-R/rclone-colab/blob/master/rclone_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## <img src='https://rclone.netlify.app/img/title_rclonelab.svg' height="45" alt="RcloneLab"/> ``` #...
github_jupyter
``` #!pip install git+https://github.com/JoaquinAmatRodrigo/skforecast#master --upgrade %load_ext autoreload %autoreload 2 import sys #sys.path.insert(1, '/home/ximo/Documents/GitHub/skforecast') # Libraries # ============================================================================== import numpy as np import pan...
github_jupyter
## Innlesing og behandling av flere parque-datasett i samme prosessesteg med Pyspark I denne noten viser vi hvordan man kan lese inn og behandle et ukjent antall inndatasett ved å bruke python collection datatypes (list, dictionary og tuple) og python for loops for å operasjonalisere steg i en tenkt klargjørings eller ...
github_jupyter
# 2D Isostatic gravity inversion - Inverse Problem Este [IPython Notebook](http://ipython.org/videos.html#the-ipython-notebook) utiliza a biblioteca de código aberto [Fatiando a Terra](http://fatiando.org/) ``` %matplotlib inline import numpy as np from scipy.misc import derivative import scipy as spy from scipy impo...
github_jupyter
``` # MODIFY! # use Robust! model_name = 'poi-baseline-wo' import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('./data/d-wo-ns.csv') # df.columns # df.head() df.shape # df.info() X = df.drop('throughput',axis=1) X.shape y = df['throughput'] y.shape # Split the...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd # figures inline in notebook %matplotlib inline corrmat = np.array([[0.3381,0.3187,0.3046,0.3045,0.3039,0.3011,0.3044,0.3034,0.3128,0.3269], [0.3187,0.3358,0.3098,0.3061,0.3040,0.3030,0.3026,0.3064,0.3...
github_jupyter
``` import pandas as pd from matplotlib import pyplot as plt from functools import partial % matplotlib inline # Given these coordenates x_points = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] y_points = [1, 2, 3, 1, 4, 5, 4, 6, 7, 10, 15] # Let's plot to display how they are located plt.plot(x_points, y_points, 'bo') # remeber...
github_jupyter
# Distilling knowlege in Transformer models and test prediction for GLUE tasks, using *torchdistill* ## 1. Make sure you have access to GPU/TPU Google Colab: Runtime -> Change runtime type -> Hardware accelarator: "GPU" or "TPU" ``` !nvidia-smi ``` ## 2. Clone torchdistill repository to use its example code and conf...
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
# NYC Taxi Fare Prediction Predict taxi fares using the [New York City Taxi and Limousine Commission (TLC) Trip Record Data](https://registry.opendata.aws/nyc-tlc-trip-records-pds/) public dataset. ``` %%capture !pip install -U pandas geopandas seaborn ``` ## Data Prep In this section of the notebook, you will dow...
github_jupyter
``` from matplotlib import pyplot as plt import pandas as pd from sklearn.decomposition import PCA from sklearn.datasets import load_breast_cancer from sklearn.preprocessing import scale from psynlig import ( pca_explained_variance, pca_explained_variance_bar, pca_2d_scores, pca_2d_loadings, ) plt.style...
github_jupyter
# Pré processamento da coleção de dados Aplicação de técnicas de pré processamento de dados para ser possível uma pré-análise dos dados enquanto ocorre a transformação para dados padronizados e normalizados. # Parte 3 - Describe e Merge * foi utilizado a função describe() para ter a estatística dos dados de cada ta...
github_jupyter
``` # 导入库 import pandas as pd import numpy as np from sklearn.feature_extraction import DictVectorizer # 字符串分类转整数分类库 from sklearn.preprocessing import MinMaxScaler # MinMaxScaler库 from sklearn.cluster import KMeans # KMeans模块 from sklearn import metrics # 导入sklearn效果评估模块 import matplotlib.pyplot as plt # 图形库 # 读取数...
github_jupyter
# Data Preparation ## Import Libraries ``` import numpy as np import pandas as pd ``` ## Import Data The dataset contains all available data for more than 800,000 consumer loans issued from 2007 to 2015 by Lending Club: a large US peer-to-peer lending company. There are several different versions of this dataset. We...
github_jupyter
This notebook is part of the `clifford` documentation: https://clifford.readthedocs.io/. # Object Oriented CGA This is a shelled out demo for a object-oriented approach to CGA with `clifford`. The `CGA` object holds the original layout for an arbitrary geometric algebra , and the conformalized version. It provides ...
github_jupyter
``` ######## snakemake preamble start (automatically inserted, do not edit) ######## import sys; sys.path.extend(['/Users/johannes/scms/snakemake', '/Users/johannes/scms/snakemake/tests/test_jupyter_notebook_draft']); import pickle; snakemake = pickle.loads(b'\x80\x03csnakemake.script\nSnakemake\nq\x00)\x81q\x01}q\x02...
github_jupyter
``` import numpy as np np.random.seed(42) import tensorflow as tf from tensorflow.keras.layers.experimental import preprocessing import os import time import sys # In case your sys.path does not contain the base repo, go there. print(sys.path) %cd '~/ml-solr-course' path = "dataset/train_corpus_descriptions_airbnb.csv"...
github_jupyter
# Exploring Ebay Car Sale Data ------- The aim of this project is to clean the data and analyze the included used car listings. ``` import pandas as pd import numpy as np autos = pd.read_csv('autos.csv',encoding="Latin-1") autos.info() autos.head() autos.columns autos.columns = ['date_crawled', 'name', 'seller', 'off...
github_jupyter
``` import pandas as pd import numpy as np import pickle import matplotlib.pyplot as plt from scipy import stats import tensorflow as tf import seaborn as sns from pylab import rcParams from sklearn import metrics from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler %ma...
github_jupyter
# Fuzzy Water Observations from Space <img align="right" src="../../../Supplementary_data/dea_logo.jpg"> * [**Sign up to the DEA Sandbox**](https://docs.dea.ga.gov.au/setup/sandbox.html) to run this notebook interactively from a browser * **Compatibility:** Notebook currently compatible with both the `NCI` and `DEA Sa...
github_jupyter
##### Copyright 2021 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
## Development notebook FCN model ``` from IPython.core.display import display, HTML display(HTML("<style>.container { width:95% !important; }</style>")) # %matplotlib inline %load_ext autoreload %autoreload 2 import sys, os, random, pprint sys.path.append('../') import tensorflow as tf import keras.backend as KB imp...
github_jupyter
# Autoregressive Moving Average (ARMA): Sunspots data ``` %matplotlib inline import numpy as np from scipy import stats import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.graphics.api import qqplot ``` ## Sunspots Data ``` print(sm.datasets.sunspots.NOTE) dta = sm.data...
github_jupyter
# 数据迭代 `Ascend` `GPU` `CPU` `数据准备` [![下载样例代码](https://gitee.com/mindspore/docs/raw/master/resource/_static/logo_download_code.png)](https://obs.dualstack.cn-north-4.myhuaweicloud.com/mindspore-website/notebook/master/programming_guide/zh_cn/mindspore_dataset_usage.py)&emsp;[![下载Notebook](https://gitee.com/mindspore/d...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os from os import listdir from os.path import isfile, join import numpy as np import matplotlib.pyplot as plt import madmom import sys sys.path.append('../src') from preprocessing import get_dataset, load_rhythm_feature_db from models import OLSPatchRegressor from utils ...
github_jupyter
CER003 - Upload existing Root CA certificate ============================================ Use this notebook to upload a Root CA certificate to a cluster that was downloaded to this machine using: - [CER002 - Download existing Root CA certificate](../cert-management/cer002-download-existing-root-ca.ipynb) If ne...
github_jupyter
This notebook demonstrates the result of the first round of data collection, collected in the San Francisco Bay Area by @shankari. The round had several shortcomings, some of which were addressed during the data collection and some of which were fixed before starting the second round of data collection. ## Import all ...
github_jupyter
# Intro to programming using python ## Objectives * To get a brief overview of what Python is * To understand computer basics and programs * To write a small python program using: https://repl.it/languages/python3 ### Python has been increasingly popular in the last few years. ![Graph of popularity from tiobe.com](...
github_jupyter
``` # Initialize Otter Grader import otter grader = otter.Notebook() ``` ![data-x](https://raw.githubusercontent.com/afo/data-x-plaksha/master/imgsource/dx_logo.png) # In-class Assignment (Feb 9) Run the following two cells to load the required modules and read the data. ``` import pandas as pd import numpy as np ...
github_jupyter
# Comparing Collaborative Filtering Systems According to studies done by the article "Comparing State-of-the-Art Collaborative Filtering Systems" by Laurent Candillier, Frank Meyer, and Marc Boulle, the __best user based approach__ is based on __pearson similarity and 1500 neighbors__. The __best item based approach...
github_jupyter
# Sentiment Analysis - SQL Achemy ## A. Load Libraries ``` import pandas as pd import numpy as np import csv from sqlalchemy import Column, String, Integer, ForeignKey, DateTime, func from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base ``` ## B. Load 3 csv files ...
github_jupyter
# Homework: Introduction to Time Series ##### Summary - Measuring error with MAPE - Selecting parameters in exponential smoothing - Comparing ARIMA and SARIMA - Holiday effects with Facebook's Prophet library ``` import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np ``` ## 1. M...
github_jupyter
# Linear Regression ##### Examining the relationship between a player's pass volume and completion percentage --- ``` import requests import pandas as pd from tqdm import tqdm import matplotlib.pyplot as plt ``` Same as in previous Notebook, but we're adding: - `matplotlib.pyplot as plt`. which is the commonly-used...
github_jupyter
# TensorFlow Distributions: A Gentle Introduction >[TensorFlow Distributions: A Gentle Introduction](#scrollTo=DcriL2xPrG3_) >>[Basic Univariate Distributions](#scrollTo=QD5lzFZerG4H) >>[Multivariate Distributions](#scrollTo=ztM2d-N9nNX2) >>[Multiple Distributions](#scrollTo=57lLzC7MQV-9) >>[Using Independent To A...
github_jupyter
# Homework 1 # In this problem you will explore some consequences of the ocean's nonlinear equation of state. Then you will make some calculations regarding air-sea fluxes. Each question is worth 25%. There is an _optional_ bonus question at the end which is worth 10 points towards any future homework. You will need ...
github_jupyter
# Compare data to predictions In the previous [notebook](https://github.com/hundredblocks/ml-powered-applications/blob/master/notebooks/train_simple_model.ipynb), we trained a simple model and looked at its accuracy, precision, recall, and f1-score. These are fine aggregate metrics, but we'd like to gain a deeper unde...
github_jupyter
``` import numpy as np import keras from matplotlib.pyplot import imshow import h5py import cv2 from zipfile import ZipFile keras.backend.set_image_data_format('channels_last') from keras.layers import Input, Activation, Conv2D from keras.models import Model zipped_images = ZipFile('train_images.zip') # 查看目录结构 zipped_i...
github_jupyter
<img src="../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px\" align="left"> # Quantum Volume Overview ### Contributors Shelly Garion$^{1}$ and David McKay$^{2}$ 1. IBM Research Haifa, Haifa University Campus...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/contrib/palettes-test-crameri-dem.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target...
github_jupyter
# WeatherPy ---- #### Note * Instructions have been included for each segment. You do not have to follow them exactly, but they are included to help you think through the steps. ``` # Dependencies and Setup import matplotlib.pyplot as plt import pandas as pd import numpy as np import requests import time from scipy.s...
github_jupyter
``` """ This is a python notebook to create a stock screener. The finished product will accept a set of parameters and output the stocks that meet those requirements. Currently this scanner follows the "Swing Traders Checklist" @ https://www.swing-trade-stocks.com/swing-traders-checklist.html. The goal is to deploy th...
github_jupyter
# Introduction/Business Problem Car accidents are one of the most common issues found across the globe to be severe.Accidents might sometimes be due to our negligence or due to natural reasons or anything.Sometimes, we might be too lazy or negligent to drive costing our lives as well as the others.Whereas sometimes, d...
github_jupyter
문장을 입력해서 이진분류하는 모델에 대해서 알아보겠습니다. 언어가 시계열적인 의미가 있으므로, 이 언어를 문자로 표현한 문장도 시계열적인 의미가 있습니다. 모델에 입력하기 위해서 문장을 시계열수치로 인코딩하는 방법과 여러가지 이진분류 모델을 구성해보고, 학습 결과를 살펴보겠습니다. 이 모델들은 문장 혹은 시계열수치로 양성/음성을 분류하거나 이벤트 발생 유무를 감지하는 문제를 풀 수 있습니다. --- ### 데이터셋 준비 IMDB에서 제공하는 영화 리뷰 데이터셋을 이용하겠습니다. 이 데이터셋은 훈련셋 25,000개, 시험셋 25,000개의 샘플을 제공합니다. 라벨은...
github_jupyter
# Scalable Batch GP Classification in 1D (w/ SVGP) This example shows how to use grid interpolation based variational classification with an `ApproximateGP` using a `VariationalStrategy` module while learning the inducing point locations. **Note:** The performance of this notebook is substantially improved by using ...
github_jupyter
# Списки Списками в Python называются массивы. Они могут содержать данные различных типов. Для создания списка автоматически можно использовать метод `list()`: ``` list('Lambda') ``` Также можно это сделать напрямую, присвоив переменной значение типа `list`: ``` # Пустой список s = [] # список с данными разных типо...
github_jupyter
``` # data retrieval import requests # data storage and manipulation import numpy as np import pandas as pd import matplotlib.pyplot as plt # functional tools to allow for model fine tuning from functools import partial, update_wrapper # modeling and validation from sklearn.model_selection import train_test_split fr...
github_jupyter
# Steam Data Cleaning - Optimising Cleaning of the Release Date Column *This forms part of a larger series of posts for my [blog](http://nik-davis.github.io) on downloading, processing and analysing data from the steam store. [See all posts here](http://nik-davis.github.io/tag/steam).* ``` # view software version inf...
github_jupyter
# Intro to TensorFlow ## Hello, Tensor World! ``` import tensorflow as tf # Create TensorFlow object called tensor hello_constant = tf.constant('Hello World!') with tf.Session() as sess: # Run the tf.constant operatin in the session output = sess.run(hello_constant) print(output) ``` ### Tensor In Ten...
github_jupyter
# Generates images from text prompts with CLIP guided diffusion. By Katherine Crowson (https://github.com/crowsonkb, https://twitter.com/RiversHaveWings). It uses a 512x512 unconditional ImageNet diffusion model fine-tuned from OpenAI's 512x512 class-conditional ImageNet diffusion model (https://github.com/openai/guid...
github_jupyter
## Chapter 2: Refresher of OOP concepts in Python ### Classes and Objects ``` class ClassName: '''attributes...''' '''methods...''' objName = ClassName() class Branch: '''attributes...''' '''methods...''' class Branch: '''attributes''' branchID = None branchStreet = None bran...
github_jupyter
Deep Learning ============= Assignment 5 ------------ The goal of this assignment is to train a Word2Vec skip-gram model over [Text8](http://mattmahoney.net/dc/textdata) data. ``` # These are all the modules we'll be using later. Make sure you can import them # before proceeding further. %matplotlib inline from __fu...
github_jupyter
# VQGAN JAX Encoding for `webdataset` This notebook shows how to pre-encode images to token sequences using JAX, VQGAN and a dataset in the [`webdataset` format](https://webdataset.github.io/webdataset/). This example uses a small subset of YFCC100M we created for testing, but it should be easy to adapt to any other ...
github_jupyter
<a href="https://colab.research.google.com/github/ekramasif/Basic-Machine-Learning/blob/main/Classification/Random_Forest_Classification.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Random Forest Classification ## Importing the libraries ``` ...
github_jupyter
# Introduction: How H1st.AI enables the Industrial AI Revolution This tutorial will teach you how H1st AI can help solve the Cold Start problem in domains where labeled data is not available or prohibitively expensive to obtain. One example of such a domain is cybersecurity, which is increasingly looking forward to a...
github_jupyter
``` from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) ``` # Data Ingestion From External Sources - Spark * Generic Format * Special Format - Need Drivers * Avro * S3 * Relational Database * Postgres * MySQL * SQLServer * NoN-Relatio...
github_jupyter
``` ## import required packages for a parameter estimation technique import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import pandas as pd import math ##Import Experimental Reversible Data: rev_exp_data = pd.read_csv("data/10mVs_Reversible.csv") current_exp=rev_exp_data['curr...
github_jupyter
# Image Registration ## Overview ### Learning Objectives * Understand how ITK does computations in physical space * Understand why ITK does registration in physical space instead of pixel space * Become familiar with the components of the ITK Registration Framework, and survey their possible values The content for ...
github_jupyter
# Simulating Language 5, Simple Innate Signalling (walkthrough) This is a line-by-line walkthrough of the code for lab on simple signalling. ### Data Structures: a signalling matrix represented as a list of lists A production system can be thought of as a matrix which maps meanings to signals. We are representing th...
github_jupyter
# Natural Language Processing with `nltk` `nltk` is the most popular Python package for Natural Language processing, it provides algorithms for importing, cleaning, pre-processing text data in human language and then apply computational linguistics algorithms like sentiment analysis. ## Inspect the Movie Reviews Data...
github_jupyter
<a href="https://colab.research.google.com/github/Mukilan-Krishnakumar/NLP_With_Disaster_Tweets/blob/main/NLP_with_Disaster_Tweets_Part_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> This is the part 2 of **NLP with Disaster Tweets Series**. The ...
github_jupyter
## 线性回归 ``` import numpy as np import pandas as pd ### 初始化模型参数 def initialize_params(dims): ''' 输入: dims:训练数据变量维度 输出: w:初始化权重参数值 b:初始化偏差参数值 ''' # 初始化权重参数为零矩阵 w = np.zeros((dims, 1)) # 初始化偏差参数为零 b = 0 return w, b ### 定义模型主体部分 ### 包括线性回归公式、均方损失和参数偏导三部分 def linear_loss(X, y...
github_jupyter
# Transformer的Keras实现 参考tensorflow的官方教程:[transformer](https://www.tensorflow.org/alpha/tutorials/sequences/transformer) * tensorflow==2.0.0a ``` !pip install -q tensorflow==2.0.0a !pip install -q matplotlib import tensorflow as tf import numpy as np import matplotlib.pyplot as plt tf.__version__ ``` ## positional...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import pycountry import retry import seaborn as sns %matplotlib in...
github_jupyter
Building the dataset of numerical data ``` #### STOP - ONLY if needed # Allows printing full text import pandas as pd pd.set_option('display.max_colwidth', None) #mid_keywords = best_keywords(data, 1, 0.49, 0.51) # same as above, but for average papers #low_keywords = best_keywords(data, 1, 0.03, 0.05) # same ...
github_jupyter
# Metric learning for MIR coding demo (2) # Training ## Enabling and testing the GPU First, you'll need to enable GPUs for the notebook: - Navigate to **Edit→Notebook** Settings - select **GPU** from the **Hardware Accelerator** drop-down Next, we'll confirm that we can connect to the GPU with tensorflow: > Sourc...
github_jupyter
# ANALYSIS OF VARIANCE (ANOVA) ## What is one-way ANOVA? The one-way analysis of variance (ANOVA) is used to determine whether there are any statistically significant differences between the means of three or more independent (unrelated) groups. ### Assumptions of ANOVA The assumptions of the ANOVA test are the same...
github_jupyter
Basic Terminal Apps === By this point, you have learned enough Python to start building interactive apps. If you are set on the larger projects such as building a video game, making a visualization, or making a web app, you can skip this section. But if you would like to start building some simpler apps that run direct...
github_jupyter
# Simple Line Plots Perhaps the simplest of all plots is the visualization of a single function $y = f(x)$. Here we will take a first look at creating a simple plot of this type. As with all the following sections, we'll start by setting up the notebook for plotting and importing the packages we will use: ``` %matpl...
github_jupyter
# 3 - An Introduction to Working with Annuli This Notebooks works through how we can work with annuli of line emission to infer their velocity structure. Using the full line emission can be beneficial to using just the collapsed rotation map as you have more information to work with. ## `linecube` For this Tutorial,...
github_jupyter
``` %matplotlib inline import pyNN.nest as p from pyNN.random import NumpyRNG, RandomDistribution from pyNN.utility import Timer import matplotlib.pyplot as plt import pylab import numpy as np timer = Timer() p.setup(timestep=0.1) # 0.1ms rngseed = 98766987 parallel_safe = True rng = NumpyRNG(seed=rngseed, parallel_...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Tutorial #3: Deploy an image classification model for encrypted inferencing in Azure Container Instance (ACI) This tutorial is **a new addition to the two-part series**. In the [previous tutorial](img-classification-part1-tr...
github_jupyter
#### importing libraries ``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.dates as mdates import seaborn as sns ``` #### Importing and understanding the dataset ``` #reading the dataset : "Dataframe.csv" df = pd.read_csv('./Datasets/DataFrame.csv') df...
github_jupyter
# Neo4j command note **Outline** * [Introduction](#intro) * [Cypher Note](#cypher) * [Reference](#refer) --- # <a id='intro'>Introduction</a> A graph database is an online database management system with Create, Read, Update and Delete (CRUD) operations working on a graph data model. **Why do we need Graph datab...
github_jupyter
1) Given the array split the array at the middle (if it is odd length consider next higher integer), add reverse the array. Ex: if input is [12,10,5,6,52,36] output should be [6,52,36,12,10,5] if input is [12,10,5,6,52,36,34] output should be [6,52,36,34,12,10,5] ``` import math # Complete this function to get the...
github_jupyter