Commit 0c44c182 authored by 吕先亚's avatar 吕先亚

To avoid data leak, test set should start from numForecastDays later

parent 5529e737
...@@ -200,5 +200,5 @@ class TrainingDataBuilder(ABC): ...@@ -200,5 +200,5 @@ class TrainingDataBuilder(ABC):
# To avoid data leak, test set should start from numForecastDays later # To avoid data leak, test set should start from numForecastDays later
X_test = X_test[self._numForecastDays:] X_test = X_test[self._numForecastDays:]
y_test = y_test[self._numForecastDays:] y_test = y_test[self._numForecastDays:]
date_index = DataAll['date'][:-len(X_test)].to_numpy() date_index = DataAll['date'][-len(X_test):].to_numpy()
return X_train, X_test, y_train, y_test, scaledX_forecast, forecastDay, date_index return X_train, X_test, y_train, y_test, scaledX_forecast, forecastDay, date_index
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment