RetroFit icon indicating copy to clipboard operation
RetroFit copied to clipboard

AutoDiff needs to be built for Polars and Pandas

Open Swift-Sean opened this issue 3 years ago • 1 comments

The FE0_AutoDiff function uses imports from datatable to manipulate the data but these imports do not work on polars dataframes. I think it is missing a conditional processing block that will process a dataframe using polars' methods.

>>> areas.to_list()
['FLC', 'WAW', 'UTN', 'LAR', 'LAX', 'PHX', 'MIE', 'ATL', 'DFN', 'ONT']
>>> new_data = fe.FE0_AutoDiff(data, DateColumnName="dates", DiffNumericVariables=areas.to_list(), InputFrame="polars", OutputFrame="polars", Processing="polars")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Miniconda3\lib\site-packages\retrofit\FeatureEngineering.py", line 617, in FE0_AutoDiff
    data = data[:, f[:].extend({Ref2: dt.shift(f[rcn], n = NLag2)})]
UnboundLocalError: local variable 'f' referenced before assignment

Swift-Sean avatar Sep 14 '21 19:09 Swift-Sean