features.msgl: Nonzero features

Description Usage Arguments Value Author(s) Examples

View source: R/navigate.R

Description

Extracts the nonzero features for each model.

Usage

1
2
## S3 method for class 'msgl'
features(object, ...)

Arguments

object

a msgl object

...

ignored

Value

a list of of length nmod(x) containing the nonzero features (that is nonzero colums of the beta matrices)

Author(s)

Martin Vincent

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

nielsrhansen/msgl documentation built on May 28, 2019, 11:05 a.m.