sklearn2pmml:将训练模型直接导出为PMML文件。
1、安装或更新sklearn:
pip install -U scikit-learn
2、安装sklearn-pandas:
pip install sklearn-pandas
3、安装sklearn2pmml:
pip install --user --upgrade git+https://github.com/jpmml/sklearn2pmml.git
4、检查安装是否成功:
import sklearn, sklearn.externals.joblib, sklearn_pandas, sklearn2pmml
print(sklearn.__version__)
print(sklearn.externals.joblib.__version__)
print(sklearn_pandas.__version__)
print(sklearn2pmml.__version__)
5、导出PMML文件
from sklearn2pmml import PMMLPipeline
from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
c