Note: Crossposted by Ivan, James and myself.
Started as a GSoC 2018 project, the new rvw package was built to give R users easier access to a variety of efficient machine learning algorithms. Key features that promote this idea and differentiate the new rvw from existing Vowpal Wabbit packages in R are:
data.frameconverter covering different variations of Vowpal Wabbit input formats
Below is a simple example of how to use the renewed rvw’s interface:
library(rvw) library(mlbench) # for a dataset # Basic data preparation data("BreastCancer", package = "mlbench") data_full <- BreastCancer ind_train <- sample(1:nrow(data_full), 0.8*nrow(data_full)) data_full <- data_full[,-1] data_full$Class <- ifelse(data_full$Class == "malignant", 1, -1) data_train <- data_full[ind_train,] data_test <- data_full[-ind_train,] # Simple Vowpal Wabbit model for binary classification vwmodel <- vwsetup(dir = "./", model = "mdl.vw", option = "binary") # Training vwtrain(vwmodel = test_vwmodel, data = data_train, passes = 10, targets = "Class") # And testing vw_output <- vwtest(vwmodel = test_vwmodel, data = data_test)