2014-03-18 20:09 GMT+01:00 Olivier Grisel <[email protected]>:
>
> BLAS functions only work for contiguous (dense) arrays. You will need
> scipy sparse equivalent functions to work with CSR or CSC
> datastructures. For instance the `nrm2` function could be emulated by:
>
> row_norms = csr_row_norms(X.tocsc())
> row_norms **= 2
> norm = np.sqrt(np.sum(row_norms))

Actually I am stupid, you can just call nrm2(X.data) directly in this case.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

------------------------------------------------------------------------------
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

Reply via email to