Skip to content

Enhance SimpleSVM wrapper to support model loading and saving #8558

Closed

Description

@coderabbitai

Context

In PR #8557, we attempted to make LibSVM a private dependency. However, svm_model is currently exposed in the public header FeatureFindingMetabo.h, which prevents LibSVM from being made private.

Discussion: #8557 (comment)

Proposed Solution

Refactor FeatureFindingMetabo to use the SimpleSVM wrapper instead of directly using LibSVM types. This requires enhancing SimpleSVM to support model serialization and deserialization.

Required SimpleSVM Enhancements

Currently, SimpleSVM only supports:

  • Training new models via setup()
  • Prediction with probability estimates via predict()

FeatureFindingMetabo needs:

  • Loading pre-trained SVM models from files
  • Prediction without probability estimates (or confirmation that existing API supports this)
  • Proper model lifecycle management

Expected Outcome

Once SimpleSVM supports model loading/saving, FeatureFindingMetabo can be refactored to use it, properly encapsulating LibSVM and allowing it to become a private dependency as intended in PR #8557.


Requested by: @jpfeuffer
Related PR: #8557

Activity

  1. added
    beginner tasks
    on Dec 27, 2025
  2. VaishnaviOnPC commented on Jan 11, 2026

    @VaishnaviOnPC

    Hi @jpfeuffer , I am interested in this issues.

    I’m planning to work on this by first extending SimpleSVM with model load/save support and clarifying prediction without probabilities, so that FeatureFindingMetabo no longer needs to expose svm_model.
    Then FeatureFindingMetabo can be refactored to use SimpleSVM, which should allow LibSVM to become a private dependency.

    Happy to adjust the approach if there are preferred patterns or conventions I should follow.

  3. jpfeuffer commented on Jan 11, 2026

    @jpfeuffer
    Contributor

    Sure. You might need to check multiple times along the way if this approach is the right one.
    It sounds reasonable.

  4. jpfeuffer commented on Jan 11, 2026

    @jpfeuffer
    Contributor

    Sure. You might need to check multiple times along the way if this approach is the right one.
    It sounds reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Hacktoberfestbeginner tasks

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions