plotPEUni: Visualize partial effect of a feature

View source: R/plot_pe_uni.R

plotPEUniR Documentation

Visualize partial effect of a feature

Description

This function visualizes the contribution of a specific feature to the overall prediction score. If multiple base learner of the same features are included, they are all added to the graphic as well as the aggregated contribution. The difference to plotBaselearner() is that potentially multiple base learners that are based on feat are aggregated and visualized while plotBaselearner() only visualizes the contribution of one specific base learner. The function also automatically decides whether the given feature is numeric or categorical and chooses an appropriate technique (lines for numeric and horizontal lines for categorical).

Usage

plotPEUni(cboost, feat, npoints = 100L, individual = TRUE)

Arguments

cboost

(Compboost)
A trained Compboost object.

feat

(character(1L))
Name of the feature.

npoints

(integer(1L))
Number of points which are predicted for the lines (only applies to numerical features).

individual

(logical(1L))
Flag whether individual base learners should be added to the graphic or not.

Value

ggplot object containing the graphic.

Examples

cboost = Compboost$new(data = iris, target = "Petal.Length",
  loss = LossQuadratic$new())
cboost$addComponents("Sepal.Width")
cboost$train(500L)
plotPEUni(cboost, "Sepal.Width")

schalkdaniel/compboost documentation built on April 15, 2023, 9:03 p.m.