Skip to content

Instantly share code, notes, and snippets.

View hhl60492's full-sized avatar

Haihan hhl60492

View GitHub Profile
from process import *
import pandas as pd
import glob
import numpy as np
from keras.models import Sequential
from keras.layers import Conv2D, Flatten, MaxPool2D, Dense, Dropout
from random import shuffle
'''Neural style transfer with Keras.
Run the script with:
```
python neural_style_transfer.py path_to_your_base_image.jpg path_to_your_reference.jpg prefix_for_results
```
e.g.:
```
python neural_style_transfer.py img/tuebingen.jpg img/starry_night.jpg results/my_result
```
Optional parameters:
from sklearn.datasets import *
from sklearn import tree
import graphviz
wine = load_wine()
clf = tree.DecisionTreeClassifier() # init the tree
clf = clf.fit(wine.data, wine.target) # train the tree
# export the learned decision tree
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=wine.feature_names,
from sklearn.datasets import *
from sklearn import tree
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import label_binarize
n_classes = 3
wine = load_wine()
clf = tree.DecisionTreeClassifier()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# read in the csv
df = pd.read_csv("eth-cad-max.csv")
# get the prices col slice from df
prices = np.array(df['price'])
foo = []
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# read in the csv
df = pd.read_csv("eth-cad-max.csv")
# get the prices col slice from df
prices = np.array(df['price'])
H = 0.55
import numpy as np
import pandas as pd
import nolds
from fbm import FBM
import matplotlib.pyplot as plt
# number of time steps (days) to predict ahead
n = 30
# number of FBMs to realize
c = 1000