This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io | |
sudo docker run hello-world # Command to verify Docker is installed. | |
## Adding your user to Docker group - Recommended Step | |
sudo groupadd docker | |
sudo usermod -aG docker $USER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get remove docker docker-engine docker.io containerd runc # Remove any traces of older Docker installation | |
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trace_high = go.Scatter( | |
x=test_dates, | |
y=y_test, | |
name = "Original", | |
line = dict(color = '#17BECF'), | |
opacity = 0.8) | |
trace_low = go.Scatter( | |
x=test_dates, | |
y=pd.DataFrame(yhat)[0].values, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# train model | |
bidirectional_model = build_bidirectional_model(X, y) | |
# predict using the test data | |
yhat = bidirectional_model.predict(X_test, verbose=0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# choose a number of time steps | |
n_steps = 5 | |
# split into sequence | |
X, y = split_sequence(real_price.values, n_steps) | |
# reshape from [samples, timesteps] into [samples, timesteps, features] to fit in LSTM model | |
n_features = 1 | |
X = X.reshape((X.shape[0], X.shape[1], n_features)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read bitcoin pricing data | |
bitcoin_data = pd.read_csv('input/bitstampUSD_1-min_data_2012-01-01_to_2018-11-11.csv') | |
# parse date using pandas | |
bitcoin_data['date'] = pd.to_datetime(bitcoin_data['Timestamp'],unit='s').dt.date | |
# group by date and pick 'Weighted_Price' | |
grouped_data = bitcoin_data.groupby('date') | |
real_price = grouped_data['Weighted_Price'].mean() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def split_sequence(sequence, n_steps): | |
X, y = list(), list() | |
for i in range(len(sequence)): | |
end_ix = i + n_steps | |
if end_ix > len(sequence)-1: | |
break | |
seq_x, seq_y = sequence[i:end_ix], sequence[end_ix] | |
X.append(seq_x) | |
y.append(seq_y) | |
return array(X), array(y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_bidirectional_model(X, y): | |
# define model | |
model = Sequential() | |
model.add(Bidirectional(LSTM(50, activation='relu'), input_shape=(n_steps, n_features))) | |
model.add(Dense(1)) | |
model.compile(optimizer='adam', loss='mse') | |
# fit model | |
model.fit(X, y, epochs=200, verbose=0) | |
return model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
library(h2o) | |
# Load train and properties data | |
properties <- fread("../input/properties_2016.csv", header=TRUE, stringsAsFactors=FALSE, colClasses = list(character = 50)) | |
train <- fread("../input/train_2016_v2.csv") | |
training <- merge(properties, train, by="parcelid",all.y=TRUE) | |
# Initialise h20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install CUDA Toolkit v9.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb" | |
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get -y install cuda |
NewerOlder