Write Objective function with known linear regression model
Afficher commentaires plus anciens
I am studying the tutorial on this page where a linear regression model is obtained and needs to be optimised.
In this tutorial I see this step:
Write the objective function.
f = @(x) -x2fx(x,'quadratic')*mdl.Coefficients.Estimate;
I wonder how -x2fx(x,'quadratic') is obtained in this example? I did not see it from the linear model
Cheers
Réponses (1)
Sean de Wolski
le 31 Août 2017
This is kind of the old way of doing it. I would just use the predict method of the object to make the prediction.
f = @(x) -predict(mdl, x);
Feel free to email me, I have an updated copy of this example.
1 commentaire
Pingfei Jiang
le 1 Déc 2017
Catégories
En savoir plus sur Support Vector Machine Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!