You can use PyPMML to apply PMML in Python, for example:
from pypmml import Model
model = Model.fromFile('the/pmml/file/path')
result = model.predict(data)
Data can be dict, json, Series or DataFrame of Pandas.
If you use PMML in PySpark, you can use PyPMML-Spark , for example:
from pypmml_spark import ScoreModel
model = ScoreModel.fromFile('the/pmml/file/path')
score_df = model.transform(df)
df is the PySpark data frame.
For more information about other PMML libraries, be free to see: https://github.com/autodeployai
source
share