civisanalytics / python-glmnet

A python port of the glmnet package for fitting generalized linear models via penalized maximum likelihood.
Other
262 stars 59 forks source link

Where to put 'lambda.1se' #60

Closed lingling93 closed 5 years ago

lingling93 commented 5 years ago

I want to use 'lambda.1se' to choose the model, I didn't find which parameter is for it. Can you help me with that ? Thank you!

wlattner commented 5 years ago

The parameter named cut_point determines how lambda is selected. By default, cut_point = 1, following the "one standard error rule." After the model is fitted, the selected value of lambda is saved to the attribute named lambda_best_. So if you are coming from R and cv.glmnet, lambda_best_ in this implementation is analogous to lambda.1se.

stephen-hoover commented 5 years ago

Thank you, @wlattner ! @lingling93 , does that answer your question?

lingling93 commented 5 years ago

@wlattner @stephen-hoover Perfect answer! Thank you.