Skip to content

Feature/hmm export testset#15

Merged
gchindemi merged 3 commits intoBelloneLab:mainfrom
ChataingT:feature/hmm_export_testset
May 1, 2025
Merged

Feature/hmm export testset#15
gchindemi merged 3 commits intoBelloneLab:mainfrom
ChataingT:feature/hmm_export_testset

Conversation

@ChataingT
Copy link
Copy Markdown
Collaborator

In regard to the ISSUE #14.
Here is a proposition to solve it.
The solution take part in the "betman segment_motifs" feature :

  • A boolean to save the hmm model
  • An input path for a testing dataset that will be used only in hmm.predict()

@gchindemi
Copy link
Copy Markdown
Member

gchindemi commented Apr 28, 2025

Thank you for the contribution! I think the proposed solution can be further improved.

First, there is a minor bug: test_predictions is computed but not returned.

Second, the logic could be adapted to better support labeling the test set using a pre-trained model, as proposed in #14. To achieve this, I suggest modifying the function signature to allow the user to specify the path to a pre-trained model, and drop the test set component. That is, if the user wants to label another dataset (e.g., a test set) using a previously fitted model, they can simply specify the path of such model and call the segment_hmm function as usual.

Additionally, it would be important to clearly warn users that any HMM configuration parameters (e.g., num_states) will be ignored when loading a pre-trained model. A log message should be more than enough.

@gchindemi gchindemi linked an issue Apr 30, 2025 that may be closed by this pull request
@gchindemi gchindemi merged commit a57a5ad into BelloneLab:main May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export HMM model and use of validation test with the HMM.

2 participants