I got the following results when I run radomForest with below commands:
qair <- read.table("train10.dat", header = T)
oz.rf <- randomForest(LESION ~ ., data = qair, ntree = 220, importance = TRUE)
print(oz.rf)
Call:
randomForest.formula(x = LESION ~ ., data = qair, ntree = 220, importance
= TRUE)
Type of random forest: classification
Number of trees: 220
No. of variables tried at each split: 2
OOB estimate of error rate: 15.86%
Confusion matrix:
lesion noninf class.error
lesion 3949 525 0.1173447
noninf 894 3580 0.1998212
What did this mean? Is 11.7% the classification error for 'lesion' class, and
19.98% the classification error for 'noninf' class in the training set?
But when I run below command to test the performance of classification in the
same training set.
ntrain <- read.table("train10.dat", header = T)
ntrain.pred <- predict(oz.rf, ntrain)
table(observed = ntrain[, "LESION"], predicted = ntrain.pred)
I got the following results. It seemed that the classification rates for
'lesion' and 'noninf' classes are 0. Any suggestion will be very appreciated.
predicted
observed lesion noninf
lesion 4474 0
noninf 0 4474
---------------------------------
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html