Dimitrios,

please provide an example script so that we can reproduce the error.

BTW: gist [1] is a handy tool to distribute scripts.

[1] https://gist.github.com/

best,
 Peter

2012/3/27 Dimitrios Pritsos <[email protected]>:
>
> Hello,
>
> While I am  svm.sparse.SVC with a scipy.sparse.csr_matrix the following
> error occurs:
>
>   File
> "/home/dimitrios/Development_Workspace/webgenreidentification/src/experiments_lowbow.py",
> line 115, in evaluate
>     csvm.fit(train_X, train_Y)
>   File "/usr/local/lib/python2.6/dist-packages/sklearn/svm/sparse/base.py",
> line 22, in fit
>     return super(SparseBaseLibSVM, self).fit(X, y, sample_weight)
>   File "/usr/local/lib/python2.6/dist-packages/sklearn/svm/base.py", line
> 145, in fit
>     fit(X, y, sample_weight)
>   File "/usr/local/lib/python2.6/dist-packages/sklearn/svm/base.py", line
> 294, in _sparse_fit
>     int(self.shrinking), int(self.probability))
>   File "libsvm_sparse.pyx", line 158, in
> sklearn.svm.libsvm_sparse.libsvm_sparse_train (svm/libsvm_sparse.c:1927)
>   File "/usr/lib/python2.6/dist-packages/scipy/sparse/compressed.py", line
> 75, in __init__
>     self.shape = shape   # spmatrix will check for errors
>   File "/usr/lib/python2.6/dist-packages/scipy/sparse/base.py", line 71, in
> set_shape
>     raise ValueError('invalid shape')
> ValueError: invalid shape
>
> However, the .shape of my matrix Train_X is 18 x 7500 and the is
> scipy.sparse.isspmatrix_csr( train_X ) is TRUE. The Train_Y is a list of 18
> int objects.
>
> So, what might be the problem?
>
> I am fighting with this for few hours but I cannot find the cause of this
> error.
>
> Regards,
>
> Dimitrios
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>



-- 
Peter Prettenhofer

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to