Wolfgang,
This looks great and certainly puts to shame my code .
Thanks,
Monica
Date: Fri, 7 Sep 2007 21:04:32 +0100 From: [EMAIL PROTECTED] To: [EMAIL
PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] confusion matrix -
better code? Dear Monica, try this: cm = table(tr
Michael,
Thank you very much. My code is certainly put to shame by yours. I promise to
read about factor to see how you use it and why ;-))
I really appreciate your help.
Monica
Subject: RE: [R] confusion matrix - better code? Date: Fri, 7 Sep 2007
15:36:00 -0500 From: [EMAIL PROTECTED
Hi,
Ive written some code to obtain a confusion matrix when the true
classification and the predicted classification are known. Suppose true
classification is called tr and predicted classification is pr. I have 4
classes in tr, but only 3 classes out of 4 are predicted in pr.
Dear Monica,
try this:
cm = table(tr, pr)
cm
pr
tr 1 2 3
1 2 1 0
2 2 1 0
3 0 0 3
4 0 1 0
rowSums(cm)
colSums(cm)
Best wishes
Wolfgang Huber
Monica Pisica ha scritto:
Hi,
I�ve written some code to obtain a confusion matrix when the true
classification and