
Last chance! 50% off unlimited learning
Sale ends in
Performs a sensitivity analysis on a specified class in a random forests model
rf.class.sensitivity(x, xdata, d = "1", p = 0.05, nperm = 999,
plot = TRUE, seed = NULL, ...)
randomForest class object
Independent variables used in model
Which class to perturb
Proportion of class to be randomized
Number of permutations
Plot results (TRUE/FALSE)
Random seed value
Additional arguments passed to randomForest
List object with following components: @return mean.error Mean of RMSE @return sd.error Standard deviation of RMSE @return rmse Root mean squared error (RMSE) for each perturbed probability @return probs data.frame with "true" estimate in first column and perturbed probabilities in subsequent columns.
Evans J.S., M.A. Murphy, Z.A. Holden, S.A. Cushman (2011). Modeling species distribution and change using Random Forests CH.8 in Predictive Modeling in Landscape Ecology eds Drew, CA, Huettmann F, Wiersma Y. Springer
Gardner, R.H., R.V. O'Neill, M.G. Turner, and V.H. Dale (1989). Quantifying scale-dependent effects of animal movements with simple percolation models. Landscape Ecology 3:217-227.
# NOT RUN {
library(randomForest)
data(iris)
y <- as.factor(ifelse(iris$Species == "setosa" |
iris$Species == "virginica", 1, 0) )
xdata <- iris[,1:4]
rf.mdl <- randomForest(xdata, y, ntree=501)
ua <- rf.class.sensitivity(rf.mdl, xdata=xdata, nperm=20, ntree=501, plot=TRUE)
# }
Run the code above in your browser using DataLab