I have run Random Forest and GBM in Biomod2 package in R, now I need to see their tree structure (final model or a sample tree). How can I do this? Does anybody have the necessary code (compatible and applicable in Biomod2)?
I know this topic is more than 2 years old by now, but as I recently noticed by request, there was a little error in my code (Line 100) due to a wrong variable name. I fixed it in the version below.
Thanks for your answer. Actually I used biomod2 to run RF, and I should be considered as a fresh man with R. I need the code to be able to check the outcome.
I am not familiar with the randomForest in Biomod2 package as I usually work with the standard randomForest package, but I think that the core functionality is similar.
Are you interested in a tree plot of you result as the one attached?
please see Cross Validated site is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:
I think you will find some help for your problem in the following thread: http://stats.stackexchange.com/questions/41443/how-to-actually-plot-a-sample-tree-from-randomforestgettree . That´s the source where I took the code from.
I attach you an R-Script which I used to generate the above graph with some comments for you.
As far as I understand the biomod2 Package uses the randomForest library, in this case you should definitly be able to use all functions I used.
I know this topic is more than 2 years old by now, but as I recently noticed by request, there was a little error in my code (Line 100) due to a wrong variable name. I fixed it in the version below.