Return predictions from models fit by owl()
.
# 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, ... )
object | an object of class |
---|---|
x | new data |
sigma | penalty parameter for SLOPE models; if |
type | type of prediction; |
simplify | if |
... | ignored and only here for method consistency |
exact | if |
Predictions from the model with scale determined by type
.
fit <- with(mtcars, owl(cbind(mpg, hp), vs, family = "binomial")) predict(fit, with(mtcars, cbind(mpg, hp)), type = "class")#> [1] "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" #> [19] "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" #> [37] "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" #> [55] "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "1" #> [73] "0" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "0" "0" "1" #> [91] "0" "1" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "1" "0" "0" "0" "0" #> [109] "0" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [127] "0" "0" "0" "0" "1" "0" "0" "0" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" #> [145] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "0" "0" "0" #> [163] "1" "0" "0" "0" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [181] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" #> [199] "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [217] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "0" "0" "1" "1" "0" #> [235] "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [253] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" #> [271] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [289] "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" #> [307] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [325] "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [343] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [361] "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [379] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" #> [397] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [415] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" #> [433] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [451] "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [469] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [487] "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [505] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" #> [523] "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [541] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "0" "0" "0" "0" #> [559] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [577] "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "0" "0" "0" "0" "0" "0" "0" "1" #> [595] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [613] "0" "1" "0" "1" "1" "1" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [631] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [649] "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [667] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" #> [685] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [703] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" #> [721] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [739] "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [757] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [775] "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [793] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" #> [811] "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [829] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" #> [847] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [865] "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" #> [883] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [901] "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [919] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [937] "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [955] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" #> [973] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [991] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" #> [1009] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [1027] "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [1045] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [1063] "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [1081] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" #> [1099] "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [1117] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" #> [1135] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [1153] "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" #> [1171] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [1189] "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [1207] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [1225] "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [1243] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" #> [1261] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [1279] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" #> [1297] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [1315] "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [1333] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [1351] "0" "1" "1" "1" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [1369] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" #> [1387] "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [1405] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "1" "0" "0" "0" #> [1423] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [1441] "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" #> [1459] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [1477] "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [1495] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [1513] "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [1531] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" #> [1549] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [1567] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" #> [1585] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [1603] "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [1621] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [1639] "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [1657] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" #> [1675] "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [1693] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" #> [1711] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [1729] "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" #> [1747] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [1765] "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [1783] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [1801] "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [1819] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" #> [1837] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [1855] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" #> [1873] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [1891] "1" "1" "0" "1" "0" "1" "1" "0" "0" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [1909] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [1927] "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [1945] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" #> [1963] "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [1981] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" #> [1999] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [2017] "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" #> [2035] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [2053] "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [2071] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [2089] "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [2107] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" #> [2125] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [2143] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" #> [2161] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [2179] "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [2197] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" #> [2215] "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" #> [2233] "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" #> [2251] "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" #> [2269] "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" #> [2287] "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" #> [2305] "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" #> [2323] "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" #> [2341] "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" #> [2359] "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" #> [2377] "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" #> [2395] "1" "1" "0" "0" "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" #> [2413] "0" "0" "0" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" #> [2431] "0" "1" "1" "1" "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" #> [2449] "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1" "1" "1" #> [2467] "1" "1" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "0" "1" "1" "1" #> [2485] "1" "0" "0" "0" "0" "1" "1" "1" "0" "0" "0" "1"