{"library":"sklearn2pmml","title":"Scikit-Learn to PMML Converter","description":"sklearn2pmml is a Python library designed for converting Scikit-Learn pipelines and estimators into the Predictive Model Markup Language (PMML) format. It acts as a thin Python wrapper around the JPMML-SkLearn Java library, enabling the export of trained machine learning models for deployment in environments that support PMML. The current version is 0.130.0, released on April 4, 2026, and the library is actively maintained.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install sklearn2pmml"],"cli":null},"imports":["from sklearn2pmml.pipeline import PMMLPipeline","from sklearn2pmml import sklearn2pmml"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pandas as pd\nfrom sklearn.datasets import load_iris\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn2pmml.pipeline import PMMLPipeline\nfrom sklearn2pmml import sklearn2pmml\n\n# Load a sample dataset\niris = load_iris(as_frame=True)\nX, y = iris.data, iris.target\n\n# Create a PMMLPipeline (extends sklearn.pipeline.Pipeline)\npmml_pipeline = PMMLPipeline([\n    ('classifier', DecisionTreeClassifier())\n])\n\n# Fit the pipeline\npmml_pipeline.fit(X, y)\n\n# Convert the fitted pipeline to PMML\npmml_filepath = 'DecisionTreeIris.pmml'\nsklearn2pmml(pmml_pipeline, pmml_filepath)\n\nprint(f\"PMML model successfully exported to {pmml_filepath}\")","lang":"python","description":"This quickstart demonstrates how to create a Scikit-Learn pipeline, wrap it with `PMMLPipeline`, fit the model, and then export it to a PMML file using the `sklearn2pmml()` function. The `PMMLPipeline` class enhances the standard Scikit-Learn pipeline with PMML-specific functionalities like capturing feature names from Pandas DataFrames.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.130.0","pypi_latest":"0.130.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":13.5,"avg_import_s":4.06,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sklearn2pmml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sklearn2pmml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":13.2,"import_time_s":2.67,"mem_mb":71.9,"disk_size":"351M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sklearn2pmml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sklearn2pmml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":12.5,"import_time_s":4.68,"mem_mb":86.4,"disk_size":"373M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sklearn2pmml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sklearn2pmml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":13.4,"import_time_s":5.26,"mem_mb":84.8,"disk_size":"354M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sklearn2pmml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sklearn2pmml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":13.3,"import_time_s":4.66,"mem_mb":83.9,"disk_size":"352M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sklearn2pmml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sklearn2pmml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":14.9,"import_time_s":3.03,"mem_mb":68.9,"disk_size":"366M"}]}}