简体   繁体   中英

Random Forest algorithm in R

How can I see the algorithm of a randomForest in R?

I have tried with:

library(randomForest)
radomForest

But the output I´ve got is:

function (x, ...) 
UseMethod("randomForest")
<environment: namespace:randomForest>

Thanks!

You don't see much there, b/c randomForest is a S3 function and calls different functions depending on the class of the input you provide to the algorithm. Typing randomForest:::randomForest.default gives you more information.

However, I assume that parts of the functions used therein are written in C or Fortran. To see all the code, there is a GitHub mirror of the cran package here: https://github.com/cran/randomForest

Note: methods(randomForest) returns the available methods of a S3 generic function. In this case:

methods(randomForest)
## [1] randomForest.default* randomForest.formula*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM