Feature/multiclass cli classify#377
Open
gbeane wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors src/jabs/scripts/classify.py to support both binary and multi-class behavior classification from the CLI, including training from exported HDF5 and classification using either training exports or serialized classifier pickles.
Changes:
- Added multi-class training detection and training path (
_is_multiclass_training_file,train_multiclass), and updated classification flow to acceptClassifier | MultiClassClassifier. - Updated prediction writing to support multi-class probability tensors and to use a dedicated multi-class prediction key.
- Improved CLI help text and type annotations across the script, plus added a new classifier pickle loading helper.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Base automatically changed from
feature/t13-multiclass-export
to
feature/multiclass
May 15, 2026 01:58
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.
This pull request significantly refactors and extends the
src/jabs/scripts/classify.pyscript to add robust support for multi-class classification in addition to binary classification. It introduces new helper functions for classifier loading and training, updates the main classification logic to handle both classifier types, and improves code clarity and type safety throughout. The changes also enhance user feedback and error handling, and update command-line argument parsing and documentation.Key changes include:
Multi-class Classification Support:
_is_multiclass_training_file,train_multiclass,_load_classifier_from_pickle) and updates to the main classification and training logic to handle both binary and multi-class cases. [1] [2] [3]Refactoring and Type Improvements:
Enhanced Classifier Loading and Error Handling:
Command-line Interface and Documentation:
Prediction Output and File Handling:
These changes collectively make the script more robust, extensible, and user-friendly for both binary and multi-class behavior classification tasks.