Hello again

I am trying to run an OneClassSVM() test:

/import/ sklearn.svm.sparse as sp_svm

ocsvm = sp_svm.OneClassSVM(nu=0.5, kernel='linear')

ocsvm.fit( ssp.csr_matrix(train_X, shape=train_X.shape, dtype=np.float64) )


 and I am getting the following message:

File "/home/dimitrios/Development_Workspace/webgenreidentification/src/experiments_lowbow.py", line 147, in evaluate ocsvm.fit( ssp.csr_matrix(train_X, shape=train_X.shape, dtype=np.float64) ) #, train_Y) File "/usr/local/lib/python2.6/dist-packages/sklearn/svm/sparse/classes.py", line 175, in fit
    X, [], sample_weight=sample_weight)
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 150, in fit
    fit(X, y, sample_weight)
File "/usr/local/lib/python2.6/dist-packages/sklearn/svm/base.py", line 263, in _sparse_fit
    % (X.shape, y.shape))
ValueError: X and y have incompatible shapes: (180, 255) vs (0,)
Note: Sparse matrices cannot be indexed w/boolean masks (use `indices=True` in CV).

I have used this OneClassSVM() in a previous work from sklearn and it was working fine.

I cannot tell from the Documentation the reason I am getting such a message. And I cannot tell what CV is for using `indices=True`

Regards,

Dimitrios
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to