How to check the performance error of bagging model in R?

r
classification
bagging

#1

I am currently solving a problem of classification using bagging .I have created the model and used it to predict the class of data set .I want to know how we can check the performance of bagging model for predication of class .

 library(rpart) 
 library(mlbench)
 data(BreastCancer) # data for bagging
head(BreastCancer) #  first six rows of data
 Id Cl.thickness Cell.size Cell.shape Marg.adhesion Epith.c.size Bare.nuclei Bl.cromatin Normal.nucleoli Mitoses     Class
  1000025            5         1          1             1            2           1           3               1       1    benign
  1002945            5         4          4             5            7          10           3               2       1    benign
  1015425            3         1          1             1            2           2           3               1       1    benign
  1016277            6         8          8             1            3           4           3               7       1    benign
  1017023            4         1          1             3            2           1           3               1       1    benign
  1017122            8        10         10             8            7          10           9               7       1 malignant
    
 l <- length(BreastCancer[,1] #length of data
 sub <- sample(1:l,2*l/3) # sample the data for predication 
 BC.bagging <- bagging(Class ~.,data=BreastCancer[,-1],mfinal=20) # bagging model
BC.bagging.pred <- predict.bagging(BC.bagging,newdata=BreastCancer[-sub,-1]) # predication using bagging model

I want to know the function by which I can check the performance of bagging model .


#2

@harry-
you can check the performance of your model by using simple commands like
BC.bagging.pred$confusion
It will give you matrix between the original and predicted values

BC.bagging.pred$error
It will give the error in the prediction of classes by the bagging model.

Hope this helps!

Regards,
Hinduja