Re: [R] error in random forest

From: David Katz <david_at_davidkatzconsulting.com>
Date: Sat, 08 Mar 2008 17:34:28 -0800 (PST)

I've had the same problem and solved it by removing the cases with the new levels - they need to be handled some other way, either by building a new model or reassigning the factor level to one in the training set.

Nagu wrote:
>
> Hi,
>
> I get the following error when I try to predict the probabilities of a
> test sample:
>
> Error in predict.randomForest(fit.EBA.OM.rf.50, x.OM, type = "prob") :
> New factor levels not present in the training data
>
> I have about 630 predictor variables in the dataset x.OM (25 factor
> variables and the remaining are continuous variables). Any ideas on
> how to trace it?
>
> Thank you,
> Nagu
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
View this message in context: http://www.nabble.com/error-in-random-forest-tp15904235p15922797.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 09 Mar 2008 - 07:27:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 09 Mar 2008 - 07:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive