Learn R Programming

rfviz (version 1.0.1)

rf_prep: 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.

References

Liaw A, Wiener M (2002). <U+201C>Classification and Regression by randomForest.<U+201D> _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), <U+201C>Manual On Setting Up, Using, And Understanding Random Forests V3.1<U+201D>, 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

Run this code
# NOT RUN {
#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)
# }

Run the code above in your browser using DataLab