hazimehh / L0Learn

Efficient Algorithms for L0 Regularized Learning
Other
94 stars 32 forks source link

outputs for L0learn.cvfit not documented #18

Closed stephens999 closed 6 years ago

stephens999 commented 6 years ago

thanks for this great package! I realize this is likely work in progress, but I could not work out what to do with the output of L0learn.cvfit from the current documentation. It seems to have some undocumented values (like cvmeans and cvsds) and I wasn't sure how to extract the "optimal" value of lambda. thanks for any help/pointers!

hazimehh commented 6 years ago

Thanks for pointing this out! I just updated the cross-validation module and its documentation (it now includes descriptions of cvmeans and cvsds). You'll need to reinstall L0Learn to get those updates.

If you're using L0 regularization alone, then the index of the optimal lambda can be found using OptimalIndex = which.min(fit$cvmeans) and the optimal lambda can be then extracted using fit$lambda[OptimalIndex]. For L0L2/L0L1, cvmeans is a list where cvmeans[[i]] is a sequence of cross-validation errors corresponding to fit$gamma[i]. So which.min(fit$cvmeans[[i]]) can be used to get the optimal index for the ith value of gamma.

I will add an example of cross-validation and how to extract the optimal parameters to the Wiki page soon.

hazimehh commented 6 years ago

Update: The Usage Wiki page now has an example showing how to use cross-validation using L0L2/L0L1 penalties.