setting option glmnetSet

2 次查看(过去 30 天)
Soren Blomquist
Soren Blomquist 2011-3-21
I am using the lasso program written by Jerome Friedman, Trevor Hastie and Rob Tibshirani. I don't understand how to use the function glmnetSet to set options. In particular I would like to calculate the coefficinet vectro for just one value of lamda, namley lamda=0.354. How should I write my command? I have tried things like options=glmnetSet('lambda',0.354) but it does not work

回答(1 个)

Naman
Naman 2011-4-6
Very easy dear. Suppose you want to set alpha as 0.5 and dfmax as 9, other things to be kept default. Then do as follows,
opts=struct; opts.alpha=0.5; opts.dfmax=9; options=glmnetSet(opts);
You can now use options in other functions like,
glmnet(x,y,'gaussian',options).

类别

Help CenterFile Exchange 中查找有关 Regression 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by