text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
### Streaming Support
**Streaming is no longer supported in Chart Studio Cloud.<br>Streaming is still available as part of [Chart Studio Enterprise](https://plot.ly/products/on-premise/). Additionally, [Dash](https://plot.ly/products/dash/) supports streaming, as demonstrated by the [Dash Wind Streaming example](https:... | github_jupyter |
# Running Neurokernel on NVIDIA Jetson Embedded Platform
In this notebook, we show step by step how to run Neurokernel on [Jetson TK1 Embedded Development Kit](http://www.nvidia.com/object/jetson-tk1-embedded-dev-kit.html). It can be applied to the latest [Jetson TX1 platform](http://www.nvidia.com/object/jetson-tx1-d... | github_jupyter |
```
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
use_cuda = torch.cuda.is_available()
class E2EBlock(torch.nn.Module):
'''E2Eblock.'''
def __init__(self, in_planes, planes,example,bias=False):
... | github_jupyter |
```
import pandas as pd
import numpy as np
import re
import json
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import Pipeline
from sklearn.metrics import classification_report, conf... | github_jupyter |
```
# import libraries
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os
plt.style.use('ggplot')
%matplotlib inline
survey_2018 = pd.read_csv('./resources/04_Kaggle_Survey_2018.csv')
survey_2018 = survey_2018.drop([0],axis=0)
survey_2018.head(2)
total_2018 = survey_2018['Time from Start t... | github_jupyter |
```
import sys
import wandb
import pandas as pd
import numpy as np
from pprint import pprint
def mean_and_std(df):
agg = np.stack(df.to_numpy(), axis=0)
return np.mean(agg, axis=0), np.std(agg, axis=0)
download_root = "."
def get_sweep_regression_df_all(sweep_id, allow_crash=False):
api = wandb.Api()
... | github_jupyter |
# Face Recognition for the Happy House
Welcome to the first assignment of week 4! Here you will build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In lecture, we also talked about [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/deep... | github_jupyter |
```
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import torch
from scipy.io import loadmat
from tqdm import tqdm_notebook as tqdm
%matplotlib inline
use_cuda = torch.cuda.is_available()
device = torch.device('cuda:0' if use_cuda else 'cpu')
# Add new methods here.
# methods = ['h... | github_jupyter |
```
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "-1"
import numpy as np
import torch
import pandas as pd
from tqdm.auto import tqdm
from matplotlib import pyplot as plt
import seaborn as sns
```
# Problem setup
We solve the simpler problem where we search for a sparse set of dictionary items $d_i$ that sum up to a... | github_jupyter |
```
""" 1. Export your Postman Collection, then make an instance of the Postman runner. """
from pyclinic.postman import Postman
from rich import print
collection_path = "./tests/examples/deckofcards.postman_collection.json"
runner = Postman(collection_path)
""" 2. Did you see the warnings that were printed above?
Th... | github_jupyter |
```
import numpy as np
import pandas as pd
from Show import *
```
# Importing information
```
#Import pics information
data_info = pd.read_csv('dataset_images_minitest.csv',sep='\t')
# Information about data_info
print("Data size is:", len(data_info))
print("Columns:", *data_info.columns)
print("Categories:", *data_... | github_jupyter |
# Compute Word Vectors using TruncatedSVD in Amazon Food Reviews.
Data Source: https://www.kaggle.com/snap/amazon-fine-food-reviews
The Amazon Fine Food Reviews dataset consists of reviews of fine foods from Amazon.
Number of reviews: 568,454 Number of users: 256,059 Number of products: 74,258 Timespan: Oct 1999 - Oc... | github_jupyter |
Results:
- we subsetted Ag1000g P2 (1142 samples) zarr to the positions of the amplicon inserts
- a total of 1417 biallelic SNPs were observed in all samples, only one amplicon (29) did not have variation
- we performed PCA directly on those SNPs without LD pruning
- PCA readily splits Angolan samples `AOcol` and gener... | github_jupyter |
Problems: 8, 12, 18
```
%matplotlib inline
import numpy as np
import scipy.stats as st
import pandas as pd
import statsmodels.api as sm
import statsmodels.stats.api as sms
import statsmodels.formula.api as smf
import statsmodels.stats as stats
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display... | github_jupyter |
# Index
- Server & Client Architecture
- URL
- Get & Post
- Internet
- OSI 7 Layer
- cookie & session & cache
- Web Status Code
- Web Language & Framework
- Spider & Bot & Scraping & Crawling
#### Server & Client Architecture
- Client
- 브라우져를 통해 서버에 데이터를 요청
- Server
- Client가 데이터를 요청하면 요청에 따라 데이터를 전송 (HTML, CS... | github_jupyter |
```
# Install TensorFlow
# !pip install -q tensorflow-gpu==2.0.0-beta1
try:
%tensorflow_version 2.x # Colab only.
except Exception:
pass
import tensorflow as tf
print(tf.__version__)
# More imports
from tensorflow.keras.layers import Input, SimpleRNN, GRU, LSTM, Dense, Flatten, GlobalMaxPool1D
from tensorflow.ke... | github_jupyter |
### Preprocessing
```
# import relevant statistical packages
import numpy as np
import pandas as pd
# import relevant data visualisation packages
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# import custom packages
from sklearn.linear_model import LinearRegression
from sklearn.decompositio... | github_jupyter |
# OSMOSIS Spring
This notebook runs [GOTM](https://gotm.net/) with initial conditions and surface forcing during the spring months (Dec. 25, 2012 - Sep. 10, 2013) of the Ocean Surface Mixing, Ocean Submesoscale Interaction Study in the northeast Atlantic (OSMOSIS, 48.7$^\circ$N, 16.2$^\circ$W; [Damerell et al., 2016](... | github_jupyter |
<a href="https://colab.research.google.com/github/Serbeld/RX-COVID-19/blob/master/Detection5C_Norm_v2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install lime
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tens... | github_jupyter |
```
#NOTE: This must be the first call in order to work properly!
from deoldify import device
from deoldify.device_id import DeviceId
#choices: CPU, GPU0...GPU7
device.set(device=DeviceId.GPU0)
from deoldify.visualize import *
plt.style.use('dark_background')
torch.backends.cudnn.benchmark=True
import warnings
warnin... | github_jupyter |
## Naive Bayes
#### What is Naive Bayes?
Naive Bayes is among one of the most simple and powerful algorithms for classification based on Bayes’ Theorem with an assumption of independence among predictors. Naive Bayes model is easy to build and particularly useful for very large data sets. There are two parts to this... | github_jupyter |
# Chaotic systems prediction using NN
## This notebook is developed to show how well Neural Networks perform when presented with the task of predicting the trajectories of **Chaotic Systems**, this notebook is part of the work presented in *New results for prediction of chaotic systems using Deep Recurrent Neural Netw... | github_jupyter |
# Python Crash Course
Please note, this is not meant to be a comprehensive overview of Python or programming in general, if you have no programming experience, you should probably take my other course: [Complete Python Bootcamp](https://www.udemy.com/complete-python-bootcamp/?couponCode=PY20) instead.
**This notebook... | github_jupyter |
```
# This code block is for automatic testing purposes, please ignore.
try:
import openfermion
except:
import os
os.chdir('../src/')
```
# Lowering qubit requirements using binary codes
## Introduction
Molecular Hamiltonians are known to have certain symmetries that are not taken into account by mappings... | github_jupyter |
# Full experimentation pipeline
Reference: Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps https://arxiv.org/abs/1312.6034
We explore the possibility of detecting the trojan using saliency.
```
from math import ceil
import logging
import tensorflow as tf
import numpy as ... | github_jupyter |
# GradientBoostingClassifier with StandardScaler
**This Code template is for the Classification tasks using a GradientBoostingClassifier based on the Gradient Boosting Ensemble Learning Technique and feature rescaling technique StandardScaler**
### Required Packages
```
import warnings as wr
import numpy as np
imp... | github_jupyter |
# Features selection for multiple linear regression
Following is an example taken from the masterpiece book *Introduction to Statistical Learning by Hastie, Witten, Tibhirani, James*. It is based on an Advertising Dataset, available on the accompanying web site: http://www-bcf.usc.edu/~gareth/ISL/data.html
The datas... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import pandas as pd
import os
import sys, os
sys.path.insert(0, os.path.abspath('..'))
import data_generation.diff_utils
import data_generation.mwdiff.mwdiffs_to_tsv
import numpy as np
# load split data
out_dir = "../../data/figshare"
in_dir = "../../data/annot... | github_jupyter |
### Quickstart
To run the code below:
1. Click on the cell to select it.
2. Press `SHIFT+ENTER` on your keyboard or press the play button
(<button class='fa fa-play icon-play btn btn-xs btn-default'></button>) in the toolbar above.
Feel free to create new cells using the plus button
(<button class='fa fa-plus icon... | github_jupyter |
# Detect the best variables for each role so that we have variables to compare performance between a random player and our dataset
```
from datetime import datetime, timedelta
from functools import reduce
import numpy as np
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option('display.max_row... | github_jupyter |
# Sub-string divisibility
<p>The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.</p>
<p>Let <i>d</i><sub>1</sub> be the 1<sup>st</sup> digit, <i>d</i><sub>2</sub> be the 2<sup>nd</... | github_jupyter |
```
#imports
import os
import pandas as pd
from collections import Counter
from sklearn.model_selection import train_test_split
import torch
import torch.optim as optim
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
from torch.nn.utils.rnn import pack_padded_sequence
from torch.utils.data import Da... | github_jupyter |
# GAIT RECOGNITION
## 1. Data preparation
Let's create some directories
```
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
import shutil
partA = 'DatasetB-1/video/'
partB = 'DatasetB-2/video/'
silhouettes_dir = 'silhouettes_Unet22K/'
# define the path of CASIA directory
CASIA_dir = '/home/is... | github_jupyter |
```
# Initialize OK
from client.api.notebook import Notebook
ok = Notebook('lab08.ok')
```
# Lab 8: Multiple Linear Regression and Feature Engineering
In this lab, we will work through the process of:
1. Implementing a linear model
1. Defining loss functions
1. Feature engineering
1. Minimizing loss functions using ... | github_jupyter |
# camera_calib_python
This is a python based camera calibration "library". Some things:
* Uses [nbdev](https://github.com/fastai/nbdev), which is an awesome and fun way to develop and tinker.
* Uses pytorch for optimization of intrinsic and extrinsic parameters. Each step in the model is modularized as its own pytorc... | github_jupyter |
# Highlighting Task - Event Extraction from Text
In this tutorial, we will show how *dimensionality reduction* can be applied over *both the media units and the annotations* of a crowdsourcing task, and how this impacts the results of the CrowdTruth quality metrics. We start with an *open-ended extraction task*, where... | github_jupyter |
# Import necessary library
In this tutorial, we are going to use pytorch, the cutting-edge deep learning framework to complete our task.
```
import torch
import torchvision
#for reproducibility
torch.manual_seed(0)
import numpy as np
np.random.seed(0)
## Create dataloader, in PyTorch, we feed the trainer data with us... | github_jupyter |
```
import nltk
import string
import numpy as np
%matplotlib inline
from nltk import word_tokenize
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from sklearn import metrics
import warnings
warnings.filterwarnings("ignore")
enstop = stopwords.words('english')
punct = string.punctuation
def tokenize... | github_jupyter |
# Sinais periódicos
Neste notebook avaliaremos os sinais periódicos e quais são as condições necessárias para periodicidade.
Esta propriedade dos sinais está ligada ao ***deslocamento no tempo***, uma transformação da variável independente.
Um sinal periódico, contínuo, é aquele para o qual a seguinte propriedade é... | github_jupyter |

# terrainbento model Basic with variable $m$ steady-state solution
This model shows example usage of the Basic model from the TerrainBento package with a variable drainage-area exponent, $m$:
$\frac{\partial \eta}{\partial t} = - KQ^m S + D\nabla^2 \eta$
... | github_jupyter |
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/book1/linreg/svi_linear_regression_1d_tfp.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Stochastic variational inference for 1d linear regression using TFP.
Code Derive... | github_jupyter |
# Getting names and email id:
```
from bs4 import BeautifulSoup
import urllib.request
import pandas as pd
import re
df=pd.DataFrame(columns=['Name','Email','Department'])
```
### For applied mechanics
```
source = urllib.request.urlopen('https://am.iitd.ac.in/?q=node/24').read()
soup=BeautifulSoup(source,'lxml')
for... | github_jupyter |
# Universal Sentence Encoder Baseline for IDAT
In this notebook, we will walk you through the process of reproducing the Universal Sentence Encoder baseline for the IDAT Irony detection task.
## Loading Required Modules
We start by loading the needed python libraries.
```
import os
import tensorflow as tf
from tens... | github_jupyter |
```
import os
import random
pos_texts = os.listdir('fix_pos')
neg_texts = os.listdir('fix_neg')
print 'postive samples %d' % len(pos_texts)
print 'negtive samples %d' % len(neg_texts)
print 'total samples %d' % (len(pos_texts) + len(neg_texts))
```
**pos** 评价一览
```python
pos_samples = random.sample(pos_texts, 10)
for... | github_jupyter |
```
import numpy as np
from itertools import product
radius = 1737400
alt = 2000000
ground = 7.5
exposure = 0.005
samples = 1000
lines = 1000
sensor_rad = radius + alt
angle_per_line = ground / radius
angle_per_samp = angle_per_line
angle_per_Second = angle_per_line / exposure
line_vec = np.arange(0, lines... | github_jupyter |
```
from netCDF4 import Dataset, num2date
import numpy as np
import json
# import data
dataset = Dataset('netcdf/echam_daily.nc')
# interrogate dimensions
print(dataset.dimensions.keys())
# interrogate variable structure
print(dataset.variables['u10'])
# interrogate variables
# find the u and v wind data
print("Check v... | github_jupyter |
# Collecting VerbNet Terms
This notebook parses all the VerbNet .XML definitions - extracting all the possible PREDicates in the FRAME SEMANTICS and the ARG type-value tuples. This will allow DNA to understand/account for all the semantics that can be expressed.
An example XML structure is:
```
<VNCLASS xmlns:xsi... | github_jupyter |
```
import pandas as pd
import json
import requests
import plotly.express as px
import plotly.graph_objects as go
urlPersonsJson = 'https://findmentor.network/persons.json'
requestData = requests.get(urlPersonsJson)
dataJson = json.loads(requestData.content)
personsDF = pd.DataFrame(dataJson)
list(personsDF.columns)
su... | github_jupyter |
## Dependencies
```
import os
import sys
import cv2
import shutil
import random
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
import multiprocessing as mp
import matplotlib.pyplot as plt
from tensorflow import set_random_seed
from sklearn.utils import class_weight
from sklearn.model_sele... | github_jupyter |
# Homework 3
## 1. Implement L1 norm regularization as a custom loss function
```
import torch
def lasso_reg(params, l1_lambda):
l1_penalty = torch.nn.L1Loss(size_average=False)
reg_loss = 0
for param in params:
reg_loss += l1_penalty(param)
loss += l1_lambda * reg_loss
return loss
```
## 2. The th... | github_jupyter |
# 07_model_descriptive_statistics
## Build model and generate data
```
import numpy as np
import pyopencl as cl
import nengo
import nengo_ocl
from srnn_pfc.lmu import make_lmu_dms
srate = 1000
model_kwargs = {
'n_trials_per_cond': 2,
'seed': 1337, # ensemble seed
'trial_seed': 1337,
'out_transform': ... | github_jupyter |
```
import numpy as np
import random
import keras
import keras.backend as K
from keras import Model
from keras.layers import Dense, Input, Flatten, Conv1D, Reshape
from keras import optimizers
from keras import losses
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import os
os.environ["CUD... | github_jupyter |
# Barren Plateaus
<em> Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. </em>
## Overview
In the training of classical neural networks, gradient-based optimization methods encounter the problem of local minimum and saddle points. Correspondingly, the Barren plateau phenomenon could... | github_jupyter |
<a href="https://colab.research.google.com/github/dcastf01/creating_adversarial_images/blob/main/extract_data_from_models_to_adversarial_experiments.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Imports
```
import os, sys, math
import numpy as n... | github_jupyter |
# Лабораторная работа №4
## Разработка программного средства на основе алгоритма задачи группового выбора вариантов.
### Основные теоретические положения
Групповой выбор сочетает в себе субъективные и объективные аспекты. Предпочтения каждого конкретного ЛПР субъективно и зависит от присущей данному человеку системы... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
## Extractive Summarization on CNN/DM Dataset using Transformer Version of BertSum
### Summary
This notebook demonstrates how to fine tune Transformers for extractive text summarization. Utility functions and classes in the N... | github_jupyter |
```
import speech_recognition as sr
from pydub import AudioSegment
import os
from pydub import AudioSegment
from pydub.silence import split_on_silence
# convert mp3 file to wav
# src=("C:\\Users\\pyjpa\\Desktop\\22.mp3")
# sound = AudioSegment.from_mp3(src)
# sound.export("C:\\Users\\pyjpa\\Desktop\\22.flac", fo... | github_jupyter |
# Variational Autoencoders (Toy dataset)
Skeleton code from https://github.com/tudor-berariu/ann2018
## 1. Miscellaneous
```
import torch
from torch import Tensor
assert torch.cuda.is_available()
import matplotlib.pyplot as plt
from math import ceil
def show_images(X: torch.Tensor, nrows=3):
ncols = int(ceil(len... | github_jupyter |
# Parameter identification example
Here is a simple toy model that we use to demonstrate the working of the inference package
$\emptyset \xrightarrow[]{k_1(I)} X \; \; \; \; X \xrightarrow[]{d_1} \emptyset$
$ k_1(I) = \frac{k_1 I^2}{K_R^2 + I^2}$
```
%matplotlib inline
%config InlineBackend.figure_format = "retina"... | github_jupyter |
##### Copyright 2018 The TensorFlow Hub Authors.
Licensed under the Apache License, Version 2.0 (the "License");
```
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | github_jupyter |
# Datasets - Reduced data, IRFs, models
## Introduction
`gammapy.datasets` are a crucial part of the gammapy API. `datasets` constitute `DL4` data - binned counts, IRFs, models and the associated likelihoods. `Datasets` from the end product of the `makers` stage, see [makers notebook](makers.ipynb), and are passed o... | github_jupyter |
# Lesson 2 Exercise 1 Solution: Creating Normalized Tables
<img src="images/postgresSQLlogo.png" width="250" height="250">
## In this exercise we are going to walk through the basics of modeling data in normalized form. We will create tables in PostgreSQL, insert rows of data, and do simple JOIN SQL queries to show h... | github_jupyter |
# 使用dask.delayed并行化代码
使用Dask.delayed并行化简单的for循环代码。通常,这是需要转换用于Dask的函数的惟一函数。
这是一种使用dask并行化现有代码库或构建复杂系统的简单方法。
**Related Documentation**
* [Delayed documentation](https://docs.dask.org/en/latest/delayed.html)
* [Delayed screencast](https://www.youtube.com/watch?v=SHqFmynRxVU)
* [Delayed API](https://docs.dask.org/en/la... | github_jupyter |
⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠ ⚠
# Disclaimer
👮🚨This notebook is sort of like my personal notes on this subject. It will be changed and updated whenever I have time to work on it. This is not meant to replace a thorough fluid substitution workflow. The intent here i... | github_jupyter |
# Loading Data
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm_notebook, tnrange
import os
from sklearn.preprocessing import LabelEncoder
#os.chdir("/content/drive/My Drive/Chartbusters/ChartbustersParticipantsData")
%matplotlib inline
train = pd.... | github_jupyter |
### Converting a `Functional` model to `Sequential` model during `Transfare` Learning.
* This notebook will walk through on how to convert to `Sequential` from `Functional` API using Transfare leaning.
```
import tensorflow as tf
```
### Data Argumentation using `keras api`
```
from tensorflow.keras.preprocessing.im... | github_jupyter |
# Word2Vec
**Learning Objectives**
1. Learn how to build a Word2Vec model
2. Prepare training data for Word2Vec
3. Train a Word2Vec model. In this lab we will build a Skip Gram Model
4. Learn how to visualize embeddings and analyze them using the Embedding Projector
## Introduction
Word2Vec is not a singular al... | github_jupyter |
# JAX Quickstart
[](https://colab.research.google.com/github/google/jax/blob/main/docs/notebooks/quickstart.ipynb)
**JAX is NumPy on the CPU, GPU, and TPU, with great automatic differentiation for high-performance machine learning research.**
... | github_jupyter |
# Westeros Tutorial - Introducing soft constraints
In the baseline tutorial, we added dynamic constraints on activity via the parameter `growth_activity_up` for the electricity generation technologies. As a result, when we added an emission tax, `wind_ppl` was scaled up at the maximum rate of 10% annually in the last ... | github_jupyter |
<a href="https://colab.research.google.com/github/vitutorial/exercises/blob/master/LatentFactorModel/LatentFactorModel-Solutions.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
%matplotlib inline
import os
import re
import urllib.request
import... | github_jupyter |
# A Demo on Backtesting M3 with Various Models
This notebook aims to
1. provide a simple demo how to backtest models with orbit provided functions.
2. add transperancy how our accuracy metrics are derived in https://arxiv.org/abs/2004.08492.
Due to versioning and random seed, there could be subtle difference for th... | github_jupyter |
# Corpus scratch
This notebook is for miscelaneous processing from the swbd.tab database file
```
import pandas as pd
import numpy as np
# import the database file from the TGrep2 searching
df = pd.read_csv("../results/swbd.tab", sep='\t', engine='python')
d = pd.read_csv("swbd_contexts.csv")
# This makes the display ... | github_jupyter |
*This notebook contains an excerpt from the [Python Data Science Handbook](http://shop.oreilly.com/product/0636920034919.do) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jakevdp/PythonDataScienceHandbook).*
# Handling Missing Data
```
import numpy as np
import pandas as pd
```
### NaN ... | github_jupyter |
```
import pandas as pd
import numpy as np
df = pd.read_csv("./word2vec_wrangling.csv")
exercise_to_loop = df["exercise_name"].to_list()
# -*- coding: utf-8 -*-
import re
from konlpy.tag import Mecab, Okt
from collections import Counter
import pandas as pd
import numpy as np
def preprocessing_hangul(text):
# 개행문자... | github_jupyter |
# Part 9 - Intro to Encrypted Programs
You believe or you no believe, he dey possible to compute with encrypted data. Make I talk am another way sey he dey possible to run program where **ALL of the variables** in the program dey **encrypted**!
For this tutoria we go learn basic tools of encrypted computation. In pa... | github_jupyter |
# Document Classification Tutorial 1
(C) 2019 by [Damir Cavar](http://damir.cavar.me/)
## Amazon Reviews
See for more details the source of this tutorial: [https://www.analyticsvidhya.com/blog/2018/04/a-comprehensive-guide-to-understand-and-implement-text-classification-in-python/](https://www.analyticsvidhya.com/bl... | github_jupyter |
**<p style="font-size: 35px; text-align: center">Hypothesis Testing</p>**
***<center>Miguel Ángel Vélez Guerra</center>***
<hr/>

<hr />
<hr />
**<p id="tocheading">Tabla de ... | github_jupyter |
<style>div.container { width: 100% }</style>
<img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="../assets/holoviz-logo-unstacked.svg" />
<div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 1. Overview</h2></div>
<br><br>
# Welcome to HoloViz!
HoloViz is a set of compatib... | github_jupyter |
```
# imports
import json
import multiprocessing
import os
import re
import string
import sys
sys.path.append("../")
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import gensim
import matplotlib.pyplot as plt
import nltk
import numpy as np
import pandas as pd
import pyLDAvis.gensim
p... | github_jupyter |
<a href="https://pythonista.io"> <img src="img/pythonista.png"></a>
# *Selenium WebDriver*.
*Selenium WebDriver* es una herramienta que permite emular las operaciones realizadas por un usuario en un navegador, de tal forma que es posible automatizar pruebas sobre una interfaz web.
La documentación de *Selenium WebDr... | github_jupyter |
```
#export
from fastai.basics import *
#hide
from nbdev.showdoc import *
#default_exp callback.schedule
```
# Hyperparam schedule
> Callback and helper functions to schedule any hyper-parameter
```
from fastai.test_utils import *
```
## Annealing
```
#export
class _Annealer:
def __init__(self, f, start, end):... | github_jupyter |
<a href="https://colab.research.google.com/github/mancinimassimiliano/DeepLearningLab/blob/master/Lab4/solution/char_rnn_classification_solution.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial on Recurrent Neural Networks
Recurrent Neura... | github_jupyter |
This notebook is part of the $\omega radlib$ documentation: https://docs.wradlib.org.
Copyright (c) $\omega radlib$ developers.
Distributed under the MIT License. See LICENSE.txt for more info.
# Simple fuzzy echo classification from dual-pol moments
```
import wradlib
from wradlib.util import get_wradlib_data_file
... | github_jupyter |
#### make an empty dictionary named practice_dict
```
practice_dict={}
```
#### add name of student with their marks in above dictionary
```
a=['mayuur','sankket','akshay','vishnu','ashish']
b=[100,90,80,70,60]
practice_dict=dict(zip(a,b))
practice_dict
```
#### change the key name for one key in dictionary [exampl... | github_jupyter |
### REGRESSION - KERAS
### The Auto MPG dataset
> The dataset is available from [UCI Machine Learning Repository.](https://archive.ics.uci.edu/ml/index.php)
### Imports
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/auto-... | github_jupyter |
# Sonic The Hedgehog 1 with dqn
## Step 1: Import the libraries
```
import time
import retro
import random
import torch
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
from IPython.display import clear_output
import math
%matplotlib inline
import sys
sys.path.append('../../')
from al... | github_jupyter |
```
test_index = 0
from load_data import *
# load_data()
from load_data import *
X_train,X_test,y_train,y_test = load_data()
len(X_train),len(y_train)
len(X_test),len(y_test)
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
class Test_Model(nn.Module):
def __init__(self... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv('Data.csv')
df=df.fillna(df.mean())
df.head()
df.shape
df.iloc[0,:] #First row
df['tl_rank'].fillna(df['tl_rank'].mean())
df['ta_stars'].fillna(df['ta_stars'].mean())
df.head(45)
df.info()
```
This is Mes... | github_jupyter |
```
import pandas as pd
import numpy as np
import re, math
from string import punctuation
df = pd.read_excel("./data/Eni_Shell_data.xlsx")
df.shape
df.columns
```
### I. Nornalize column names
```
column_names = [
"oil_spill_id",
"company",
"jiv_number",
"date_reported",
"year",
"date_jiv_she... | github_jupyter |
# Star Unpacking
Any object that is an iterable, whether built-in (string, list, tuple, etc) or a custom class will work for unpacking.
<div class="alert alert-block alert-success">
<b>Try This!</b><br>
```python
s = "Hello World!"
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12 = s
print(s7)
```
</div>
<div clas... | github_jupyter |
# Creating a System
## Conventional methods
Systems are defined by a recycle stream (i.e. a tear stream; if any), and a path of unit operations and nested systems. A System object takes care of solving recycle streams by iteratively running its path of units and subsystems until the recycle converges to steady state.... | github_jupyter |
# Ray RLlib - Explore RLlib - Sample Application: CartPole
© 2019-2020, Anyscale. All Rights Reserved

We were briefly introduced to the `CartPole` example and the OpenAI gym `CartPole-v1` environment ([gym.openai.com/envs/CartPole-v1/](https://gym.openai.com/... | github_jupyter |
## Imports
```
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from minepy import MINE
from scipy.stats import pearsonr,spearmanr,describe
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
import dcor
sns.set()
```
## Pearson’s Correlation Coefficient
 provides a number of extension methods that are added to [`Learner`](/basic_train.html#Learner) (see below for a list and details), along with three simple callbacks:
- [`ShowGraph`](/train.html#ShowGraph)
- [`GradientClipping`](/train.html#GradientClippin... | github_jupyter |
## Testing Gamepad
```
from readPad import *
foo=rPad() #Supported ports are 1,2,3,4
df=foo.record(duration=5, rate=float(1 / 120), file="",type="df",) #These are the default values
df
df.columns
```
We see that we have to to normalize Lx, Ly, Rx, Ry
```
#Round to specific decimals places under an entire DataFrame
... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W3D3_ReinforcementLearningForGames/student/W3D3_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial 1: Learn to play games wit... | github_jupyter |
##### Copyright 2019 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
from joblib import dump, load
import numpy as np
import cv2
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn import metrics
import matplotlib.pyplot as plt
#set the directory for custom scripts
import sys
sys.path.append('/User... | github_jupyter |
```
# This notebook assumes to be running from your FireCARES VM (eg. python manage.py shell_plus --notebook --no-browser)
import sys
import os
import time
import pandas as pd
import numpy as np
sys.path.insert(0, os.path.realpath('..'))
import folium
import django
django.setup()
from django.db import connections
from... | github_jupyter |
```
import numpy as np # linear algebra
import pandas as pd
import torch
import os
from utils import *
from tqdm import tqdm
import matplotlib.pyplot as plt
columns = [
'MKE_sfc',
'Rd_dx_sfc',
'relative_vorticity_sfc',
'grad_SSH_sfc',
]
device = 'cpu'
model_path ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.