[R] "tree": Extracting deviance & Gaussian model of the node?

Tak Kaneko tk229 at hermes.cam.ac.uk
Mon May 7 19:04:29 CEST 2001


I'm trying to use the "tree" package in R to predict intonation for a
speech synthesiser and when I feed the feature vector into the tree,
I want to get the predicted value and the deviance associated with that

I was hoping that the following command will return a tree object of the
predicted values, but I get the following error:

> test.tr <- predict.tree(pr,test.data,type="tree")
Error in as.list(X) : Object "response.names" not found

pr = 	A tree was grown using the training data and then pruned back to
	where the deviance was minimised when a separate test data set was
	used. "pr" is this pruned tree.

test.data = test data with the features and response

How would I be able to access the prediction and the deviance? Would this
work if the data was a feature vector with no responses? (as would be the
case when it comes to predicting the real thing).

Assuming that the distribution of the data at each node is Gaussian, I'd
like to model each node as a gaussian probability density function with a
mean at the predicted value and variance, which is presumably related to
the deviance...

I've found out the definition for the deviance from the S-plus manual but
it's not yet clear to me. So how could I deduce the variance of a value
predicted by "tree"?

Thanks and I'd be grateful if you could also reply to my address above
(tk229 at cam.ac.uk).

Tak Kaneko

Mobile:	07866 581 806	Cambridge Tel: 01223 711 160
Permanent e-mail:	tkaneko at iee.org
Home:	 		Tel (01494) 680 230
			11 Oldbury Grove, Beaconsfield, Bucks HP9 2AJ

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list