scikit-learn/scikit-learn — pull request #3094 by msalahi (2014-04-21 05:02:57+00:00)
Title: modified check_arrays to handle multiple sparse formats

on pull request #3076, [it was proposed](https://github.com/scikit-learn/scikit-learn/pull/3076#issuecomment-40739707) we extend the functionality of `sklearn.utils.validation.check_arrays(...)` to allow for multiple sparse formats. for example:

`check_arrays(*arrays, sparse_format=['csc', 'csr'])`

i did my best to make sure my implementation's compatible with both string arguements (`sparse_format='csc'`) and collections (`sparse_format=['csc', 'csr']`). wasn't quite sure what to do in the case of something like...

`check_arrays(*arrays, sparse_format=['csc', 'dense'])`

...where both sparse and dense formats are listed. i assumed the most intuitive way to read that was to say "csc and dense arrays are allowed," and attempted to get the code to behave accordingly.

i could definitely use a watchful eye on this one, as check_arrays is used everywhere.