7

I found that learning how MCMC and HMM work went best by writing the code of simple examples myself. I would now like to learn how random forests work, but it's again not that trivial to transform the theoretical texts and pseudocode to real scripts (well... for me at least).

Could anybody point me to simple examples of random forests? I know of the R package and so on (and I have used it already) but instead of an interface I really would prefer to have some code of a specific example that I can imitate to learn how random forests are constructed.

mpiktas
  • 33,140
  • 5
  • 82
  • 138
lgbi
  • 401
  • 3
  • 7

1 Answers1

6

For implementations, see this Q. However I wouldn't say any of them is easy to follow.

In fact the main issue is the tree building itself. It is usually cluttered code adapted from some other package, the rest of the algorithm is mostly trivial... you may thus try first to write random naive Bayes or some similar algorithm using simpler base classifier.