Oritteropus
2012-Nov-22 19:01 UTC
[R] Partial dependence plot in randomForest package (all flat responses)
Hi, I'm trying to make a partial plot with package randomForest in R. After I perform my random forest object I type partialPlot(data.rforest, pred.data=act2, x.var=centroid, "C") where data.rforest is my randomforest object, act2 is the original dataset, centroid is one of the predictor and C is one of the classes in my response variable. Whatever predictor or response class I try I always get a plot with a straight line (a completely flat response). Similarly, If I set a categorical variable as predictor, I get a barplot with all the bar with the same height. I suppose I'm doing something wrong here because all other analysis on the same rforest object seem correct (e.g. varImp or MDSplot). Is it possible it is related to some option set in random forest object? Can somebody see the problem here? Thanks for your time -- View this message in context: http://r.789695.n4.nabble.com/Partial-dependence-plot-in-randomForest-package-all-flat-responses-tp4650470.html Sent from the R help mailing list archive at Nabble.com.
Liaw, Andy
2012-Nov-26 13:34 UTC
[R] Partial dependence plot in randomForest package (all flat responses)
Not unless we have more information. Please read the Posting Guide to see how to make it easier for people to answer your question. Best, Andy -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Oritteropus Sent: Thursday, November 22, 2012 2:02 PM To: r-help at r-project.org Subject: [R] Partial dependence plot in randomForest package (all flat responses) Hi, I'm trying to make a partial plot with package randomForest in R. After I perform my random forest object I type partialPlot(data.rforest, pred.data=act2, x.var=centroid, "C") where data.rforest is my randomforest object, act2 is the original dataset, centroid is one of the predictor and C is one of the classes in my response variable. Whatever predictor or response class I try I always get a plot with a straight line (a completely flat response). Similarly, If I set a categorical variable as predictor, I get a barplot with all the bar with the same height. I suppose I'm doing something wrong here because all other analysis on the same rforest object seem correct (e.g. varImp or MDSplot). Is it possible it is related to some option set in random forest object? Can somebody see the problem here? Thanks for your time -- View this message in context: http://r.789695.n4.nabble.com/Partial-dependence-plot-in-randomForest-package-all-flat-responses-tp4650470.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. Notice: This e-mail message, together with any attachme...{{dropped:11}}