[scikit-learn] Which sparse matrix should be use for fit?

Guillaume Lemaître g.lemaitre58 at gmail.com
Wed Jan 29 04:59:30 EST 2020


if you could open an issue on GitHub, it would be great because this info
would be useful in the docstring.

On Wed, 29 Jan 2020 at 10:58, Guillaume Lemaître <g.lemaitre58 at gmail.com>
wrote:

> Looking at check_array in the SVR and SVC, we convert to CSR format if the
> sparse matrices are not from this format:
>
> https://github.com/scikit-learn/scikit-learn/blob/b194674c4/sklearn/svm/_base.py#L146
>
> Basically, this is more efficient because we are going to make operation
> which will get row.,
>
> In scikit-learn most predictor expect CSR apart of tree-based where CSC
> will be more efficient. CSC is also the format
> which is better for the preprocessing estimator (in general). Be aware
> that we are going to convert to the appropriate
> format if required.
>
> On Wed, 29 Jan 2020 at 02:54, Peng Yu <pengyu.ut at gmail.com> wrote:
>
>> https://scikit-learn.org/stable/modules/svm.html
>>
>> Of the svm classes mentioned above, which sparse matrixes are
>> appropriate to be used with them?
>>
>>
>> https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html#scipy.sparse.csr_matrix
>>
>> It is not very clear what matrix operations are used in fit(), so I
>> can not tell what sparse matrixes should be used. Thanks.
>>
>> --
>> Regards,
>> Peng
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>>
>
>
> --
> Guillaume Lemaitre
> Scikit-learn @ Inria Foundation
> https://glemaitre.github.io/
>


-- 
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20200129/5c779a42/attachment-0001.html>


More information about the scikit-learn mailing list