David L. Van Brunt, Ph.D.
2007-May-08 01:51 UTC
[R] How might I -remove- a tree from a random forest?
I see the function "getTree", which is very interesting. As I'm trying to teach myself more and more about R, and dealing with lists, it occurred to me that it might be fun to remove (as in delete) a single tree from a forest...say to go from 500 to 499. I know, I know... "why?" Why, to play, of course! I've been doing a lot of reading on various tuning parameters, and wanted to play with "thinning" as a demonstration project. Problem is, each "tree" is a different length (naturally), and when I try to set a portion (identified by examining the getTree function) to "NULL", I get an error about lengths not matching up. Wondering if there's a tool somewhere out there to do this in a straightforward fashion, or any breadcrumbs to get me going. If this is a "new" thing, I'll post the function when I'm done for others to play with it, too. -- --------------------------------------- David L. Van Brunt, Ph.D. mailto:dlvanbrunt@gmail.com "If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy." --James Madison [[alternative HTML version deleted]]
Possibly Parallel Threads
- memory, speed, and assigning results into new v. existing variable
- replacing all NA's in a dataframe with zeros...
- randomForest gives different results for formula call v. x, y methods. Why?
- Repost: Examples of "classwt", "strata", and "sampsize" i n randomForest?
- Repost: Examples of "classwt", "strata", and "sampsize" in randomForest?