jpmml/sklearn2pmml
Python library for converting Scikit-Learn pipelines to PMML
What it solves
SkLearn2PMML addresses the lack of portability in native Scikit-Learn estimators. Because Scikit-Learn models often lack adequate metadata (such as feature names), they are difficult to move between different environments. This tool allows users to convert Scikit-Learn pipelines into the Predictive Model Markup Language (PMML) format, enabling them to be deployed in diverse environments regardless of the original training platform.
How it works
The package acts as a Python wrapper for the JPMML-SkLearn library. It can convert fitted estimator objects or pickle files directly into PMML files using a utility function or a command-line interface.
To enhance portability and functionality, it provides PMMLPipeline, a meta-estimator that extends the standard Scikit-Learn pipeline. This extension allows for:
- Metadata Collection: Automatically capturing feature and label names during the
fitprocess. - Post-processing: Applying transformations to predictions via specific transformer attributes.
- ** lemmas ** Model Verification: Embedding sample data within the model for self-checking during deployment.
- Customization: Modifying the PMML XML fragments directly.
Additionally, the library provides specialized PMML-oriented transformers and predictors (e.g., ExpressionTransformer, CategoricalDomain, and GBDTLRClassifier) to handle complex data types and ensemble methods.
Who it’s for
Data scientists and ML engineers who use Scikit-Learn to build models but need to deploy them in environments that require PMML for interoperability and portability.
Highlights
- Broad Compatibility: Works with Scikit-Learn versions 0.17 and newer.
- Safe Unpickling: Uses a custom Java component to read pickle files, making it safer to use with unvetted files.
- Enhanced Metadata: Captures feature and target names to ensure models are self-describing.
- Flexible Deployment: Supports both a Python library API and a standalone command-line tool.
Related
- Project
- Project
- Project
- Project
- Project