how can I automaticlly optimize hyperparameter for lasso regression. I could not set the function input as variable.

조회 수: 1 (최근 30일)
for i = 0:0.1:1
[B,FitInfo] = lasso(XTrain,yTrain,"Alpha",i);%alpha could not be variable like i. it's ok to use constant like 0.75.
error = sum(abs(yTest-yhat));
end

채택된 답변

Alan Weiss
Alan Weiss 2022년 5월 23일
As stated in the documentation, you cannot set Alpha = 0. The Alpha parameter must be strictly positive (and no more than 1).
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

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