Write Objective function with known linear regression model

조회 수: 10 (최근 30일)
Pingfei Jiang
Pingfei Jiang 2017년 8월 31일
댓글: Pingfei Jiang 2017년 12월 1일
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

답변 (1개)

Sean de Wolski
Sean de Wolski 2017년 8월 31일
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
Pingfei Jiang
Pingfei Jiang 2017년 12월 1일
Hi Sean, is it possible for you to email me the updated example? I am still struggle to understand this example. Many thanks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by