Part of #11992.
These were all the things that seemed pretty straight-forward. It's actually a bit bulky but should still be easy to review, hopefully.
* ENH Ensure randomized_svd_low_rank doesn't upcast float to double
* ENH ensure PCA does not upcase f32 to f64; (int is upcast to f32)
* ENH ensure that when input is of type int, the output is float32/64
* ENH prefer float64 over float32; Use float64 for int inputs
* Make sure int types are upcasted to float64; Address Olivier's comments
* FIX check only for 4 decimals when dtype is float32
* Fix spurious line removal
* FIX unstable cumsum in utils.random
* equal_nan = true for isclose
since numpy < 1.9 sum is as unstable as cumsum, fallback to np.cumsum
* added axis parameter to stable_cumsum
* FIX unstable sumsum in ensemble.weight_boosting and utils.stats
* FIX axis problem in stable_cumsum
* FIX unstable cumsum in mixture.gmm and mixture.dpgmm
* FIX unstable cumsum in cluster.k_means_, decomposition.pca, and manifold.locally_linear
* FIX unstable sumsum in dataset.samples_generator
* added docstring for parameter axis of stable_cumsum
* added comment for why fall back to np.cumsum when np version < 1.9
* remove unneeded stable_cumsum
* added stable_cumsum's axis testing
* FIX numpy docstring for make_sparse_spd_matrix
* change stable_cumsum from error to warning
ENH NonBLASDotWarning -> EfficiencyWarning; Improve error message
DOC Add exceptions module to modules/classes.rst
MAINT Move ConvergenceWarning, UndefinedMetricWarning et al into exceptions
MAINT Remove ChangedBehaviorWarning from base
DOC/FIX Improve DataConversionWarning's docstring
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.
All Scaler classes also throw warnings when 1D arrays are passed.
All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.
Additional tests are also included which check for different 1D array cases.
2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message