KIC/pandas-ml-quant

Target variable is shifted in the wrong direction (example notebook)

Closed this issue · 2 comments

In this notebook https://github.com/KIC/pandas-ml-quant/blob/0.2.7/notebooks/blogs/probabilistic.ipynb you shift a target variable forward. That means you predict previous, not future, values. In other words if a sequence is 1 2 3 4.., shifting it forward will make: Features: 1 2 3 4.., Labels: NaN 1 2 3... '2' will be related to '1' not '3'. Adding windows will just include your target value in the input features, making prediction as simple as just repeating one of the inputs.

I believe your "summary provider" is also messed up :)

KIC commented

Wow, I can not believe that I have made such a silly mistake. Thanks for the report. I will fix it now. Luckily it does not change the argument the MSE model can not even fit a model properly for predicting the past :-)

However, the reconstructor report is a bit vague I would appreciate if you could file a more detailed report or even better a PR.

The problem with the deterministic model is large number of params and not enough training. It achieves almost perfect performance on this "predict the past" task if you leave only one layer and increase number of epochs