Return predictions from models fit by SLOPE()
.
# 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,
...
)
Predictions from the model with scale determined by type
.
an object of class "SLOPE"
, typically the result of
a call to SLOPE()
new data
penalty parameter for SLOPE models; if NULL
, the
values used in the original fit will be used
type of prediction; "link"
returns the linear predictors,
"response"
returns the result of applying the link function,
and "class"
returns class predictions.
if TRUE
, base::drop()
will be called before returning
the coefficients to drop extraneous dimensions
deprecated. Please use alpha
instead.
ignored and only here for method consistency
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.
stats::predict()
, stats::predict.glm()
, coef.SLOPE()
Other SLOPE-methods:
coef.SLOPE()
,
deviance.SLOPE()
,
plot.SLOPE()
,
print.SLOPE()
,
score()
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 DataLab