With Python
Dr. Yves J. Hilpisch | The Python Quants & The AI Machine
Python for Quant Finance Meetup, London, 16. November 2022
(short link to this Gist: http://bit.ly/pqf_risk)
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
With Python
Dr. Yves J. Hilpisch | The Python Quants & The AI Machine
Python for Quant Finance Meetup, London, 16. November 2022
(short link to this Gist: http://bit.ly/pqf_risk)
from imgaug import augmenters as iaa | |
import imgaug as ia | |
ia.seed(4) | |
import tensorflow as tf | |
tf.random.set_seed(666) | |
aug = iaa.RandAugment(n=2, m=9) | |
BATCH_SIZE = 224 |
Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
import numpy as np | |
import pandas as pd | |
import datetime as dt | |
from sklearn.datasets import make_classification | |
def create_price_data(start_price: float = 1000.00, mu: float = .0, var: float = 1.0, n_samples: int = 1000000): | |
i = np.random.normal(mu, var, n_samples) | |
df0 = pd.date_range(periods=n_samples, freq=pd.tseries.offsets.Minute(), end=dt.datetime.today()) |
#!/usr/bin/env python3 | |
'''2021-03-26: Reverse-engineer by searching for the following terms in features*.js: | |
- bracketMaintenanceMarginRate | |
- cumFastMaintenanceAmount | |
- bracketNotionalFloor | |
- bracketNotionalCap''' | |
# (max) position, maintenance margin, maintenance amount | |
maint_lookup_table = [ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>Astronomy Picture of the Day - Read Aloud by Artifical Intelligence - Created by Videotizer</title> |
# Add repo to install the last R | |
sudo apt install apt-transport-https software-properties-common | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 | |
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu eoan-cran35/' | |
# Install R | |
sudo apt update | |
sudo apt install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev | |
# Install RStudio |