Description Usage Arguments Details Value Author(s) References See Also Examples
Impute missing values in predictor data using proximity from randomForest.
1 2 3 4 
x 
A data frame or matrix of predictors, some containing

y 
Response vector ( 
data 
A data frame containing the predictors and response. 
iter 
Number of iterations to run the imputation. 
ntree 
Number of trees to grow in each iteration of randomForest. 
... 
Other arguments to be passed to

subset 
A logical vector indicating which observations to use. 
The algorithm starts by imputing NA
s using
na.roughfix
. Then randomForest
is called
with the completed data. The proximity matrix from the randomForest
is used to update the imputation of the NA
s. For continuous
predictors, the imputed value is the weighted average of the
nonmissing obervations, where the weights are the proximities. For
categorical predictors, the imputed value is the category with the
largest average proximity. This process is iterated iter
times.
Note: Imputation has not (yet) been implemented for the unsupervised case. Also, Breiman (2003) notes that the OOB estimate of error from randomForest tend to be optimistic when run on the data matrix with imputed values.
A data frame or matrix containing the completed data matrix, where
NA
s are imputed using proximity from randomForest. The first
column contains the response.
Andy Liaw
Leo Breiman (2003). Manual for Setting Up, Using, and Understanding Random Forest V4.0. https://www.stat.berkeley.edu/~breiman/Using_random_forests_v4.0.pdf
1 2 3 4 5 6 7 8 9 10 
randomForest 4.614
Type rfNews() to see new features/changes/bug fixes.
ntree OOB 1 2 3
300: 4.67% 0.00% 8.00% 6.00%
ntree OOB 1 2 3
300: 5.33% 0.00% 8.00% 8.00%
ntree OOB 1 2 3
300: 5.33% 0.00% 8.00% 8.00%
ntree OOB 1 2 3
300: 5.33% 0.00% 8.00% 8.00%
ntree OOB 1 2 3
300: 5.33% 0.00% 8.00% 8.00%
Call:
randomForest(formula = Species ~ ., data = iris.imputed)
Type of random forest: classification
Number of trees: 500
No. of variables tried at each split: 2
OOB estimate of error rate: 5.33%
Confusion matrix:
setosa versicolor virginica class.error
setosa 50 0 0 0.00
versicolor 0 46 4 0.08
virginica 0 4 46 0.08
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.