On Sun, Mar 23, 2014 at 6:05 AM, Anitha Gollamudi <[email protected]> wrote:
>
> OK. I misunderstood the documentation when it said the classifiers can
> work with CSR matrices. I have assumed feature_extraction as not
> important and so did not implement in this case. The input is the
> libSVM format multi-label and multi-class data. I have loaded using
> load_svmlight_file and fed the data to classifier. Clearly, this looks
> incorrect.
>
I guess you have loaded your train and test files separately by calling
load_svmlight_file twice. In that case, you need to explicitly pass
n_features=X_train.shape[1] as an argument to load_svmlight_file when
loading the test file. You can also use load_svmlight_files for loading
both files simultaneously. In that case, this will take care of adjusting
n_features for you.
Mathieu
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general