features.msgl | R Documentation |
Extracts the nonzero features for each model.
## S3 method for class 'msgl'
features(object, ...)
object |
a msgl object |
... |
ignored |
a list of of length nmod(x)
containing the nonzero features (that is nonzero colums of the beta matrices)
Martin Vincent
data(SimData)
lambda <- msgl::lambda(x, classes, alpha = .5, d = 50, lambda.min = 0.05)
fit <- msgl::fit(x, classes, alpha = .5, lambda = lambda)
# the nonzero features of model 1, 10 and 25
features(fit)[c(1,10,25)]
# count the number of nonzero features in each model
sapply(features(fit), length)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.