Training and testing dataset using Linear Model of machine learning

1 view (last 30 days)
In the example and the functions provided for the Linear Model in Matlab for example
mdl = LinearModel.fit(X,Y)
mdl contains functions such as MSE which would calculate the error of the "training"set. Is there any similar function for a suitable"testing" set. I am asking this because I am aware of the predict function, and I just would have to write extra amount of code to find the MSE of a testing set. Moreover the residuals of a testing set would not be available in the workspace, when I use predict function. Is there any way which would enable to write less amount of code and find testing error i.e MSE of the Linear Model. Thanks.

Answers (0)

Community Treasure Hunt

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

Start Hunting!