sklearn2pmml
Python library for converting Scikit-Learn pipelines to PMML
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need to export scikit-learn models to PMML for deployment outside Python and can accept the AGPL license terms. The package is actively maintained, has low install friction, and carries no known vulnerabilities. Do not install if your project is proprietary or closed-source without explicit AGPL compliance, or if Java 11 or newer is not available on your deployment system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Java 11 or newer must be installed and available on the system PATH.
- Low friction: pure Python wheel with four common runtime dependencies (dill, joblib, pandas, scikit-learn).
- Requires Java 11 or newer on the system path; this is the only non-Python prerequisite.
License · maintenance · safety
(agpl) — Licensed under GNU Affero General Public License (AGPL) version 3.0. Use is restricted to projects that can comply with copyleft obligations—derivative works and distributed modifications must be released under the same license. Not suitable for proprietary or closed-source applications without explicit permission.
last release 2026-06-30 (45 days) · last repo commit 2026-06-30 · 702 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 452,877 downloads/mo, #6,579 on PyPI
Alternatives
Verify before relying
pip install sklearn2pmml
from sklearn2pmml import sklearn2pmml
import joblib
estimator = joblib.load("model.pkl")
sklearn2pmml(estimator, "model.pmml")- Whether all scikit-learn versions from 0.17 onward are truly compatible with a single package version.
- Performance overhead of Java-based pickle deserialization versus native Python unpickler for large models.
- Scope and completeness of supported estimator classes beyond the reference to JPMML-SkLearn features.
What it is and what it does
sklearn2pmml is a Python wrapper around the JPMML-SkLearn Java library that converts trained estimators and pipelines into PMML, an XML-based standard for representing machine learning models. It works with native estimators as-is, and also provides a PMMLPipeline class that captures feature metadata, enables prediction post-processing, embeds verification data, and allows fine-grained PMML customization. The package includes a command-line interface and a library API, plus additional transformer and predictor classes for domain specification, feature engineering, and model combination.
The main use case is exporting trained models from Python for deployment in other systems that consume PMML. It handles pickling safely using a custom Java component rather than Python's built-in unpickler, making it suitable for untrusted pickle files. Runtime dependencies are standard (scikit-learn, pandas, joblib, dill), but Java 11 or newer must be present on the system.
Use it for
- Export a trained estimator to PMML for deployment in a non-Python scoring engine or business rules platform.
- Preserve feature names and metadata in PMML when working with older scikit-learn versions that lack feature tracking.
- Add prediction post-processing, verification data, and custom PMML edits to a pipeline before export using PMMLPipeline.
- Convert pickled estimators from disk to PMML via the command-line interface without writing Python code.
- Safely deserialize untrusted pickle files using sklearn2pmml's Java-based unpickler instead of Python's native pickle module.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need to export scikit-learn models to PMML for deployment outside Python and can accept the AGPL license terms. The package is actively maintained, has low install friction, and carries no known vulnerabilities. Do not install if your project is proprietary or closed-source without explicit AGPL compliance, or if Java 11 or newer is not available on your deployment system.
Install
sklearn2pmml on PyPI
Before you install
Low friction: pure Python wheel with four common runtime dependencies (dill, joblib, pandas, scikit-learn). Requires Java 11 or newer on the system path; this is the only non-Python prerequisite. Package is actively maintained with a recent release.
Java 11 or newer must be installed and available on the system PATH.
License in practice
Licensed under GNU Affero General Public License (AGPL) version 3.0. Use is restricted to projects that can comply with copyleft obligations—derivative works and distributed modifications must be released under the same license. Not suitable for proprietary or closed-source applications without explicit permission.
Quickstart
pip install sklearn2pmml
from sklearn2pmml import sklearn2pmml
import joblib
estimator = joblib.load("model.pkl")
sklearn2pmml(estimator, "model.pmml")
Verify before relying
- Whether all scikit-learn versions from 0.17 onward are truly compatible with a single package version.
- Performance overhead of Java-based pickle deserialization versus native Python unpickler for large models.
- Scope and completeness of supported estimator classes beyond the reference to JPMML-SkLearn features.
Package facts
| License | Not declared agpl |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesdilljoblibpandasscikit-learn |
| Maintenance | Actively maintained 45 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 452,877 / month, #6,579 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonTopic :: Scientific/EngineeringTopic :: Software Development |
Evidence: sklearn2pmml-0.132.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “scikit-learn to PMML conversion”
- sklearn2pmmlConverts fitted Scikit-Learn pipelines to PMML (Predictive Model…
- skl2onnxConverts trained scikit-learn models to ONNX format for deployment…
- onnxconverter-commonProvides common utilities and functions for converting machine…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also azureml-train-core · onnxmltools · mleap · sklearndf · fair-esm · sklearn-compat · skops · spark-sklearn · azureml-pipeline · dask-ml