svmegn is a C++ library for supervised learning using established methods of support vector machines. It is wrapping libsvm and liblinear while using the Eigen linear algebra library for interfacing. Requires a C++17 compliant compiler. Tested with Clang, GCC, and Visual Studio.
// Let X be the matrix of features (dense or sparse)
// Let y be the vector of targets (class labels in this case)
svmegn::Params params;
params.model_type = svmegn::ModelType::SVM; // = libsvm. Use LINEAR for liblinear
params.svm_type = svmegn::SvmType::C_SVC;
params.C = 10;
params.gamma = 0.1;
const auto model = svmegn::Model::train(params, X, y);
const auto prediction = model.predict(X);
// prediction.y is now the vector of responses
svmegn only depends on the Eigen header-only library.
Requires: cmake, python
python3 bootstrap.py # uses conan to install Eigen and gtest
mkdir build && cd build
cmake -Dsvmegn_build_tests=ON ..
cmake --build .
ctest --verbose