Skip to Content
Advanced Machine Learning with R
book

Advanced Machine Learning with R

by Cory Lesmeister, Dr. Sunil Kumar Chinnamgari
May 2019
Intermediate to advanced
664 pages
15h 41m
English
Packt Publishing
Content preview from Advanced Machine Learning with R

Support vector machine bagging (SVMBag) implementation

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) <- ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning Using R

Machine Learning Using R

Karthik Ramasubramanian, Abhishek Singh
Machine Learning with R Cookbook - Second Edition

Machine Learning with R Cookbook - Second Edition

AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
Practical Machine Learning in R

Practical Machine Learning in R

Fred Nwanganga, Mike Chapple

Publisher Resources

ISBN: 9781838641771Supplemental Content