1

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!

1 Answer 1

2

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*
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.