ddkssk 909
2017-May-27 03:54 UTC
[R] Error in y - ymean : non-numeric argument to binary operator
I am trying to do classification with Randomforest() . the class variable is nominal. But I get this error model1 <-randomForest(Cath~.,data=trainrf) Error in y - ymean : non-numeric argument to binary operator In addition: There were 26 warnings (use warnings() to see them)> model1Error: object 'model1' not found [[alternative HTML version deleted]]
Peter Langfelder
2017-May-27 05:21 UTC
[R] Error in y - ymean : non-numeric argument to binary operator
This is a bit of a shot in the dark since I haven't used randomForest in several years, but I seem to recall that running randomForest through the formula interface was asking for trouble... Try not using the formula interface and specify the x, y, xtest arguments directly. Peter On Fri, May 26, 2017 at 8:54 PM, ddkssk 909 <ddkssk909c at gmail.com> wrote:> I am trying to do classification with Randomforest() . the class variable > is nominal. > > But I get this error > model1 <-randomForest(Cath~.,data=trainrf) > Error in y - ymean : non-numeric argument to binary operator > In addition: There were 26 warnings (use warnings() to see them) >> model1 > Error: object 'model1' not found > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.