ray.data.preprocessors.StandardScaler.serialize#
- StandardScaler.serialize() str | bytes#
Serialize this preprocessor to a string or bytes.
⚠️ DO NOT OVERRIDE THIS METHOD IN SUBCLASSES ⚠️
This method is marked as
@finalin the concrete implementation and handles the complete serialization orchestration. Subclasses should implement the abstract methods instead:_get_serializable_fields()and_get_stats().Serialization Process:
Extracts fields via
_get_serializable_fields()Extracts statistics via
_get_stats()Packages data with metadata (type, version, format)
Delegates to
SerializationHandlerFactoryfor format-specific handlingReturns serialized data with magic bytes for format identification
Supported Formats:
CloudPickle (default):
Pickle (legacy): Backward compatibility for existing serialized data
- Returns:
Serialized preprocessor data (bytes for CloudPickle, str for legacy Pickle)
- Raises:
ValueError – If the serialization format is invalid or unsupported
DeveloperAPI: This API may change across minor Ray releases.