Predictions for stepwise regression model
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anaya Kharwadkar
am 17 Okt. 2020
Beantwortet: Star Strider
am 17 Okt. 2020
Hi all,
I have created a regression model using the stepwisefit function. I have 5 independent variables (x1,x2,x3,x4,x5), and the stepwisefit chose the variables x3 and x5 for the model. The code is as follows:
matrix = [x1 x2 x3 x4 x5]
b = stepwisefit(matrix , Y)
Now, I want to predict values for Y using this model. I used the predict function and the following code:
prediction1 = predict(b,matrix);
But this is throwing up an error: Undefined function 'predict' for input arguments of type 'double'.
What am I doing wrong? Any help would be appreciated.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Okt. 2020
No predict function is defined for stepwisefit.
m = stepwiselm(matrix , Y)
prediction1 = predict(m,matrix);
See if that does what you want.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Regression finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!