scikit-learn/scikit-learn — pull request #3041 by eickenberg (2014-04-04 18:37:59+00:00)
Title: [BUG?] safe_asarray fails for dok_matrix and lil_matrix

safe_asarray doesn't like dok_matrix or lil_matrix, because dok_matrix does not expose .data and lil_matrix exposes .data weirdly (array of dtype object, list of not necessarily equally sized lists).

Does this need to be worked around in sklearn or should part of it, e.g. setting dok_matrix.data = dok_matrix.values, be asked for in scipy?

If we work around in sklearn, what would the desired output matrix be? Same type or cast to, say, coo_matrix?