Commit Graph

531 Commits

Author SHA1 Message Date
yanlend 9f8e062571 fix docs and doctests for KernelPCA 2015-10-23 08:57:30 +02:00
Peter Fischer 6cb51b2a28 Initialize ARPACK eigsh
`v0 = random_state.rand(M.shape[0])` leads to an initial residual vector in ARPACK which is all positive. However, this is not the absolute or squared residual, but a true difference. Thus, it is better to initialize with `v0=random_state.uniform(-1, 1, M.shape[0])` to have an equally distributed sign. This is the way that ARPACK initializes the residuals.
The effect of the previous initialization is that eigsh frequently does not converge to the correct eigenvalues, e.g. negative eigenvalues for s.p.d. matrix, which leads to an incorrect null-space.

- initialized all occurences of sklearn.utils.arpack.eigsh the same way it would be initialzed by ARPACK
- regression test to test behavior of new initialization
2015-10-23 08:57:30 +02:00
giorgiop f45f260ff7 DOC versionadded randomized_svd 2015-10-21 18:28:37 +02:00
Lars Buitinck 3697d755c4 MAINT/TST: public export of non_negative_factorization
Changed imports in test to separate testing of API and of internals.

See gh-5509.
2015-10-21 14:55:06 +02:00
Lars Buitinck 1eb9bed151 COSMIT nicer output from NMF with verbose > 0
Used to print "('violation:', 1.0)". Now "violation: 1.0".
2015-10-21 13:14:56 +02:00
giorgiop b18f2951e4 randomized_svd: power iter, normalization, benchmark 2015-10-21 11:21:40 +02:00
Raghav R V e3afc0e8c9 MAINT move custom error/warning classes into sklearn.exceptions
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
2015-10-19 22:35:35 +02:00
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Andreas Mueller 1b9e791d92 Merge pull request #5398 from rvraghav93/fix_for_numpy_10
[MRG + 2] FIX dtypes to conform to the stricter type cast rules of numpy 1.10
2015-10-15 12:45:43 -04:00
Raghav R V 4f4c3598e6 FIX dtypes to conform to the stricter type cast rules of numpy 1.10
FIX set copy to (copy & whiten).

