I'm trying to use this function, fitrlinear, to develop a linear regression model to predict a variable x1. There are 15 predictor variables (y1:y15) and 74 observations of each. I'm attaching a csv of the data.
cvp = cvpartition(74,'Holdout',0.05);
idxTrain = training(cvp);
y = y';
Mdl = fitrlinear(y(:,idxTrain),x1(idxTrain),'ObservationsIn','columns');
idxTest = test(cvp);
yHat = predict(Mdl,y(:,idxTest),'ObservationsIn','columns');
L = loss(Mdl,y(:,idxTest),x1(idxTest),'ObservationsIn','columns')
This gives an enormous mean squared error (L, at the end), and I can see that the predicted values in yHat are far off. Most of this code is taken from the Matlab examples and tutorials on how to run this function... what am I missing?
perhaps you can suggest a better way to predict this data.