Thanks guys, for the detailed explanation. It is clear to me now.
But, just to clarify the original problem, the results (f1 etc.) from
X.todense() and X.toarray() are the same, which all differ from X
(scipy.sparse).
Cheers.
On 17 November 2011 16:33, Olivier Grisel <[email protected]> wrote:
> 2011/11/17 Lars Buitinck <[email protected]>:
> > 2011/11/16 Olivier Grisel <[email protected]>:
> >> You should never use dense matrices: either scipy.sparse or numpy
> >> arrays. For text data, you should probably stick to estimators that
> >> work on scipy.sparse input.
> >
> > In the current release.
> >
> >> Always use X.toarray() if you really need to materialize a dense
> >> representation of a sparse dataset. X.todense() is a trap.
> >
> > The next release will add support for samples in np.matrix objects,
> though.
>
> Even if scikit-learn will be less broken w.r.t. np.matrix object I
> would still advise anybody not to use the np.matrix datastructure as
> it's API is often more misleading than helpful.
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general