Displaying 1 result from an estimated 1 matches for "_truth_".
Did you mean:
_true_
2007 Dec 21
1
using apply to loop [SEC=UNCLASSIFIED]
...d try this:
# find the index of the maximum value in each row of _data_, #
disregarding the last column classified <-
apply(data[,-(nclass+1)],1,which.max)
## or, if the maximum may be repeated:
classified <- apply(data[,-(nclass+1)], 1, FUN = function(x) which(x ==
max(x)))
# the variable _truth_ is just the last column of _data_ ?
truth <- data[,nclass + 1]
?table
z <- table(classified, truth)
HTH Joe
Joe Crombie
Biosecurity and Information Sciences
Bureau of Rural Science
Canberra Australia
e: joe.crombie at brs.gov.au
-----Original Message-----
From: r-help-bounces a...