ice.kernreg: ICE plot for univariate kernel regression

View source: R/ice.kernreg.R

ICE plot for univariate kernel regressionR Documentation

ICE plot for univariate kernel regression

Description

ICE plot for univariate kernel regression.

Usage

ice.kernreg(y, x, h, type = "gauss", k = 1, frac = 0.1)

Arguments

y

A numerical vector with the response values.

x

A numerical matrix with the predictor variables.

h

The bandwidth value to consider.

type

The type of kernel to use, "gauss" or "laplace".

k

Which variable to select?.

frac

Fraction of observations to use. The default value is 0.1.

Details

This function implements the Individual Conditional Expecation plots of Goldstein et al. (2015). See the references for more details.

Value

A graph with several curves. The horizontal axis contains the selected variable, whereas the vertical axis contains the centered predicted values. The black curves are the effects for each observation and the blue line is their average effect.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

https://christophm.github.io/interpretable-ml-book/ice.html

Goldstein, A., Kapelner, A., Bleich, J. and Pitkin, E. (2015). Peeking inside the black box: Visualizing statistical learning with plots of individual conditional expectation. Journal of Computational and Graphical Statistics 24(1): 44-65.

See Also

ice.pprcomp, kernreg.tune, alfa.pcr, lc.reg

Examples

x <- as.matrix( iris[, 2:4] )
y <- iris[, 1]
ice <- ice.kernreg(y, x, h = 0.1, k = 1)

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.