code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# How random is `r/random`? There's a limit of 0.5 req/s (1 request every 2 seconds) ## What a good response looks like (status code 302) ``` $ curl https://www.reddit.com/r/random <html> <head> <title>302 Found</title> </head> <body> <h1>302 Found</h1> The resource was found at <a href="https://www.reddit...
github_jupyter
# A 🤗 tour of transformer applications In this notebook we take a tour around transformers applications. The transformer architecture is very versatile and allows us to perform many NLP tasks with only minor modifications. For this reason they have been applied to a wide range of NLP tasks such as classification, nam...
github_jupyter
# Titania = CLERK MOTEL On Bumble, the Queen of Fairies and the Queen of Bees got together to find some other queens. * Given * Queen of Fairies * Queen of Bees * Solutions * C [Ellery Queen](https://en.wikipedia.org/wiki/Ellery_Queen) = TDDTNW M UPZTDO * L Queen of Hearts = THE L OF HEARTS * E Queen Elizabe...
github_jupyter
# Contrasts Overview ``` from __future__ import print_function import numpy as np import statsmodels.api as sm ``` This document is based heavily on this excellent resource from UCLA http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm A categorical variable of K categories, or levels, usually enters a regress...
github_jupyter
# Gym environment with scikit-decide tutorial: Continuous Mountain Car In this notebook we tackle the continuous mountain car problem taken from [OpenAI Gym](https://gym.openai.com/), a toolkit for developing environments, usually to be solved by Reinforcement Learning (RL) algorithms. Continuous Mountain Car, a sta...
github_jupyter
Timing ------ Quickly time a single line. ``` import math import ubelt as ub timer = ub.Timer('Timer demo!', verbose=1) with timer: math.factorial(100000) ``` Robust Timing and Benchmarking ------------------------------ Easily do robust timings on existing blocks of code by simply indenting them. The quick and...
github_jupyter
``` %run ../Python_files/util_data_storage_and_load.py %run ../Python_files/load_dicts.py %run ../Python_files/util.py import numpy as np from numpy.linalg import inv # load link flow data import json with open('../temp_files/link_day_minute_Jul_dict_JSON_adjusted.json', 'r') as json_file: link_day_minute_Jul_dic...
github_jupyter
<a href="https://colab.research.google.com/github/Granero0011/AB-Demo/blob/master/Monte_Carlo_Simulation_Example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd import numpy as np import seaborn as sns sns.set_style('whitegr...
github_jupyter
``` import random import os import sys from time import sleep from datetime import datetime import requests as rt import numpy as np from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.common.e...
github_jupyter
``` import tensorflow as tf import numpy as np import tsp_env def attention(W_ref, W_q, v, enc_outputs, query): with tf.variable_scope("attention_mask"): u_i0s = tf.einsum('kl,itl->itk', W_ref, enc_outputs) u_i1s = tf.expand_dims(tf.einsum('kl,il->ik', W_q, query), 1) u_is = tf.einsum('k,itk...
github_jupyter
<div align="right"><i>COM418 - Computers and Music</i></div> <div align="right"><a href="https://people.epfl.ch/paolo.prandoni">Lucie Perrotta</a>, <a href="https://www.epfl.ch/labs/lcav/">LCAV, EPFL</a></div> <p style="font-size: 30pt; font-weight: bold; color: #B51F1F;">Channel Vocoder</p> ``` %matplotlib inline im...
github_jupyter
Authored by: Avani Gupta <br> Roll: 2019121004 **Note: dataset shape is version dependent hence final answer too will be dependent of sklearn version installed on machine** # Excercise: Eigen Face Here, we will look into ability of PCA to perform dimensionality reduction on a set of Labeled Faces in the Wild dat...
github_jupyter
<div align="center"> <h1><img width="30" src="https://madewithml.com/static/images/rounded_logo.png">&nbsp;<a href="https://madewithml.com/">Made With ML</a></h1> Applied ML · MLOps · Production <br> Join 30K+ developers in learning how to responsibly <a href="https://madewithml.com/about/">deliver value</a> with ML. ...
github_jupyter
# Expressions and Arithmetic **CS1302 Introduction to Computer Programming** ___ ## Operators The followings are common operators you can use to form an expression in Python: | Operator | Operation | Example | | --------: | :------------- | :-----: | | unary `-` | Negation | `-y` | | `+` | Addi...
github_jupyter
``` %matplotlib inline from IPython import display import matplotlib.pyplot as plt import torch from torch import nn import torchvision import torchvision.transforms as transforms import time import sys sys.path.append("../") import d2lzh1981 as d2l from tqdm import tqdm print(torch.__version__) print(torchvision._...
github_jupyter
``` import os import numpy as np np.random.seed(0) import pandas as pd import matplotlib.pyplot as plt from sklearn import set_config set_config(display="diagram") DATA_PATH = os.path.abspath( r"C:\Users\jan\Dropbox\_Coding\UdemyML\Chapter13_CaseStudies\CaseStudyIncome\adult.xlsx" ) ``` ### Dataset ``` df = pd.re...
github_jupyter
# UK research networks with HoloViews+Bokeh+Datashader [Datashader](http://datashader.readthedocs.org) makes it possible to plot very large datasets in a web browser, while [Bokeh](http://bokeh.pydata.org) makes those plots interactive, and [HoloViews](http://holoviews.org) provides a convenient interface for building...
github_jupyter
# Типы данных в Python ## 1. Числовые ### int ``` x = 5 print (x) print(type(x)) a = 4 + 5 b = 4 * 5 c = 5 // 4 print(a, b, c) print -5 / 4 print -(5 / 4) ``` ### long ``` x = 5 * 1000000 * 1000000 * 1000000 * 1000000 + 1 print x print type(x) y = 5 print type(y) y = x print type(y) ``` ### float ``` y = 5.7 pr...
github_jupyter
<img src="images/utfsm.png" alt="" width="100px" align="right"/> # USM Numérica ## Licencia y configuración del laboratorio Ejecutar la siguiente celda mediante *`Ctr-S`*. ``` """ IPython Notebook v4.0 para python 3.0 Librerías adicionales: Contenido bajo licencia CC-BY 4.0. Código bajo licencia MIT. (c) Sebastian ...
github_jupyter
# Prudential Life Insurance Assessment An example of the structured data lessons from Lesson 4 on another dataset. ``` %reload_ext autoreload %autoreload 2 %matplotlib inline import os from pathlib import Path import pandas as pd import numpy as np import torch from torch import nn import torch.nn.functional as F f...
github_jupyter
# **Quality Control (QC) and filtering** This notebooks serves for filtering of the second human testis sample. It is analogous to the filtering of the other sample, so feel free to go through it faster and just skimming through the text. --------------------- **Motivation:** Quality control and filtering is the mo...
github_jupyter
Carbon Insight: Carbon Emissions Visualization ============================================== This tutorial aims to showcase how to visualize anthropogenic CO2 emissions with a near-global coverage and track correlations between global carbon emissions and socioeconomic factors such as COVID-19 and GDP. ``` # Require...
github_jupyter
``` from sklearn.model_selection import train_test_split import pandas as pd import tensorflow as tf import tensorflow_hub as hub from datetime import datetime import bert from bert import run_classifier from bert import optimization from bert import tokenization from tensorflow import keras import os import re # Set t...
github_jupyter
<a href="https://cognitiveclass.ai"><img src = "https://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.png" width = 400> </a> <h1 align=center><font size = 5>From Requirements to Collection</font></h1> ## Introduction In this lab, we will continue learning about the data science methodology, and focus on...
github_jupyter
# # Lists ### == > it is same as array in c++ , but it can also store multiple data types at the same time ``` # creating lists a = [1,2,3] print(type(a)) a1 = list() print(a1) a2 = list(a) print(a2) a4 = [ i for i in range(10)] ## for range from 0 to 10 set i print(a4) a5 = [ i*i for i in range(10)] print(a5) a...
github_jupyter
``` # default_exp data.unwindowed ``` # Unwindowed datasets > This functionality will allow you to create a dataset that applies sliding windows to the input data on the fly. This heavily reduces the size of the input data files, as only the original, unwindowed data needs to be stored. ``` #export from tsai.imports...
github_jupyter
# Ungraded Lab: Build a Multi-output Model In this lab, we'll show how you can build models with more than one output. The dataset we will be working on is available from the [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Energy+efficiency). It is an Energy Efficiency dataset which uses the ...
github_jupyter
# Fine-tuning a Pretrained Network for Style Recognition In this example, we'll explore a common approach that is particularly useful in real-world applications: take a pre-trained Caffe network and fine-tune the parameters on your custom data. The advantage of this approach is that, since pre-trained networks are le...
github_jupyter
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS109A Introduction to Data Science ## Homework 4: Logistic Regression **Harvard University**<br/> **Fall 2019**<br/> **Instructors**: Pavlos Protopapas, Kevin...
github_jupyter
# Homework 2 - Deep Learning ## Liberatori Benedetta ``` import torch import numpy as np # A class defining the model for the Multi Layer Perceptron class MLP(torch.nn.Module): def __init__(self): super().__init__() self.layer1 = torch.nn.Linear(in_features=6, out_features=2, bias= True) s...
github_jupyter
# Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning....
github_jupyter
# 40 kotlin-dataframe puzzles inspired by [100 pandas puzzles](https://github.com/ajcr/100-pandas-puzzles) ## Importing kotlin-dataframe ### Getting started Difficulty: easy **1.** Import kotlin-dataframe ``` %use dataframe(0.8.0-dev-595-0.11.0.13) ``` ## DataFrame Basics ### A few of the fundamental routines for s...
github_jupyter
# Veg ET validation ``` import pandas as pd from time import time import xarray as xr import numpy as np def _get_year_month(product, tif): fn = tif.split('/')[-1] fn = fn.replace(product,'') fn = fn.replace('.tif','') fn = fn.replace('_','') print(fn) return fn def _file_object(bucket_prefix,p...
github_jupyter
``` #!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.path.append('../') from loglizer.models import SVM from loglizer import dataloader, preprocessing import numpy as np struct_log = '../data/HDFS/HDFS_100k.log_structured.csv' # The structured log file label_file = '../data/HDFS/anomaly_label.csv' # The a...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt data=pd.read_csv('F:\\bank-additional-full.csv',sep=';') data.shape tot=len(set(data.index)) last=data.shape[0]-tot last data.isnull().sum() print(data.y.value_counts()) sns.countplot(x='y', data=data) plt.show() cat=data.s...
github_jupyter
# Requirements Documentation and Notes # SQL Samples 2. Total monthly commits ```sql SELECT date_trunc( 'month', commits.cmt_author_timestamp AT TIME ZONE'America/Chicago' ) AS DATE, repo_name, rg_name, cmt_author_name, cmt_author_email, ...
github_jupyter
``` # import all packages and set plots to be embedded inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sb %matplotlib inline # load in the dataset into a pandas dataframe diamonds = pd.read_csv('./data/diamonds.csv') # convert cut, color, and clarity into ordered categor...
github_jupyter
# Revisiting Lambert's problem in Python ``` import numpy as np import matplotlib.pyplot as plt from cycler import cycler from poliastro.core import iod from poliastro.iod import izzo plt.ion() plt.rc('text', usetex=True) ``` ## Part 1: Reproducing the original figure ``` x = np.linspace(-1, 2, num=1000) M_list = ...
github_jupyter
``` # DATAFRAMES INITIALISATION import os os.chdir('C:\\Users\\asus\\OneDrive\\Documenti\\University Docs\\MSc Computing\\Final Project\\RainbowFood(JN)\\Rainbow-Food-Collaborative-Filtering-') import pandas as pd # vegetables file col_list_veg = ["Vegetables", "Serving", "Calories"] df_veg = pd.read_csv("Vegetables...
github_jupyter
# Download data for a functional layer of Spatial Signatures This notebook downloads and prepares data for a functional layer of Spatial Signatures. ``` from download import download import geopandas as gpd import pandas as pd import osmnx as ox from tqdm import tqdm from glob import glob import rioxarray as ra impor...
github_jupyter
# GLM: Negative Binomial Regression ``` %matplotlib inline import numpy as np import pandas as pd import pymc3 as pm from scipy import stats import matplotlib.pyplot as plt plt.style.use('seaborn-darkgrid') import seaborn as sns import re print('Running on PyMC3 v{}'.format(pm.__version__)) ``` This notebook demos ne...
github_jupyter
# Multi-qubit quantum circuit In this exercise we creates a two qubit circuit, with two qubits in superposition, and then measures the individual qubits, resulting in two coin toss results with the following possible outcomes with equal probability: $|00\rangle$, $|01\rangle$, $|10\rangle$, and $|11\rangle$. This is li...
github_jupyter
# Twitter Mining Function & Scatter Plots --------------------------------------------------------------- ``` # Import Dependencies %matplotlib notebook import os import csv import json import requests from pprint import pprint import numpy as np import pandas as pd import matplotlib.pyplot as plt from twython import ...
github_jupyter
# Simulating Power Spectra In this notebook we will explore how to simulate the data that we will use to investigate how different spectral parameters can influence band ratios. Simulated power spectra will be created with varying aperiodic and periodic parameters, and are created using the [FOOOF](https://github.co...
github_jupyter
# Symbolic System Create a symbolic three-state system: ``` import markoviandynamics as md sym_system = md.SymbolicDiscreteSystem(3) ``` Get the symbolic equilibrium distribution: ``` sym_system.equilibrium() ``` Create a symbolic three-state system with potential energy barriers: ``` sym_system = md.SymbolicDisc...
github_jupyter
# Logistic Regression Modules ``` import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms ``` Hyper-parameters ``` input_size = 784 num_classes = 10 num_epochs = 5 batch_size = 100 learning_rate = 0.001 ``` MNIST dataset (images and labels) ``` train_dataset = torchvision...
github_jupyter
# Version information ``` from datetime import date print("Running date:", date.today().strftime("%B %d, %Y")) import pyleecan print("Pyleecan version:" + pyleecan.__version__) import SciDataTool print("SciDataTool version:" + SciDataTool.__version__) ``` # How to define a machine This tutorial shows the different ...
github_jupyter
## 练习 1:写程序,可由键盘读入用户姓名例如Mr. right,让用户输入出生的月份与日期,判断用户星座,假设用户是金牛座,则输出,Mr. right,你是非常有性格的金牛座!。 ``` name = input('请输入你的姓名') print('你好',name) print('请输入出生的月份与日期') month = int(input('月份:')) date = int(input('日期:')) if month == 4: if date < 20: print(name, '你是白羊座') else: print(name,'你是非常有性格的金牛座') ...
github_jupyter
# Buscas supervisionadas ## Imports ``` # imports necessarios from search import * from notebook import psource, heatmap, gaussian_kernel, show_map, final_path_colors, display_visual, plot_NQueens import networkx as nx import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator im...
github_jupyter
``` """The file needed to run this notebook can be accessed from the following folder using a UTS email account: https://drive.google.com/drive/folders/1y6e1Z2SbLDKkmvK3-tyQ6INO5rrzT3jp """ ``` # Object Detection Using RFCN ## Tutorial: 1. Image annotation using LabelImg 2. Conversion of annotation & images into tfre...
github_jupyter
# 1. Enumerate sentence Create a function that prints words within a sentence along with their index in front of the word itself. For example if we give the function the argument "This is a sentence" it should print ``` 1 This 2 is 3 a 4 sentence ``` ``` def enumWords(sentence): #Complete this method. ``` # 2. ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import scipy.stats as sts import seaborn as sns sns.set() %matplotlib inline ``` # 01. Smooth function optimization Рассмотрим все ту же функцию из задания по линейной алгебре: $ f(x) = \sin{\frac{x}{5}} * e^{\frac{...
github_jupyter
# Mount Drive ``` from google.colab import drive drive.mount('/content/drive') !pip install -U -q PyDrive !pip install httplib2==0.15.0 import os from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from pydrive.files import GoogleDriveFileList from google.colab import auth from oauth2client.clien...
github_jupyter
``` import pandas as pd import numpy as np data = pd.read_csv('features_30_sec.csv') data.head() dataset = data[data['label'].isin(['blues', 'classical', 'jazz', 'metal', 'pop'])].drop(['filename','length'],axis=1) dataset.iloc[:, :-15].head() from sklearn.model_selection import train_test_split from sklearn.preprocess...
github_jupyter
## Importing Packages ``` import pandas as pd import numpy as np import tqdm import pickle from pprint import pprint import os import warnings warnings.filterwarnings('ignore', category=DeprecationWarning) #sklearn from sklearn.manifold import TSNE from sklearn.feature_extraction.text import CountVectorizer from skl...
github_jupyter
# Analyzing data with Dask, SQL, and Coiled In this notebook, we look at using [Dask-SQL](https://dask-sql.readthedocs.io/en/latest/), an exciting new open-source library which adds a SQL query layer on top of Dask. This allows you to query and transform Dask DataFrames using common SQL operations. ## Launch a cluste...
github_jupyter
``` # Copyright 2019 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License") import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras import layers import tensorflow.keras.backend as keras_backend tf.keras.backend.set_floatx('float32') import tensorflow_probability as tfp f...
github_jupyter
<a href="https://colab.research.google.com/github/gpdsec/Residual-Neural-Network/blob/main/Custom_Resnet_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> *It's custom ResNet trained demonstration purpose, not for accuracy. Dataset used is cats_vs_d...
github_jupyter
``` import geopandas as gpd import pandas as pd import os import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import tarfile from discretize import TensorMesh from SimPEG.utils import plot2Ddata, surface2ind_topo from SimPEG.potential_fields import gravity from SimPEG import ( maps, d...
github_jupyter
# Overview In this project, I will build an item-based collaborative filtering system using [MovieLens Datasets](https://grouplens.org/datasets/movielens/latest/). Specically, I will train a KNN models to cluster similar movies based on user's ratings and make movie recommendation based on similarity score of previous...
github_jupyter
``` import json import os from pathlib import Path import time import copy import numpy as np import pandas as pd import torch from torch import nn, optim from torch.utils.data import Dataset, DataLoader from torchvision import models from fastai.dataset import open_image import json from PIL import ImageDraw, ImageFo...
github_jupyter
## Bibliotecas: ``` #importanto bibliotecas import matplotlib.pyplot as plt import pandas as pd import numpy as np from sklearn import datasets, linear_model, preprocessing import statsmodels.api as sm from sklearn.metrics import mean_squared_error, r2_score from sklearn.preprocessing import StandardScaler from dat...
github_jupyter
# Introduction to Deep Learning with PyTorch In this notebook, you'll get introduced to [PyTorch](http://pytorch.org/), a framework for building and training neural networks. PyTorch in a lot of ways behaves like the arrays you love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tenso...
github_jupyter
Quick study to investigate oscillations in reported infections in Germany. Here is the plot of the data in question: ``` import coronavirus import numpy as np import matplotlib.pyplot as plt %config InlineBackend.figure_formats = ['svg'] coronavirus.display_binder_link("2020-05-10-notebook-weekly-fluctuations-in-data...
github_jupyter
# Predict Happiness Source - Importing the Packages ``` # importing packages import pandas as pd import numpy as np # For mathematical calculations import seaborn as sns # For data visualization import matplotlib.pyplot as plt # For plotting graphs %matplotlib inline ...
github_jupyter
``` from scipy.special import expit from rbm import RBM from sampler import VanillaSampler, PartitionedSampler from trainer import VanillaTrainier from performance import Result import numpy as np import datasets, performance, plotter, mnist, pickle, rbm, os, logging logger = logging.getLogger() # Set the logging leve...
github_jupyter
``` !pip install matplotlib import os import argparse import time import numpy as np import torch import torch.nn as nn import torch.optim as optim class Args: method = 'dopri5' # choices=['dopri5', 'adams'] data_size = 1000 batch_time = 10 batch_size = 20 niters = 2000 test_freq = 20 viz = ...
github_jupyter
``` from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error, r2_score from sklearn.metrics import mean_absolute_error from sklearn.model_selection import GridSearchCV from sklearn...
github_jupyter
--- _You are currently looking at **version 1.0** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-text-mining/resources/d9pwm) course resource._ --- # Assignment 2 - Introd...
github_jupyter
# Assignment 4: Word Sense Disambiguation: from start to finish ## Due: Tuesday 6 December 2016 15:00 p.m. Please name your Jupyter notebook using the following naming convention: ASSIGNMENT_4_FIRSTNAME_LASTNAME.ipynb Please send your assignment to `m.c.postma@vu.nl`. A well-known NLP task is [Word Sense Disambigu...
github_jupyter
<a href="https://colab.research.google.com/github/sarahalyahya/SoftwareArt-Text/blob/main/LousyFairytaleGenerator_Assemblage_Project1_.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Lousy Fairytale Plot Generator | Sarah Al-Yahya *scroll to the en...
github_jupyter
# Imports ``` from __future__ import division from __future__ import print_function from __future__ import absolute_import import cvxpy as cp import time import collections from typing import Dict from typing import List import pandas as pd import numpy as np import datetime import matplotlib.pyplot as plt import sea...
github_jupyter
``` import seaborn as sb import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler import pandas as pd from sklearn.neighbors import NearestNeighbors link='/Users/afatade/Downloads/anime_cleaned.csv' data=pd.read_csv(link) data.head() len(data) #We have a lot of data. Lets see wh...
github_jupyter
# <font color='blue'>Data Science Academy</font> # <font color='blue'>Big Data Real-Time Analytics com Python e Spark</font> # <font color='blue'>Capítulo 6</font> # Machine Learning em Python - Parte 2 - Regressão ``` from IPython.display import Image Image(url = 'images/processo.png') import sklearn as sl import w...
github_jupyter
## Plotting Results ``` experiment_name = ['l1000_AE','l1000_cond_VAE','l1000_VAE','l1000_env_prior_VAE'] import numpy as np from scipy.spatial.distance import cosine from scipy.linalg import svd, inv import pandas as pd import matplotlib.pyplot as plt import dill as pickle import os import pdb import torch import ai....
github_jupyter
``` import torch import torch.nn as nn import torch.nn.functional as F import torch.autograd.variable as Variable import torch.utils.data as data import torchvision from torchvision import transforms import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import sparse import lightfm...
github_jupyter
``` # # This small example shows you how to access JS-based requests via Selenium # Like this, one can access raw data for scraping, # for example on many JS-intensive/React-based websites # import time from selenium import webdriver from selenium.webdriver import DesiredCapabilities from selenium.webdriver.support.ui...
github_jupyter
Evaluating performance of FFT2 and IFFT2 and checking for accuracy. <br><br> Note that the ffts from fft_utils perform the transformation in place to save memory.<br><br> As a rule of thumb, it's good to increase the number of threads as the size of the transform increases until one hits a limit <br><br> pyFFTW uses lo...
github_jupyter
``` %load_ext autoreload %autoreload 2 import warnings warnings.filterwarnings('ignore') import math from time import time import pickle import pandas as pd import numpy as np from time import time from sklearn.neural_network import MLPClassifier from sklearn.ensemble import BaggingClassifier from sklearn.metrics imp...
github_jupyter
``` import numpy as np import tensorflow as tf from sklearn.utils import shuffle import re import time import collections import os def build_dataset(words, n_words, atleast=1): count = [['PAD', 0], ['GO', 1], ['EOS', 2], ['UNK', 3]] counter = collections.Counter(words).most_common(n_words) counter = [i for...
github_jupyter
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_12_04_atari.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # T81-558: Applications of Deep Neural Networks **Module 12: Reinforcement Learn...
github_jupyter
# Disclaimer Released under the CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) # Purpose of this notebook The purpose of this document is to show how I approached the presented problem and to record my learning experience in how to use Tensorflow 2 and CatBoost to perform a classification task on t...
github_jupyter
# Creating a Sentiment Analysis Web App ## Using PyTorch and SageMaker _Deep Learning Nanodegree Program | Deployment_ --- Now that we have a basic understanding of how SageMaker works we will try to use it to construct a complete project from end to end. Our goal will be to have a simple web page which a user can u...
github_jupyter
<a href="https://colab.research.google.com/github/120Davies/DS-Unit-4-Sprint-3-Deep-Learning/blob/master/Ro_Davies_LS_DS_431_RNN_and_LSTM_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <img align="left" src="https://lever-client-logos.s3...
github_jupyter
## Data Description and Analysis ``` import numpy as np import pandas as pd pd.set_option('max_columns', 150) import gc import os # matplotlib and seaborn for plotting import matplotlib matplotlib.rcParams['figure.dpi'] = 120 #resolution matplotlib.rcParams['figure.figsize'] = (8,6) #figure size import matplotlib.p...
github_jupyter
--- ## Data Prep ### Dataset Cleaning ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline from time import time from src.features import build_features as bf from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import GridSearchC...
github_jupyter
``` import scipy.io, os import numpy as np import matplotlib.pyplot as plt from netCDF4 import Dataset from fastjmd95 import rho from matplotlib.colors import ListedColormap import seaborn as sns; sns.set() sns.set() import seawater as sw from mpl_toolkits.axes_grid1.inset_locator import inset_axes import matp ...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.decomposition import PCA,TruncatedSVD,NMF from sklearn.preprocessing import Normalizer import argparse import time import pickle as pkl def year_binner(year,val=10): return year - year%val def dim_reduction(df,rows): df_svd = TruncatedSVD(n_components=300,...
github_jupyter
Load libs and utilities. ``` !pip install -U -q PyDrive from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from oauth2client.client import GoogleCredentials from google.colab import drive drive.mount('/content/drive') %cd "drive/MyDrive/Projects/Fourier" !pip inst...
github_jupyter
# Neural Networks for Regression with TensorFlow > Notebook demonstrates Neural Networks for Regression Problems with TensorFlow - toc: true - badges: true - comments: true - categories: [DeepLearning, NeuralNetworks, TensorFlow, Python, LinearRegression] - image: images/nntensorflow.png ## Neural Network Regression...
github_jupyter
# Análise de Dados com Python Neste notebook, utilizaremos dados de automóveis para analisar a influência das características de um carro em seu preço, tentando posteriormente prever qual será o preço de venda de um carro. Utilizaremos como fonte de dados um arquivo .csv com dados já tratados em outro notebook. Caso ...
github_jupyter
``` import pandas as pd #This is the Richmond USGS Data gage river_richmnd = pd.read_csv('JR_Richmond02037500.csv') river_richmnd.dropna(); #Hurricane data for the basin - Names of Relevant Storms - This will be used for getting the storms from the larger set JR_stormnames = pd.read_csv('gis_match.csv') # Bring in the ...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/ndwi.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="https://nbvi...
github_jupyter
## Release the Kraken! ``` # The next library we're going to look at is called Kraken, which was developed by Université # PSL in Paris. It's actually based on a slightly older code base, OCRopus. You can see how the # flexible open-source licenses allow new ideas to grow by building upon older ideas. And, in # this ...
github_jupyter
``` # @title Copyright & License (click to expand) # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
github_jupyter
RMinimum : Full - Test ``` import math import random import queue ``` Testfall : $X = [0, \cdots, n-1]$, $k$ ``` # User input n = 2**10 k = 2**5 # Automatic X = [i for i in range(n)] # Show Testcase print(' Testcase: ') print('=============================') print('X = [0, ..., ' + str(n - 1) + '...
github_jupyter
# Advanced topics The following material is a deep-dive into Yangson, and is not necessarily representative of how one would perform manipulations in a production environment. Please refer to the other tutorials for a better picture of Rosetta's intended use. Keep in mind that the key feature of Yangson is to be abl...
github_jupyter
# Planning Search Agent Notebook version of the project [Implement a Planning Search](https://github.com/udacity/AIND-Planning) from [Udacity's Artificial Intelligence Nanodegree](https://www.udacity.com/course/artificial-intelligence-nanodegree--nd889) <br> **Goal**: Solve deterministic logistics planning problems f...
github_jupyter
>>> Work in Progress (Following are the lecture notes of Prof Andrew Ng/Head TA-Raphael Townshend - CS229 - Stanford. This is my interpretation of his excellent teaching and I take full responsibility of any misinterpretation/misinformation provided herein.) ## Lecture Notes #### Outline - Decision Trees - Ensemble M...
github_jupyter
``` import argparse import logging import math import os import random import shutil import time from collections import OrderedDict import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import LambdaLR from torch.utils.data import DataLoader, RandomS...
github_jupyter