An open-source library that extends scikit-learn functionalities, specifically designed for use with Amazon SageMaker. It provides robust encoders, time series feature extractors, and other transformers to streamline machine learning workflows on SageMaker. The current version is 2.5.0, with regular updates typically released every few months, focusing on new features and bug fixes.
pip install sagemaker-scikit-learn-extensionVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `RobustOrdinalEncoder` to encode categorical data. It handles unknown categories by mapping them to a specified value, preventing errors that might occur with standard ordinal encoders when encountering new data. The example shows fitting and transforming a Pandas DataFrame column.
Ensure your environment has `scikit-learn` and `mlio` installed within the specified version ranges. Upgrade them if necessary: `pip install 'scikit-learn>=0.23,<1.2' 'mlio>=0.5,<0.6'`.
Always use named functions instead of anonymous lambda functions when defining custom logic within estimators that need to be serialized (e.g., using `pickle` for model deployment).
Be aware of this limitation when deploying models using `TSFreshExtractor` to SageMaker inference endpoints. Optimize input data or pre-compute features if latency becomes an issue in `sagemaker_serve` environments.
Pin your `tsfresh` dependency to the required range: `pip install 'tsfresh>=0.17.0,<0.18.0'`.