Sklearn 错误:“SVR"对象没有属性“_impl" [英] Sklearn error: 'SVR' object has no attribute '_impl'

查看:53
本文介绍了Sklearn 错误:“SVR"对象没有属性“_impl"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做什么:我正在尝试使用在另一台机器上构建的测试(腌制)SVM 回归模型来预测数据.缩放效果很好,但即使尝试基于原始学习样本进行预测也会失败并出现相同的错误.

What I'm doing: I am trying to forecast data using a tested (pickled) SVM regression model that was built on another machine. The scaling works fine, but even trying to forecast based on the original learning sample fails with the same error.

'SVR' 对象没有属性 '_impl'

'SVR' object has no attribute '_impl'

错误发生在装有 Python 2.7.5、Numpy 1.7.1 (MKL) 和 sklearn (scikit-learn 0.14.1) 的 WIN 7 64 位工作站上.两者都是 64 位.

The error occurs on a WIN 7 64bit workstation with Python 2.7.5, Numpy 1.7.1 (MKL) and sklearn (scikit-learn 0.14.1). Both are 64bit.

下面是代码.它在负责学习的机器上工作.

Below is the code. And it worked on the machine that did the learning bit.

from sklearn.svm import SVR
from sklearn import preprocessing
import cPickle as cp
import numpy as np
model = cp.load(open('model.pkl', 'rb'))
scaler = cp.load(open('scaler.pkl', 'rb'))
theData = np.genfromtxt(open('inputData.csv','rb'), delimiter=',')
scaledXs = scaler.transform( theData )
result = model.predict( scaledXs )

编辑 2:仅供参考:学习部分是在使用 0.13.1 版本的 piCloud 上完成的.这可能是问题吗?

EDIT 2: FYI: The learning part was done on piCloud which uses the 0.13.1 version. Could that be the issue?

推荐答案

我终于想通了.看来使用 sklearn 0.13.1 在 piCloud 上生成的模型与 0.14.1 库不兼容

由于找不到 AMD64 0.13.1 二进制文件,我最终在新机器上使用 0.14.1 库重新学习了模型,现在可以正常工作了.我还尝试在具有 0.13.1 库的机器上运行旧模型,并且运行良好.

Since the AMD64 0.13.1 binary is nowhere to be found, I ended up re-learning the model using the 0.14.1 library on the new machine, and it now works fine. I also tried running the old model on the a machine that had the 0.13.1 library and it worked fine.

这篇关于Sklearn 错误:“SVR"对象没有属性“_impl"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