BlackArbsCEO / Adv_Fin_ML_Exercises

Experimental solutions to selected exercises from the book [Advances in Financial Machine Learning by Marcos Lopez De Prado]
MIT License
1.68k stars 630 forks source link

Potential bug in PurkedKFold class #43

Closed agalbachicar closed 4 years ago

agalbachicar commented 4 years ago

The following notebook:

Adv_Fin_ML_Exercises/notebooks/07. Cross Validation in Finance.ipynb

Where it says:

maxT1Idx=self.t1.index.searchsorted(self.t1[test_indices].max())

I believe it should be:

maxT1Idx=self.t1.index.searchsorted(self.t1.index[test_indices].max())

Note that the book states exactly the same as you proposed, however, I think it should be as I propose.

BlackArbsCEO commented 4 years ago

Hey thanks for the insight. I recommend you post this on the mlfinlab github as they have created a coherent python module that implements all the concepts in the book.

agalbachicar commented 4 years ago

Closing this one. Will check the code of https://github.com/hudson-and-thames/mlfinlab/blob/3c80f269bc68b8cb9bcf863ceb3dc77fc14b6984/mlfinlab/cross_validation/cross_validation.py and create a ticket there if it applies. Thanks!