-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature: Add Support for PatchExtractor in Sklearn Serializer
Summary
Currently, the OpenModels sklearn serializer does not support the PatchExtractor transformer from scikit-learn. Attempting to serialize or deserialize a PatchExtractor instance results in a ValueError: not enough values to unpack (expected 3, got 2). This is likely due to the way the patch_size or related attributes are handled internally.
Motivation
- Completeness:
PatchExtractoris a useful transformer for image data and should be supported like other scikit-learn estimators. - User Experience: Users expect all standard scikit-learn transformers to be serializable/deserializable without errors.
- Consistency: The serializer should handle special cases or internal attribute structures that differ from typical estimators.
Error Details
- Error:
ValueError: not enough values to unpack (expected 3, got 2) - Context:
This error occurs when serializing or deserializing aPatchExtractorinstance, likely due to the structure of thepatch_sizeor related attributes.
References
Suggested Tasks
- Investigate the internal structure of
PatchExtractor, especially howpatch_sizeand related attributes are stored and restored. - Update the serializer to correctly handle the serialization and deserialization of
PatchExtractorparameters and fitted attributes. - Add tests to ensure that
PatchExtractorcan be round-tripped (serialized and deserialized) without errors. - Remove
"PatchExtractor"from theNOT_SUPPORTED_ESTIMATORSlist insklearn_serializer.pyonce support is complete.
Acceptance Criteria
PatchExtractorcan be serialized and deserialized without errors.- All relevant parameters and fitted attributes are preserved.
- Tests are added to cover typical usage of
PatchExtractor. "PatchExtractor"is no longer listed inNOT_SUPPORTED_ESTIMATORS.
Related file: openmodels/serializers/sklearn/sklearn_serializer.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Backlog