score: Compute one of several loss metrics on a new data set

View source: R/score.R

scoreR Documentation

Compute one of several loss metrics on a new data set

Description

This function is a unified interface to return various types of loss for a model fit with SLOPE().

Usage

score(object, x, y, measure)

## S3 method for class 'GaussianSLOPE'
score(object, x, y, measure = c("mse", "mae"))

## S3 method for class 'BinomialSLOPE'
score(object, x, y, measure = c("mse", "mae", "deviance", "misclass", "auc"))

## S3 method for class 'MultinomialSLOPE'
score(object, x, y, measure = c("mse", "mae", "deviance", "misclass"))

## S3 method for class 'PoissonSLOPE'
score(object, x, y, measure = c("mse", "mae"))

Arguments

object

an object of class "SLOPE"

x

feature matrix

y

response

measure

type of target measure. "mse" returns mean squared error. "mae" returns mean absolute error, "misclass" returns misclassification rate, and "auc" returns area under the ROC curve.

Value

The measure along the regularization path depending on the value in measure.#'

See Also

SLOPE(), predict.SLOPE()

Other SLOPE-methods: coef.SLOPE(), deviance.SLOPE(), plot.SLOPE(), predict.SLOPE(), print.SLOPE()

Examples

x <- subset(infert, select = c("induced", "age", "pooled.stratum"))
y <- infert$case

fit <- SLOPE(x, y, family = "binomial")
score(fit, x, y, measure = "auc")

SLOPE documentation built on June 10, 2022, 1:05 a.m.