May 2019
Intermediate to advanced
664 pages
15h 41m
English
The steps of loading the libraries, registering multiprocessing, setting a working directory, reading data from a working directory, removing nondiscriminatory features from data, and setting up cross-validation parameters remain the same in the SVMBag and NBBag implementations as well. So, we do not repeat these steps in the SVMBag or NBBag code. Rather, we will focus on discussing the SVMBag or NBBag specific code:
# Setting up SVM predict function as the default svmBag$pred function has some code issue svm.predict <- function (object, x) { if (is.character(lev(object))) { out <- predict(object, as.matrix(x), type = "probabilities") colnames(out) <- lev(object) rownames(out) <- ...