rf_prep: A function to create Random Forests output in preparation for...

View source: R/rf_prep.R

rf_prepR Documentation

A function to create Random Forests output in preparation for visualization with rf_viz

Description

A function using Random Forests which outputs a list of the Random Forests output, the predictor variables data, and response variable data.

Usage

rf_prep(x, y = NULL, ...)

Arguments

x

A data frame or a matrix of predictors.

y

A response vector. If a factor, classification is assume, otherwise regression is assumed. If omitted, randomForest will run in unsupervised mode.

...

Optional parameters to be passed down to the randomForest function. Use ?randomForest to see the optional parameters.

Value

The parallel coordinate plots of the input data, the local importance scores, and the 3-D XYZ classic multidimensional scaling proximities from the output of the random forest algorithm.

Note

For instructions on how to use randomForests, use ?randomForest. For more information on loon, use ?loon.

For detailed instructions in the use of these plots in this package, visit https://github.com/chriskuchar/rfviz/blob/master/Rfviz.md

Author(s)

Chris Kuchar chrisjkuchar@gmail.com, based on original Java graphics by Leo Breiman and Adele Cutler.

References

Liaw A, Wiener M (2002). “Classification and Regression by randomForest.” _R News_, *2*(3), 18-22. https://CRAN.R-project.org/doc/Rnews/

Waddell A, Oldford R. Wayne (2018). "loon: Interactive Statistical Data Visualization" https://github.com/waddella/loon

Breiman, L. (2001), Random Forests, Machine Learning 45(1), 5-32.

Breiman, L (2002), “Manual On Setting Up, Using, And Understanding Random Forests V3.1”, https://www.stat.berkeley.edu/~breiman/Using_random_forests_V3.1.pdf

Breiman, L., Cutler, A., Random Forests Graphics. https://www.stat.berkeley.edu/~breiman/RandomForests/cc_graphics.htm

See Also

randomForest, rf_viz, l_plot3D, l_serialaxes

Examples

#Preparation for classification with Iris data set
rfprep <- rf_prep(x=iris[,1:4], y=iris$Species)

#Preparation for regression with mtcars data set
rfprep <- rf_prep(x=mtcars[,-1], y=mtcars$mpg)

#Preparation for the unsupervised case with Iris data set
rfprep <- rf_prep(x=iris[,1:4], y=NULL)

rfviz documentation built on March 18, 2022, 5:52 p.m.