stock-trading-ml icon indicating copy to clipboard operation
stock-trading-ml copied to clipboard

Exposing future prices in training

Open krajit opened this issue 4 years ago • 1 comments

Dear Yacoubb,

Your predictions seem too good to be true. I believe you are exposing future prices in training. When you turn on the shuffle option in the fit, it seems it first shuffles and then splits.

model.fit(x=ohlcv_train, y=y_train, batch_size=32, epochs=50, shuffle=True, validation_split=0.1) So, the 10 % split is not necessarily the last 10 %, but some middle value.

krajit avatar Oct 25 '20 18:10 krajit

That's the validation set, not the testing set. The validation set are randomly selected points throughout the data-set, yes, but there's also the testing set, which really is at the chronological end of the whole data-set.

huw-rhys-jones avatar Dec 20 '20 16:12 huw-rhys-jones