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
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!