pdp.rank: Given an interpreter object with choice of PDP ranking...

View source: R/plotter.R

pdp.rankR Documentation

Given an interpreter object with choice of PDP ranking methodology (default: 'Variance'), produce PDP 'ranking' scores by feature. Optionally, permits a new observation to weight the PDP function and rankings.

Description

Returns a list of PDP 'ranking' scores corresponding to each feature.

Usage

pdp.rank(
  object,
  rank.method = "Variance",
  pdp.weight.obs = NULL,
  weight.pdp = FALSE,
  quantile.dist = 20
)

Arguments

object

The Interpreter class that we want understand the PDP ranking scores of.

rank.method

A string to select which PDP ranking methodology. Should be one of c("Variance", "FO.Derivative"). When set to "Variance" the PDP functions are ranked by variance of the PDP function. When set to "FO.Derivative" the PDP functions are ranked by the maximum absolute value of the numerical first order derivative. Note that a PDP ranking score of -1 will be given to categorical features with a 'FO.Derivative' PDP ranking methodology.

pdp.weight.obs

A single observation that takes the form of a data frame with a single row. PDP rankings are computed by applying the rank.method functionality on a region (dictated by the quantile.dist parameter) around this observation's feature values within the PDP function.

weight.pdp

A boolean flag that dictates whether or not to construct the PDP function as a weighted average of ICE functions. Should be one of c(TRUE, FALSE). The standard PDP function is a simple average of the ICE functions; this option produces a personalized PDP curve that is the weighted average of the ICE functions where the kth ICE function is given the weight the forestry predictor (stored within the object parameter) gives observation k when predicting for pdp.weight.obs.

quantile.dist

A positive number that dictates how many quantiles above and below each feature of a new observation comprises the PDP ranking value.

Value

A list of PDP ranking scores by feature.


forestry-labs/interpretability_sandbox documentation built on April 26, 2023, 4:14 p.m.