Description Usage Arguments See Also Examples
Predict values using oomlm
and oomglm
models
1 2 3 4 5 6 7 |
object |
An object inheriting from class |
new_data |
Observations for prediction. |
std_error |
Indicates if the standard error of predicted means should be returned. |
interval |
Type of interval calculation, "confidence" or "prediction.
Is ignored if |
level |
Confidence level for interval calculation. |
as_function |
If |
... |
Ignored. |
type |
The type of prediction for |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # fit an `oomlm` model
chunks <- oomdata_tbl(mtcars, chunk_size = 1)
x <- fit(oomlm(mpg ~ cyl + disp + hp), chunks)
# call `predict`
pred <- predict(x, mtcars)
sum((pred - mtcars$mpg)^2)
# pass TRUE for the `as_function` argument and the
# return value will be a prediction function with
# only one argument for data
pred_fun <- predict(x, mtcars, as_function = TRUE)
pred_fun(mtcars[1, ])
# pass TRUE for the `std_error` argument and the
# return value will include standard errors
# for the predicted means
pred <- predict(x, mtcars, std_error = TRUE)
head(pred)
# with std_error true, we can specify that a confidence or
# prediction interval be returned
pred <- predict(x, mtcars, std_error = TRUE, interval = "confidence")
head(pred)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.