predict.Owl: Generate predictions from owl models

Description Usage Arguments Value See Also Examples

View source: R/predict.R

Description

Return predictions from models fit by owl().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## S3 method for class 'Owl'
predict(object, x, sigma = NULL, type = "link", simplify = TRUE, ...)

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

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

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

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

1
2
fit <- with(mtcars, owl(cbind(mpg, hp), vs, family = "binomial"))
predict(fit, with(mtcars, cbind(mpg, hp)), type = "class")

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