From: Martin Lam
Dear mailinglist members,
I was wondering if there was a way to re-evaluate
instances of a tree (in the forest) again after I
manually changed a splitpoint (or split variable)
decision node. Here's an illustration:
library("randomForest")
forest.rf <- randomForest(formula = Species ~ .,
= iris, do.trace = TRUE, ntree = 3, mtry = 2,
norm.votes = FALSE)
# I am going to change the splitpoint of the root
of the first tree to 1
forest.rf$forest$xbestsplit[1,]
forest.rf$forest$xbestsplit[1,1] <- 1
forest.rf$forest$xbestsplit[1,]
Because I've changed the splitpoint, some
the leafs are not supposed where they should be.
there a way to reappoint them to the correct leaf?
I'm not sure what you want to do exactly, but I
suspect you can use
predict().
I was also wondering how I should interpret the
of do.trace:
ntree OOB 1 2 3
1: 3.70% 0.00% 6.25% 5.88%
2: 3.49% 0.00% 3.85% 7.14%
3: 3.57% 0.00% 5.56% 5.26%
What's OOB and what does the percentages mean?
OOB stands for `Out-of-bag'. Read up on random
forests (e.g., the article
in R News) to learn about it. Those numbers are
estimated error rates. The
`OOB' column is across all data, while the others
are for the classes.
Andy
Thanks in advance,
Martin