# Use adaboost library(adabag) boost_fit <- boosting(formula, data, boos = TRUE, mfinal = 100, coeflearn = 'Breiman', control,...) # Use xgboost library(xgboost) xgboost_fit <- xgboost(data = train$data, label = train$label, max.depth = 2, eta = 1, nthread = 2, nround = 2, objective = "binary:logistic") cancer <- read.csv("breast_cancer.csv") set.seed(2017) ind <- sample(nrow(cancer),0.8*nrow(cancer)) train <- cancer[ind,] test <- cancer[-ind,] library(randomForest) rf <- randomForest(diagnosis ~ ., data = train[,2:10], ntree = 20) pred <- predict(rf, newdata = test[,-c(length(test))]) cm <- table(test$diagnosis, pred) cm