privefl/bigstatsr

Predicting using only 1 specific lambda value

leocob opened this issue · 2 comments

leocob commented

I know that the strength of the functions big_spLinReg and big_spLogReg is to automatically perform hyper-parameter optimization for lambda and alpha. However, I was wondering if it's possible to generate a model using only a specific value for lambda and alpha, or alternatively if it's possible to predict on unseen data after CMSA using only a specific value of lambda?

No, I don't think it is possible to provide a specific value for lambda.

You can probably provide a value relative to lambda_0 (by setting nlambda = 2 and lambda.min.ratio), but I guess this is not what you want.

leocob commented

Ok thank you!

I found out that is possible to do it with the package biglasso, I leave the snippet here since it might be of interest for others:

predict(fit, X.bm, type="class", lambda=<specific_lambda_value>)

From the biglasso pdf manual:

lambda: Values of the regularization parameter lambda at which predictions are requested. Linear interpolation is used for values of lambda not in the sequence of lambda values in the fitted models.