In [11]:
#https://github.com/jamesrobertlloyd/gpss-research/tree/master/data/tsdl
#https://cran.r-project.org/web/packages/rdatamarket/
#https://datamarket.com/data/list/?q=cat:ecc%20provider:tsdl
import pandas as pd
import numpy as np
import scipy.io
import pyaf.ForecastEngine as autof
%matplotlib inline
url = "http://github.com/jamesrobertlloyd/gpss-research/blob/master/data/tsdl/ibm-common-stock-closing-prices-.mat?raw=true"
import requests
response = requests.get(url)
with open("ibm.mat", "wb") as file:
file.write(response.content)
file.close();
mat = scipy.io.loadmat("ibm.mat")
In [12]:
df = pd.DataFrame()
df['Date'] = mat['X'].T[0]
df['Signal'] = mat['y'].T[0]
df.head()
Out[12]:
In [20]:
lEngine = autof.cForecastEngine()
lEngine.train(df, 'Date' , 'Signal' , 7)
lEngine
Out[20]:
In [21]:
#lEngine.getModelInfo()
#lEngine.mSignalDecomposition.mTrPerfDetails
In [22]:
lEngine.standrdPlots()
In [ ]: