Skip to contents

Assessment of performance metrics in plus models

Usage

assess(object, newx = NULL, newy, weights = NULL, ...)

# S3 method for class 'plus'
assess(object, newx = NULL, newy, weights = NULL, ...)

Arguments

object

A plus object

newx

A matrix with new data to test performance

newy

A vector with the observed classes to test performance

weights

optional vector of case weights

...

additional arguments

Value

A list with performance metrics for plus models

Examples

#' data(binexample)
x = binexample$x
y = binexample$y
s <- sample(seq(nrow(x)), 65, replace = FALSE)
x_train <- x[s, ]
x_test  <- x[-s, ]
y_train <- y[s]
y_test  <- y[-s]
fit <- plus(x_train, y_train)
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
#> Warning: one multinomial or binomial class has fewer than 8  observations; dangerous ground
assess(fit, newx = x_test, newy = y_test)
#> $deviance
#> lambda.min 
#>   1.478255 
#> 
#> $class
#> lambda.min 
#>        0.4 
#> 
#> $auc
#> [1] 0.3945578
#> 
#> $mse
#> lambda.min 
#>   0.538208 
#> 
#> $mae
#> lambda.min 
#>  0.9495185 
#>