Hi,
I am trying to use sparse document classification example from below link
(pasted at the end) and got an error that seemed to have recurred in the
past (though for not this example)
>>>
Extracting features from the dataset using a sparse vectorizer
Traceback (most recent call last):
File "tclassfier.py", line 36, in <module>
for f in news_train.filenames))
File
"/home/ag68/.local/lib/python2.6/site-packages/scikit_learn-0.14.1-py2.6-linux-x86_64.egg/sklearn/feature_extraction/text.py",
line 1223, in fit_transform
return self._tfidf.transform(X, copy=False)
File
"/home/ag68/.local/lib/python2.6/site-packages/scikit_learn-0.14.1-py2.6-linux-x86_64.egg/sklearn/feature_extraction/text.py",
line 995, in transform
X = normalize(X, norm=self.norm, copy=False)
File
"/home/ag68/.local/lib/python2.6/site-packages/scikit_learn-0.14.1-py2.6-linux-x86_64.egg/sklearn/preprocessing/data.py",
line 445, in normalize
inplace_csr_row_normalize_l2(X)
File "sparsefuncs.pyx", line 117, in
sklearn.utils.sparsefuncs.inplace_csr_row_normalize_l2
(sklearn/utils/sparsefuncs.c:2328)
ValueError: Buffer dtype mismatch, expected 'int' but got 'long'
<<<
My specs are :
scikit-learn 0.14.1
linux - Red Hat x86_64 GNU/Linux
python 2.6.6
numpy 1.8.0
scipy 0.14.0b1
Also a newbie. Would be nice if someone can suggest a quick fix or point to
the mistake if any.
http://scikit-learn.org/stable/auto_examples/mlcomp_sparse_document_classification.html#example-mlcomp-sparse-document-classification-py
--Anitha
------------------------------------------------------------------------------
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