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

score(object, x, y, measure)

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

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

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

# S3 method for 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

x <- subset(infert, select = c("induced", "age", "pooled.stratum")) y <- infert$case fit <- owl(x, y, family = "binomial") score(fit, x, y, measure = "auc")
#> p1 p2 p3 p4 p5 p6 p7 p8 #> 0.5150055 0.4921504 0.4952903 0.5150055 0.5142753 0.5269076 0.5020811 0.5042716 #> p9 p10 #> 0.5048558 0.4689303