SLOPE (version 0.3.2)

predict.SLOPE: Generate predictions from SLOPE models

Description

Return predictions from models fit by SLOPE().

Usage

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

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

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

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

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

Arguments

object

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

x

new data

alpha

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

sigma

deprecated. Please use alpha instead.

...

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(), coef.SLOPE()

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

Examples

Run this code
# NOT RUN {
fit <- with(mtcars, SLOPE(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