Closed
Description
import sklearn.svm
import numpy as np
import copy
c = sklearn.svm.LinearSVC()
c.fit(np.random.random((10, 2)), np.random.randint(0, 2, size=10))
print c.predict(np.random.random(2))
copy.deepcopy(c).predict(np.random.random(2))
Produces
[1]
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File "/usr/local/lib/python2.7/site-packages/scikit_learn-0.11_git-py2.7-linux-i686.egg/sklearn/svm/base.py", line 764, in predict
self.label_, self._get_bias())
File "liblinear.pyx", line 212, in sklearn.svm.liblinear.predict_wrap (sklearn/svm/liblinear.c:3624)
ValueError: ndarray is not Fortran contiguous
Somewhere in the copy the fortran raw_coef_ is made c contiguous.
Metadata
Metadata
Assignees
Labels
No labels