plot_learner_prediction: Plot for Learner Predictions

Description Usage Arguments Value Examples

View source: R/plot_learner_prediction.R

Description

Generates a plot for the mlr3::Prediction of a single mlr3::Learner on a single mlr3::Task.

Note that this function is a wrapper around autoplot.ResampleResult() for a temporary mlr3::ResampleResult using mlr3::mlr_resamplings_holdout with ratio 1 (all observations in training set).

Usage

1
plot_learner_prediction(learner, task, grid_points = 100L, expand_range = 0)

Arguments

learner

(mlr3::Learner).

task

(mlr3::Task).

grid_points

(integer(1))
Resolution of the grid. For factors, ordered and logicals this value is ignored.

expand_range

(numeric(1))
Expand the prediction range for numerical features.

Value

ggplot2::ggplot() object.

Examples

1
2
3
4
5
6
7
library(mlr3)
library(mlr3viz)

task = mlr3::tsk("pima")$select(c("age", "glucose"))
learner = lrn("classif.rpart", predict_type = "prob")
p = plot_learner_prediction(learner, task)
print(p)

mlr-org/mlr3viz documentation built on Oct. 13, 2021, 11:43 p.m.