[R] ctree question
Achim.Zeileis at uibk.ac.at
Thu Jan 19 07:34:30 CET 2012
On Wed, 18 Jan 2012, seanstclair at verizon.net wrote:
> Hello. I have used the "party" package to generate a regression tree as
> The above works fine. Orig data was my training data. I now have a test
> data file (testdata), and would like to run the testdata through the above
> tree to see predictions. I tried using the following function
> but I get the following error:
> Error in checkData(oldData, RET) :
> Levels in factors of new data do not match original data
> I've looked at the testdata file closely and it does not appear to contain
> any levels of factors that were not in the original.
Did you check carefully enough? compare
and so on for X2 and X3. Maybe the _observed_ levels in the testdata are
ok but not all levels.
> What might I be doing
> incorrectly, and how can i use the tree that was generated above to
> generate predictions for this new file testdata?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help