owl (version 0.1.1)

predict.Owl: Generate predictions from owl models

Description

Return predictions from models fit by owl().

Usage

# S3 method for Owl
predict(object, x, sigma = NULL, type = "link", simplify = TRUE, ...)

# S3 method for OwlGaussian predict( object, x, sigma = NULL, type = c("link", "response"), simplify = TRUE, ... )

# S3 method for OwlBinomial predict( object, x, sigma = NULL, type = c("link", "response", "class"), simplify = TRUE, ... )

# S3 method for OwlPoisson predict( object, x, sigma = NULL, type = c("link", "response"), exact = FALSE, simplify = TRUE, ... )

# S3 method for OwlMultinomial predict( object, x, sigma = NULL, type = c("link", "response", "class"), exact = FALSE, simplify = TRUE, ... )

Arguments

object

an object of class "owl", typically the result of a call to owl()

x

new data

sigma

penalty parameter for SLOPE models; if NULL, the values used in the original fit will be used

type

type of prediction; "link" returns the linear predictors, "response" returns the result of applying the link function, and "class" returns class predictions.

simplify

if TRUE, base::drop() will be called before returning the coefficients to drop extraneous dimensions

...

ignored and only here for method consistency

exact

if TRUE and the given parameter values differ from those in the original fit, the model will be refit by calling stats::update() on the object with the new parameters. If FALSE, the predicted values will be based on interpolated coefficients from the original penalty path.

Value

Predictions from the model with scale determined by type.

See Also

stats::predict(), stats::predict.glm()

Examples

Run this code
# NOT RUN {
fit <- with(mtcars, owl(cbind(mpg, hp), vs, family = "binomial"))
predict(fit, with(mtcars, cbind(mpg, hp)), type = "class")

# }

Run the code above in your browser using DataCamp Workspace