MehranTaghian / DQN-Trading

A Deep Reinforcement Learning Framework for Stock Market Trading
MIT License
145 stars 51 forks source link

MinMaxScaler() usage #5

Open formidiable opened 2 years ago

formidiable commented 2 years ago

Warning Risk of data leak Do not use minmax_scale unless you know what you are doing. A common mistake is to apply it to the entire data before splitting into training and test sets. This will bias the model evaluation because information would have leaked from the test set to the training set. In general, we recommend using MinMaxScaler within a Pipeline in order to prevent most risks of data leaking: pipe = make_pipeline(MinMaxScaler(), LogisticRegression()).

from https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.minmax_scale.html .