View source: R/linear_regression-predict.R
predict.linear_regression | R Documentation |
linear_regression
Predict from a linear_regression
## S3 method for class 'linear_regression' predict(object, new_data, type = "numeric", ...)
object |
A |
new_data |
A data frame or matrix of new predictors. |
type |
A single character. The type of predictions to generate. Valid options are:
|
... |
Not used, but required for extensibility. |
A tibble of predictions. The number of rows in the tibble is guaranteed
to be the same as the number of rows in new_data
.
set.seed(0) data <- simulate_dummy_linear_data() model <- linear_regression(y~., data, l1=0.05, l2=0.01, frob=0.01, num_comp=3) new_data <- simulate_dummy_linear_data() predict(model, new_data, type = "numeric")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.