我无法预测加载的 PMML 模型

问题描述

我正在尝试导出 ML 模型(具体来说,是经过训练的 svm 模型)。我使用以下命令导出它:

pipeline = PMMLPipeline([("classifier",svm)])

然后我保存它

from sklearn2pmml import sklearn2pmml

sklearn2pmml(pipeline,"svm.pmml")

我想再次加载它并在测试集上进行测试

from pypmml import Model

model = Model.fromFile('svm.pmml')

Y_pred = model.predict(X_test)
print(Y_pred)

这就是结果

/usr/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode,the default buffer size will be used
  self.stdout = io.open(c2pread,'rb',bufsize)
/usr/lib/python3.8/subprocess.py:849: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode,the default buffer size will be used
  self.stderr = io.open(errread,bufsize)
   predicted_y probability probability_0 probability_1
0         None        None          None          None
1         None        None          None          None
2         None        None          None          None
3         None        None          None          None
4         None        None          None          None

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)