owrior / portfolio-analytics

Module for tracking portfolio performance.
MIT License
0 stars 0 forks source link

create_time_windows index error #40

Closed owrior closed 2 years ago

owrior commented 2 years ago

When running pfa.analytics.data_manipulation.create_time_windows with a 727 an index error is thrown for the last window. This has been patched by accepting it and ignoring windows which have the error though this needs to be properly examined and fixed.

First this needs to be replicated with a unit test which can then remain for non regression.

owrior commented 2 years ago

This was due to the first na being dropped - the index had to start from 0 for the create time windows function in the previous logic. The bug in xgboost validation where the na was being dropped from the one year long df has been removed which fixed this. In addition though some unit tests with the index not starting at zero have been added and now there is a term when indexing the df correcting for indices that are more than 0.