This is a multithreaded, multiclass implementation of a weighted, reduced convex hull-based support vector machine algorithm based on this paper by Goodrich et al. I have written the algorithm in Java, and that is mostly complete. Currently, I am working on developing the package with rJava. Uncommented demos can be found at this repo, which include a live OCR demo. My presentation can be found at my website.
As of now, the algorithm can be accessed by calling:
WSVM(df, kernel = "linear",
mu = NA,
q = 2.0,
gamma = 0.01,
ep = 1e-2,
max_its = 2000,
non_sep = 1e-5)
Where df
is a dataframe with classes as the first column, and features as the rest. kernel
has optiosn of "linear"
, "rbf"
, "monomial"
, and "polynomial"
. mu
is calculated by default when the value is NA
as
q
is the exponent of the monnomial/polynomial kernel, gamma
is for the rbf
kernel. ep
is max_its
is the maximum iterations. non_sep
is the threshold of deciding if hulls are nonseparable.
Predictions can be done with:
out$predict(vector)
Where out
is the Java object returned from the WSVM
function and vector
is a feature vector with features in the same order as df
.
require(devtools)
install_github(“mhmdmodan/JSUpySVM”, args="--no-multiarch")
If issues arise with Java/R architecture mismatch, clone the repo and install it using the build tab in RStudio.