FIX/DOC Use float outputs for doctest
2015-10-15 18:21:51 +02:00
Olivier Grisel 16fcb15351 ENH use explicit decimal keyword & PEP8 2015-10-15 13:51:11 +02:00
Olivier Grisel 6fe94b57f2 Merge pull request #4478 from amueller/fix_randomized_svd_transpose
[MRG] Fix randomized_svd transpose heuristic.
2015-10-15 13:39:46 +02:00
Andreas Mueller 838570cc8a Fixes #4455. 2015-10-13 17:44:36 -04:00
giorgiop 6a5a2f7960 partial_fit for scalers 2015-10-13 11:37:00 +02:00
Alexandre Gramfort 03eff3a545 Merge pull request #5336 from giorgiop/pca-warning
[MRG+1] remove numpy's RuntimeWarning from corner case of PCA.fit
2015-10-07 14:39:34 +02:00
Arthur Mensch a52053deef Fix sparse_encode input checks 2015-10-05 13:59:48 +02:00
Olivier Grisel 10259822fd Merge pull request #5337 from ogrisel/fix-coordinate-descent-memory-layout
[MRG+1] FIX consistency of memory layout for linear CD solver
2015-10-05 10:50:35 +02:00
Olivier Grisel 808fa6450e FIX consistency of memory layout for linear CD solver 2015-10-04 18:32:05 +02:00
giorgiop f5138ad16c remove numpy's RuntimeWarning from corner case of PCA.fit 2015-10-03 08:34:29 +02:00
Lars Buitinck 46edeec111 COSMIT some refactoring in NMF
* de-indent loop
* move regularization calculations out of loop
2015-10-02 00:07:01 +02:00
Lars Buitinck e7ecc4f976 BUG shuffle components, not samples in NMF CD 2015-09-30 21:45:03 +02:00
Gael Varoquaux 509bc04178 Merge pull request #5317 from hlin117/verbose-sparse-encode
[MRG+1] Verbosity in sparse_encode
2015-09-29 18:30:44 +02:00
Olivier Grisel d28a12efed Merge pull request #5303 from larsmans/faster-lda
[MRG + 1] optimize LDA, ~15% faster on one core
2015-09-28 13:31:49 +02:00
hlin117 46c0e85a85 #5309: Added verbosity argument to sparse_encode, verbosity for LassoLars and Lasso 2015-09-26 13:17:30 -05:00
Lars Buitinck 08460ebe5f ENH: optimize LDA, ~15% faster on one core 2015-09-23 16:46:15 +02:00
Gael Varoquaux 3c6ef92766 Merge pull request #5253 from ogrisel/online-lda-with-parallel-context-manager
[MRG+1] OPTIM make (Online) LDA reuse a joblib.Parallel instance
2015-09-23 16:43:31 +02:00
TomDLT ceeef70037 ENH refactor NMF and add CD solver 2015-09-21 11:42:07 +02:00
TomDLT 628ed2c867 ENH remove some warnings in test suit 2015-09-16 18:27:58 +02:00
Olivier Grisel 62ad838be0 OPTIM make (Online) LDA reuse a joblib.Parallel instance 2015-09-11 17:13:18 +02:00
Olivier Grisel 3b30958fa1 MAINT PEP8 / slightly faster tests in decomp LDA 2015-09-11 16:38:43 +02:00
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
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
2015-09-09 15:49:58 +02:00
Olivier Grisel 1529a1e548 MAINT enable multiprocessing + kmeans test on Python 3.4 2015-09-04 11:47:34 +02:00
Olivier Grisel 393d651e67 Merge pull request #5133 from arthurmensch/lasso_perf_checks
[MRG+1] Removing repeated input checking in Lasso and DictLearning
2015-08-20 16:12:48 +02:00
Arthur Mensch 2ed0c22c17 Added check_input in Lasso for DictLearning performance 2015-08-20 11:36:24 +02:00
Lars Buitinck a94689060b ENH: faster LatentDirichletAllocation (~15% on 20news) 2015-08-14 20:15:04 +02:00
Lars Buitinck 5908bcccde TST: LatentDirichletAllocation behavior on empty documents
Preparing for potential optimization of this estimator.
2015-08-14 18:49:35 +02:00
Chyi-Kwei Yau 26e47d7ab9 remove dirichlet_component_ variable 2015-08-13 21:57:14 -04:00
Buddha Prakash 4ac6a90a82 ENH: split LDA's n_iter_ into n_iter_ and n_batch_iter_
Fixes #5107.
2015-08-13 23:10:24 +02:00
Lars Buitinck e4df618956 ENH micro-optimize LatentDirichletAllocation + cosmetics
Main changes:
* Instead of checking the dimensionality of _log_dirichlet_expectation
  in a loop, just call the appropriate 1-d or 2-d version directly.
* Moved exp() call to Cython level.
* Reshuffled _update_doc_distribution inner loop to do fewer
  computations when stopping due to early convergence.
2015-08-12 09:28:16 +02:00
Lars Buitinck 28beb84c8c COSMIT pep8 online LDA 2015-08-09 19:28:32 +02:00
Lars a6c6e732c5 Merge pull request #3659 from chyikwei/onlineldavb
ENH Latent Dirichlet Allocation (LDA) with online variational Bayes
2015-08-09 19:13:01 +02:00
Arthur Mensch fead69a4ac Bugfix : type in cd changed for read only memmap compatibility 2015-07-31 12:12:40 +02:00
Olivier Grisel 71feb53bf6 FIX seed the initialization of NMF 2015-07-23 08:46:14 +02:00
Stephen Hoover a1d6bb1e2f DOC Fix doc for NMF `init` default
Docs had claimed that the `init` argument defaulted to "nndsvdar" when `n_components < n_features`, but it actually defaults to "nndsvd".

Resolves issue #4929 .
2015-07-11 10:47:29 -05:00
Chyi-Kwei Yau 0c485702f2 use logsumexp 2015-07-09 00:05:10 -04:00
Chyi-Kwei Yau 12859d9b17 improve document in _online_lda.pyx 2015-07-07 23:23:56 -04:00
Chyi-Kwei Yau 093088a964 change all rng to random_state 2015-06-25 16:32:46 -04:00
Chyi-Kwei Yau 567aa615d3 make dimension mismatch err msg more explicit 2015-06-25 16:24:37 -04:00
Chyi-Kwei Yau a1c3561ddf remove main in test 2015-06-25 15:34:15 -04:00
Chyi-Kwei Yau 36bb611a8f remove self.n_features_ 2015-06-25 15:28:37 -04:00