View source: R/predict_filter.R
| predict_filter_bound_dynamic | R Documentation |
Generates a prediction filter for the predict.filter
argument of learner that bounds predictions to the range of the
response observed in the estimation data (min(response), max(response)).
predict_filter_bound_dynamic(lower = FALSE, upper = FALSE, response = "y")
lower |
(logical) If |
upper |
(logical) If |
response |
(character) Name of the response column in the data. |
A filter generator function (see learner).
Benedikt Sommer
data(cars)
lr <- learner_glm(
speed ~ dist,
learner.args = list(
predict.filter = predict_filter_bound_dynamic(
upper = TRUE, response = "speed"
)
)
)
lr$estimate(cars)
lr$predict(data.frame(dist = c(200, 2000)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.