fabian-s / stabpath

0 stars 2 forks source link

`glmnet` methods #3

Open fabian-s opened 6 years ago

fabian-s commented 6 years ago

see stubs in refit.R, get_selected.R (you may need to modify the travis.yml file as well)

jonas-hag commented 6 years ago

glmnet() sometimes truncates the number of different lambda values "because of instabilities in the inverse link functions near a saturated fit" (see help). This leads to matrices of different rownumbers when repeatedly called with different data from resample(). My workaround now is to add rows with TRUE at the end in get_selected() so that the number of rows equals the original argument nlambda in glmnet(). However, this can lead to a lot of rows that are all TRUE. Is this ok? Otherwise, I think I also have to modify get_stability_paths(). Then I could expand all other matrices to the number of rows that the matrix with the maximal number of rows has.