3
我跑了网格搜索分类从下面的IPython:问题序列化我scikit学习(sklearn)网格搜索分类中的IPython
http://scikit-learn.org/dev/auto_examples/grid_search_digits.html
,然后试图通过酸洗序列化,但收到以下回溯:
In [6]: with open('clf.pkl', 'wb') as f:
cPickle.dump(clf, f)
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-577559be619c> in <module>()
1 with open('clf.pkl', 'wb') as f:
----> 2 cPickle.dump(clf, f)
3
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/copy_reg.pyc in _reduce_ex(self, proto)
68 else:
69 if base is self.__class__:
---> 70 raise TypeError, "can't pickle %s objects" % base.__name__
71 state = base(self)
72 args = (self.__class__, base, state)
TypeError: can't pickle instancemethod objects
是否有解决方法?
我正在使用iPython和sklearn的最新测试版。
谢谢:)
你能编辑你的问题,告诉sklearn类的确切名称,你试图泡菜只要完整的追溯? – ogrisel 2012-08-17 10:37:40