I tried fitting a Random Forest on a dataset. It took hours but eventually fitted. Command used was: model <- train (classe~., data=training, method="rf", prox=F)
model reported following:
#Random Forest
13737 samples 52 predictor 5 classes: 'A', 'B', 'C', 'D', 'E'
No pre-processing Resampling: Bootstrapped (25 reps)
Summary of sample sizes: 13737, 13737, 13737, 13737, 13737, 13737, ...
Resampling results across tuning parameters:
mtry Accuracy Kappa Accuracy SD Kappa SD
2 0.9888012 0.9858367 0.001844763 0.002329859
27 0.9882821 0.9851812 0.001874991 0.002365894
52 0.9820495 0.9773000 0.003680805 0.004649905
Accuracy was used to select the optimal model using the largest value. The final value used for the model was mtry = 2.
#When I ran the prediction on the training data, I got 100% accuracy.
prediction <- predict(model, training)
table(prediction, training$classe)
prediction A B C D E
A 3906 0 0 0 0
B 0 2658 0 0 0
C 0 0 2396 0 0
D 0 0 0 2252 0
E 0 0 0 0 2525
I would've expected it to be ~98.9% as reported by the model.
What am I missing ?
Thanks and regards,