Description Usage Arguments Value Examples
A helper function that takes as its arguement an estimated machine learning model and returns a prediction function for use within a machine learning pipeline.
1 | predict_model(.m)
|
.m |
An estimated machine lerning model. |
A unary function of a data.frame that returns the input data.frame with the predicted
response variable column appended. This function is assigned the classes
"predict_model"
and "ml_pipeline_section"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
data <- head(faithful)
m <- estimate_model(function(df) {
lm(eruptions ~ 1 + waiting, df)
})
predict_model(m(data))(data, "pred_eruptions")
# eruptions waiting pred_eruptions
# 1 3.600 79 3.803874
# 2 1.800 54 2.114934
# 3 3.333 74 3.466086
# 4 2.283 62 2.655395
# 5 4.533 85 4.209219
# 6 2.883 55 2.182492
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.