In [1]:
import pandas as pd
import numpy as np

import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds

%matplotlib inline

In [ ]:


In [2]:
b1 = tsds.load_cashflows()
df = b1.mPastData


---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-49277c18f670> in <module>()
----> 1 b1 = tsds.load_cashflows()
      2 df = b1.mPastData

/home/antoine/dev/python/packages/pyaf/Bench/TS_datasets.py in load_cashflows()
     78 
     79     trainfile = "data/CashFlows.txt"
---> 80     tsspec.mFullDataset = pd.read_csv(trainfile, sep=r'\t', engine='python');
     81     tsspec.mFullDataset['Date'] = tsspec.mFullDataset['Date'].apply(lambda x : datetime.datetime.strptime(x, "%Y-%m-%d"))
     82     tsspec.mFullDataset = tsspec.mFullDataset.head(251)

/usr/lib/python3/dist-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)
    560                     skip_blank_lines=skip_blank_lines)
    561 
--> 562         return _read(filepath_or_buffer, kwds)
    563 
    564     parser_f.__name__ = name

/usr/lib/python3/dist-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds)
    313 
    314     # Create the parser.
--> 315     parser = TextFileReader(filepath_or_buffer, **kwds)
    316 
    317     if (nrows is not None) and (chunksize is not None):

/usr/lib/python3/dist-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds)
    643             self.options['has_index_names'] = kwds['has_index_names']
    644 
--> 645         self._make_engine(self.engine)
    646 
    647     def close(self):

/usr/lib/python3/dist-packages/pandas/io/parsers.py in _make_engine(self, engine)
    803             elif engine == 'python-fwf':
    804                 klass = FixedWidthFieldParser
--> 805             self._engine = klass(self.f, **self.options)
    806 
    807     def _failover_to_python(self):

/usr/lib/python3/dist-packages/pandas/io/parsers.py in __init__(self, f, **kwds)
   1588         if isinstance(f, compat.string_types):
   1589             f = _get_handle(f, 'r', encoding=self.encoding,
-> 1590                             compression=self.compression)
   1591         elif self.compression:
   1592             f = _wrap_compressed(f, self.compression, self.encoding)

/usr/lib/python3/dist-packages/pandas/io/common.py in _get_handle(path, mode, encoding, compression)
    422                 f = open(path, mode, encoding=encoding)
    423             else:
--> 424                 f = open(path, mode, errors='replace')
    425         else:
    426             f = open(path, mode)

FileNotFoundError: [Errno 2] No such file or directory: 'data/CashFlows.txt'

In [ ]:
df.head()

In [ ]:
df.describe()

In [ ]:
df[0:5]

In [ ]:
df['Date'].iloc[0]

In [ ]:
lAutoF = autof.cAutoForecast()
lAutoF.mOptions.mTimeDeltaComputationMethod = "MODE"
#lAutoF.mOptions.enable_slow_mode()
lAutoF.mOptions.mBusinessDaysOnly = True
lAutoF.mOptions.mDebugCycles = True
#lAutoF.mOptions.mEnableTrends = False
#lAutoF.mOptions.mEnableCycles = True
#lAutoF.mOptions.mEnableARModels = False


lAutoF

In [ ]:
lAutoF.train(df , 'Date' , 'Cash' , 21)

In [ ]:
lAutoF.getModelInfo()

In [ ]:
lAutoF.mSignalDecomposition.mTrPerfDetails

In [ ]:


In [ ]:
lAutoF.standrdPlots()

In [ ]: