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

Description Usage Arguments Value Examples

View source: R/score.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
score(object, x, y, measure)

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

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

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

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

Arguments

object

an object of class "Owl"

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.

Examples

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

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

jolars/prague documentation built on March 4, 2020, 7:13 p.m.