Add support for the SVCBlock, the SVRBlock and the svm_solver tool - #109
Open
dmeoli wants to merge 11 commits into
Open
Add support for the SVCBlock, the SVRBlock and the svm_solver tool#109dmeoli wants to merge 11 commits into
dmeoli wants to merge 11 commits into
Conversation
# Conflicts: # docs/release_notes.md # pysmspp/__init__.py # pysmspp/block.py # pysmspp/data/components.csv # pysmspp/smspp_tools.py # test/test_io.py # test/test_optimize.py
davide-f
reviewed
Sep 1, 2026
davide-f
left a comment
Member
There was a problem hiding this comment.
Hello! Thanks for the PR, comments added
Comment on lines
7
to
11
| * Add the `Support Vector Machines` example, which runs SMS++ and scikit-learn side by side on the same train/test split, k-fold cross-validation and grid of hyper-parameters | ||
|
|
||
| * Add support for the SVCBlock and the SVRBlock, i.e., the training problem of a Support Vector Machine, with the `SVMSolver` tool, the configuration templates of the `SVMBlock` folder and the model selection the tool performs (hold-out, k-fold cross-validation and grid search). The templates include `SVMSCfg-libsvm.txt`, which trains the model with LIBSVM: the example compares it with `libsvm-official` and with scikit-learn, i.e., the same library called from Python. | ||
|
|
||
| * Mirror the repository to its GitLab copy, `smspp/pysmspp`, at every push on `main`: SMS++ lives on GitLab and mirrors itself to GitHub, pySMSpp is the one going the other way round. |
Member
There was a problem hiding this comment.
Please add the link to the PRs, follow the examples shown below
| [self._solver_path, self._help_option], | ||
| check=False, | ||
| shell=self._shell, | ||
| capture_output=True, # the help message is not what is asked for here |
Member
There was a problem hiding this comment.
Please revise: it is impossible to compare the differences here
Comment on lines
+54
to
+55
| "scikit-learn", # the SVM example compares SMS++ with scikit-learn | ||
| "libsvm-official", # ... and with LIBSVM itself, which is what both use |
… notes link the PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the
SVCBlockand theSVRBlockof SMS++, i.e. the training problem of a Support Vector Machine, together with thesvm_solvertool that trains it and performs the model selection around it.What is in:
SVMSolver, the interface to thesvm_solvertool, with the options for the hold-out, the k-fold cross-validation, the grid search over the hyper-parameters and the consensus structure of the problem in chunks. It parses the scores of the model selection and the trained model out of the logSVCBlock,SVRBlockandSVMBlockSolutioncomponent descriptions, so that a data set can be written and a trained model read backdata/configs/SVMBlock, one per solver: the ad hocSMOSolver, a:MILPSolveron either formulation, aLagrangianDualSolveron the chunks andLIBSVMSolver, which hands the problem over to LIBSVMSupport Vector Machinesexample, which wraps SMS++ in a scikit-learn estimator and runs the two side by side on the same train/test split, the same folds and the same grid. Since scikit-learn trains its SVM with LIBSVM, and so does SMS++ throughLIBSVMSolver, the example also compares them withlibsvm-official: the same library called from Python and from C++, and it must give the same modelsvm_solveris not in the PATHThe splits of the cross-validation are specified down to the bit rather than being left to the shuffle of the standard library, so that a seed gives the same folds in SMS++ and in Python and the two cross-validations are actually comparable.
LIBSVMSolveris in SMS++ only when it has been built with LIBSVM, which is an optional dependency: the run that needs it is skipped otherwise.