scikit-learn/scikit-learn — pull request #3622 by untom (2014-09-02 10:25:27+00:00)
Title: ENH Add 'axis' argument to sparsefuncs.mean_variance_axis

This PR adds an 'axis' argument to sparsefuncs.mean_variance_axis, making it easier to calculate the columnwise mean/variance of sparse matrices.

While switching the codebase over to the new functionality, I noticed that `VarianceThreshold` needlessly converted CSC matrices to CSR. This PR also includes a commit to fix this, as the change fits naturally with the other changes.

(If the immediate need for the new functionality is not obvious: This PR is the first in a series that tries to split up #2514 into a few smaller, easy-to-digest PRs. I plan to commit other PRs that will make use of this one)