---------- Forwarded message ----------
Date: Wed, 5 Oct 2011 21:09:41 +0000
From: Chris <christopher.a.h...@gmail.com>
To: r-h...@stat.math.ethz.ch
Subject: Re: [R] Party extract BinaryTree from cforest?

I found an internal workaround to this to support printing and plot type simple,

tt<-party:::prettytree(cf at ensemble[[1]], names(cf at data at get("input")))
npt <- new("BinaryTree")
npt@tree<-tt
plot(npt)
Error in terminal_panel(<S4 object of class "BinaryTree">) :
 âctreeobjâ is not a regression tree

library("party")
cf <- cforest(Species ~ ., data = iris)
pt <- party:::prettytree(cf@ensemble[[1]], names(cf@data@get("input")))
pt
nt <- new("BinaryTree")
nt@tree <- pt
nt@data <- cf@data
nt@responses <- cf@responses
nt
plot(nt)

will do.

Torsten

plot(npt, type="simple")

Any additional help is appreciated.

______________________________________________
R-help@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.
______________________________________________
R-help@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.

Reply via email to