Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- group_wo_ex <- group
- group_wo_ex$experts..0 <- NULL
- group_wo_ex$experts..1 <- NULL
- group_wo_ex$experts..2 <- NULL
- group_wo_ex$experts..3 <- NULL
- group_wo_ex$experts..4 <- NULL
- group_wo_ex$experts..5 <- NULL
- group_wo_ex$sum <- NULL
- dataset <- group_wo_ex
- dataset_ratio <- gain.ratio( consensus~., dataset)
- dataset_ratio <- t(dataset_ratio)
- names <- colnames( t (dataset_ratio[, which(dataset_ratio>0.07)]))
- dataset_w_ratio <- dataset[names]
- dataset_w_ratio$consensus <- dataset$consensus
- #View(dataset_w_ratio)
- grid <- expand.grid(k = c(3,5,7,9,15,19,21,23,25,27,29,31,33))
- # define training control
- train_control <- trainControl(method="cv", number=10)
- testknn <- train(dataset_w_ratio, dataset_w_ratio$consensus, method="knn", tuneGrid=grid, preProcess=c("center", "scale"))
- testnb <- train(dataset_w_ratio, dataset_w_ratio$consensus, method="nb", preProcess=c("center", "scale"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement