Search code examples
pythontensorflowtrain-test-split

Regression: Training Test Split - held out test?


i split my data into training and test samples (70/30) for regression-forecasting based problem (MLP, LSTM, etc.).

Within the code:

history = model.fit(X_train, y_train, epochs=100, batch_size=32, 
                    validation_data=(X_test, y_test), verbose=0, shuffle=False)

I put my test data as the validation set and did couple weeks worth of predictions. So i did not hold back the test data...

But now that i think about it, i guess it was wrong to put the test data into the fit function, or was it ok?


Solution

  • NEVER EVER! use your testing that as part of training or validation. The test set should only be used for inference after training. So yes it's wrong to use your test data in the fit function, it should only be in model.predict(y_test)