MATLAB Answers

DO I need finalize shallow Neural network Model for prediction?

2 views (last 30 days)
Qiang Wang
Qiang Wang on 29 Jul 2020
Answered: Asvin Kumar on 6 Aug 2020
Hi, every one,
I bulid a shallow Neural network for predication of new design. Only have three features and one target.
After train the dataset and evaluate the test data. A model (net) with acceptable rmse and high R value was consider as the best model.
I save the trained model(net) and use this model to predict.
However, I found that in some references or post, after determine the hyper-parameters,applying the chosen machine learning procedure on all of your data. which means use the entire dataset(train dataset + test dataset) to train the model again.
the questions is : Do I also need finalize the model?

Accepted Answer

Asvin Kumar
Asvin Kumar on 6 Aug 2020
It depends.
Whether you need to train your model on your whole data set or not depends on what you want to achieve.
In the blog that you have linked, their intention was to get an estimate of what they call the “skill” of any given model that is trained on the dataset. This is useful when you are considering using multiple different kinds of models on your dataset and have to pick the best one. This is found by partitioning the data. Train on one part and validate on the other. Once they have the estimate, the model is chosen. They refer to this choosing as model finalization. Then, they leverage the entire dataset and retrain the model.
In the workflow from the MathWorks website which you are referring to, the data is partitioned into train, validation and test. The validation set is used to help with training and then the test set is used to measure performance and check for overfitting later. It’s mentioned in this link on: Also, check the last paragraph of this section which talks about the performance plots: In this case, there is no need for any model finalization.
You can even change the way the data set is split if you want to use all your data for training and validation alone and none for testing.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!