Applying PMML prediction model in python

Kime created the PMML for me . At this time, I want to apply this model to a python process. What is the right way to do this?

In more detail: I developed a django student attendance system . The application is already so ripe that I have time to implement the "I'm Lucky" button to automatically fill out the participation form. Here is the PMML. KimeMe introduces a PMML model that predicts student attendance. Also, thanks to django for being so productive that I have time for this great work;)

enter image description here

+6
source share
3 answers
+2

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

+1
source

All Articles