Plot a partial dependence with ggplot2.
Source:R/generatePartialDependence.R
plotPartialDependence.Rd
Plot a partial dependence from generatePartialDependenceData using ggplot2.
Usage
plotPartialDependence(
obj,
geom = "line",
facet = NULL,
facet.wrap.nrow = NULL,
facet.wrap.ncol = NULL,
p = 1,
data = NULL
)
Arguments
- obj
PartialDependenceData
Generated by generatePartialDependenceData.- geom
(
charater(1)
)
The type of geom to use to display the data. Can be “line” or “tile”. For tiling at least two features must be used withinteraction = TRUE
in the call to generatePartialDependenceData. This may be used in conjuction with thefacet
argument if three features are specified in the call to generatePartialDependenceData. Default is “line”.- facet
(
character(1)
)
The name of a feature to be used for facetting. This feature must have been an element of thefeatures
argument to generatePartialDependenceData and is only applicable when said argument had length greater than 1. The feature must be a factor or an integer. If generatePartialDependenceData is called with theinteraction
argumentFALSE
(the default) with argumentfeatures
of length greater than one, thenfacet
is ignored and each feature is plotted in its own facet. Default isNULL
.- facet.wrap.nrow, facet.wrap.ncol
(integer)
Number of rows and columns for facetting. Default for both isNULL
. In this case ggplot'sfacet_wrap
will choose the layout itself.- p
(
numeric(1)
)
Ifindividual = TRUE
thensample
allows the user to sample without replacement from the output to make the display more readable. Each row is sampled with probabilityp
. Default is1
.- data
(data.frame)
Data points to plot. Usually the training data. For survival and binary classification tasks a rug plot wherein ticks represent failures or instances of the positive class are shown. For regression tasks points are shown. For multiclass classification tasks ticks are shown and colored according to their class. Both the features and the target must be included. Default isNULL
.
See also
Other partial_dependence:
generatePartialDependenceData()
Other plot:
createSpatialResamplingPlots()
,
plotBMRBoxplots()
,
plotBMRRanksAsBarChart()
,
plotBMRSummary()
,
plotCalibration()
,
plotCritDifferences()
,
plotLearningCurve()
,
plotROCCurves()
,
plotResiduals()
,
plotThreshVsPerf()