In [1]:
import subprocess
import os
os.chdir(subprocess.getoutput("git rev-parse --show-toplevel"))
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
In [2]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from src import get_data, linear_model, preprocess, nn_model
In [3]:
term_dict = {
'train': ['2011-01-01', '2014-12-31'],
'valid': ['2015-01-01', '2015-12-31'],
'test' : ['2016-01-01', '2016-12-31']
}
In [5]:
panel = get_data.symbols2daily_values()
features, labels, terms = preprocess.panel2get_batch(panel, term_dict)
In [6]:
linear = linear_model.LinearModel(features, labels, terms)
linear.inference()
In [7]:
#PYTEST_VALIDATE_IGNORE_OUTPUT
linear.plot_direction_accuracy()
In [8]:
#PYTEST_VALIDATE_IGNORE_OUTPUT
linear.plot_profit()