How do you handle Scenario 2 here?

Since you need to replace (implicitly stored) zero values by (explicitly stored) imputed values, the sparsity structure of the matrix is changed. I don't really see how your code handles that.

In my gist (https://gist.github.com/mblondel/6047628#file-imputer-py-L62), I convert X to a dense array upfront, since the output of transform in Scenario 2 is expected to be dense. Of course, the user should do transform(X[subset]) for very large sparse matrices.