Commit Graph

556 Commits

Author SHA1 Message Date
hlin117 e5c366f77f Merge PR #6037: copy_X in KernelPCA
Ensuring consistent transforms for KernelPCA

Taking @vene's changes into account, thanks!

Taking @jakevdp's comment into account

Added more verbose documentation to kernel_pca.py

Specifying that X_fit_ will not be None. @jakevdp

KernelPCA: Fixing more formatting of docstring

Addressed @vene's documentation comments

Addressing that dual_coef_ might not be present in model in docs. @vene
2016-03-24 19:01:10 -04:00
giorgiop 328ebfa865 ENH RandomizedPCA collapsed into PCA 2016-03-11 09:10:37 +11:00
Lars Buitinck 2e4aafd19c MAINT remove my email address
I'm getting too many individual support requests. People should
use the mailing list.
2016-03-04 10:43:41 +01:00
MechCoder f5025c3881 Correct PCA and RandomizedPCA docs related to whitening 2016-02-24 18:27:57 -05:00
Lars 7cd041905b Merge pull request #6327 from yenchenlin1994/fix-lda-transform-output-probability
BUG: Normalize LDA transform's return value (fixes #6320)
2016-02-13 18:28:03 +01:00
Gael Varoquaux 6b1d35178d Merge pull request #6125 from AnishShah/issue6118
[MRG + 2] inverse_transformation for NMF decomposition
2016-02-12 23:41:21 +01:00
Anish Shah a6604c3c1d inverse_transformation for NMF decomposition 2016-02-11 23:30:10 +05:30
ldavid dd85a67211 Add parallelism to multiple algorithms
Update kneighbors_graph()

   Add n_job attribute.

 Update Isomap

   Add n_job attribute to Isomap.__init__ method.

 Conform isomap.py to pep8.

 Conform graph.py to pep8.

 Update dbscan_.py

    Add n_jobs parameter to dbscan function and DBSCAN.__init__ method.
    Refactor DBSCAN.__init__ documentation.

 Update mean_shift_.py

    Add n_jobs parameter to estimate_bandwidth function.
    Propagate existing n_jobs parameter in mean_shift to estimate_bandwidth and NearestNeighbors.

 Conform mean_shift_.py to pep8.

 Conform locally_linear.py to pep8.

 Add n_jobs parameter to SpectralClustering.__init__ method.

 Add n_jobs parameter to SpectralEmbedding.__init__ method.

 Update usage of barycenter_kneighbors_graph function.

 Conform spectral_embedding_.py to pep8.

 Update label_propagation.py

    Conform to pep8.
    Refactor imports.
    Add n_jobs parameter to LabelSpreading.__init__ method.

 Update dbscan function call.

    Remove n_jobs argument from dbscan call, as it is already being given by self.get_params().

 Add n_jobs parameter to KernelPCA.__init__ method.

 Update KernelPCA construction in Isomap.
 Remove unnecessary parentesis in isomap.py:211,29.

Update docs: pipeline.rst

Revert "Fix n_jobs usage"

This reverts commit 9480630a69bbb68b01d1176d476222fc665cdd1e.

Fix usage of n_jobs property in Isomap
2016-02-11 15:44:25 -02:00
YenChenLin f393f59d3a Normalize LDA transform's return value 2016-02-11 00:23:13 +08:00
Chyi-Kwei Yau 856424a2bc fix joblib error in LatentDirichletAllocation 2016-02-09 17:38:32 -05:00
YenChenLin 0a3eaf5460 Fix typo in parameter's doc 2016-02-02 20:17:31 +08:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Yaroslav Halchenko 625471bb29 DOC: few minor typos spotted 2015-12-15 20:56:34 -05:00
seales fe4dbe353c Fix Kernel PCA docstring to reflect how remove_zero_eig defaults to false 2015-12-07 17:57:03 -08:00
Tom Dupré la Tour f0f564640b Merge pull request #5892 from mth4saurabh/add-user-guide-link-to-lda
[MRG+1] Add user guide link to lda
2015-11-26 14:05:28 +01:00
saurabh.bansod 79c7583285 Add user guide link to lda 2015-11-21 04:58:17 +05:30
Andreas Mueller fb123ed24b More doc fixes. Latex builds again. 2015-11-20 16:30:45 -05:00
hlin117 3c1e9008d8 #5751: Adding explained_variance_ and clarification about components_ to docstring 2015-11-14 23:46:36 -06:00
Manoj Kumar f49a558162 Merge pull request #5492 from arthurmensch/remove_cython
[MRG + 2] Removing generated C files, adding build cache to Travis
2015-11-11 11:41:18 -05:00
Andreas Mueller 7d574ad3a1 Merge pull request #5511 from KamalakerDadi/sphinx_version_added
[MRG + 1] Version Added for All Classes in 0.17
2015-11-04 16:24:33 -05:00
Arthur Mensch 986fb60947 C file removal + cython build + Travis build cache 2015-11-04 14:30:06 +01:00
Graham Clenaghan c6037e7ed1 Ensure that n_nonzero_coefs is an int 2015-11-03 18:36:34 -08:00
KamalakerDadi f2e35411fa Added more versions of 0.17 2015-11-04 00:02:52 +01:00
KamalakerDadi 2249daaea8 Version added for all new classes 2015-11-03 23:54:42 +01:00
Raghav R V 3f8743f47b Main Commits - Major
--------------------

* ENH Reogranize classes/fn from grid_search into search.py
* ENH Reogranize classes/fn from cross_validation into split.py
* ENH Reogranize cls/fn from cross_validation/learning_curve into validate.py

* MAINT Merge _check_cv into check_cv inside the model_selection module
* MAINT Update all the imports to point to the model_selection module
* FIX use iter_cv to iterate throught the new style/old style cv objs
* TST Add tests for the new model_selection members
* ENH Wrap the old-style cv obj/iterables instead of using iter_cv

* ENH Use scipy's binomial coefficient function comb for calucation of nCk
* ENH Few enhancements to the split module
* ENH Improve check_cv input validation and docstring
* MAINT _get_test_folds(X, y, labels) --> _get_test_folds(labels)
* TST if 1d arrays for X introduce any errors
* ENH use 1d X arrays for all tests;
* ENH X_10 --> X (global var)

Minor
-----

* ENH _PartitionIterator --> _BaseCrossValidator;
* ENH CVIterator --> CVIterableWrapper
* TST Import the old SKF locally
* FIX/TST Clean up the split module's tests.
* DOC Improve documentation of the cv parameter
* COSMIT consistently hyphenate cross-validation/cross-validator
* TST Calculate n_samples from X
* COSMIT Use separate lines for each import.
* COSMIT cross_validation_generator --> cross_validator

Commits merged manually
-----------------------

* FIX Document the random_state attribute in RandomSearchCV
* MAINT Use check_cv instead of _check_cv
* ENH refactor OVO decision function, use it in SVC for sklearn-like
  decision_function shape
* FIX avoid memory cost when sampling from large parameter grids

ENH Major to Minor incremental enhancements to the model_selection

Squashed commit messages - (For reference)

Major
-----

* ENH p --> n_labels
* FIX *ShuffleSplit: all float/invalid type errors at init and int error at split
* FIX make PredefinedSplit accept test_folds in constructor; Cleanup docstrings
* ENH+TST KFold: make rng to be generated at every split call for reproducibility
* FIX/MAINT KFold: make shuffle a public attr
* FIX Make CVIterableWrapper private.
* FIX reuse len_cv instead of recalculating it
* FIX Prevent adding *SearchCV estimators from the old grid_search module
* re-FIX In all_estimators: the sorting to use only the 1st item (name)
    To avoid collision between the old and the new GridSearch classes.
* FIX test_validate.py: Use 2D X (1D X is being detected as a single sample)
* MAINT validate.py --> validation.py
* MAINT make the submodules private
* MAINT Support old cv/gs/lc until 0.19
* FIX/MAINT n_splits --> get_n_splits
* FIX/TST test_logistic.py/test_ovr_multinomial_iris:
    pass predefined folds as an iterable
* MAINT expose BaseCrossValidator
* Update the model_selection module with changes from master
  - From #5161
  -  - MAINT remove redundant p variable
  -  - Add check for sparse prediction in cross_val_predict
  - From #5201 - DOC improve random_state param doc
  - From #5190 - LabelKFold and test
  - From #4583 - LabelShuffleSplit and tests
  - From #5300 - shuffle the `labels` not the `indxs` in LabelKFold + tests
  - From #5378 - Make the GridSearchCV docs more accurate.
  - From #5458 - Remove shuffle from LabelKFold
  - From #5466(#4270) - Gaussian Process by Jan Metzen
  - From #4826 - Move custom error / warnings into sklearn.exception

Minor
-----

* ENH Make the KFold shuffling test stronger
* FIX/DOC Use the higher level model_selection module as ref
* DOC in check_cv "y : array-like, optional"
* DOC a supervised learning problem --> supervised learning problems
* DOC cross-validators --> cross-validation strategies
* DOC Correct Olivier Grisel's name ;)
* MINOR/FIX cv_indices --> kfold
* FIX/DOC Align the 'See also' section of the new KFold, LeaveOneOut
* TST/FIX imports on separate lines
* FIX use __class__ instead of classmethod
* TST/FIX import directly from model_selection
* COSMIT Relocate the random_state documentation
* COSMIT remove pass
* MAINT Remove deprecation warnings from old tests
* FIX correct import at test_split
* FIX/MAINT Move P_sparse, X, y defns to top; rm unused W_sparse, X_sparse
* FIX random state to avoid doctest failure
* TST n_splits and split wrapping of _CVIterableWrapper
* FIX/MAINT Use multilabel indicator matrix directly
* TST/DOC clarify why we conflate classes 0 and 1
* DOC add comment that this was taken from BaseEstimator
* FIX use of labels is not needed in stratified k fold
* Fix cross_validation reference
* Fix the labels param doc

FIX/DOC/MAINT Addressing the review comments by Arnaud and Andy

COSMIT Sort the members alphabetically
COSMIT len_cv --> n_splits
COSMIT Merge 2 if; FIX Use kwargs
DOC Add my name to the authors :D
DOC make labels parameter consistent
FIX Remove hack for boolean indices; + COSMIT idx --> indices; DOC Add Returns
COSMIT preds --> predictions
DOC Add Returns and neatly arrange X, y, labels
FIX idx(s)/ind(s)--> indice(s)
COSMIT Merge if and else to elif
COSMIT n --> n_samples
COSMIT Use bincount only once
COSMIT cls --> class_i / class_i (ith class indices) -->
perm_indices_class_i

FIX/ENH/TST Addressing the final reviews

COSMIT c --> count
FIX/TST make check_cv raise ValueError for string cv value
TST nested cv (gs inside cross_val_score) works for diff cvs
FIX/ENH Raise ValueError when labels is None for label based cvs;
TST if labels is being passed correctly to the cv and that the
ValueError is being propagated to the cross_val_score/predict and grid
search
FIX pass labels to cross_val_score
FIX use make_classification
DOC Add Returns; COSMIT Remove scaffolding
TST add a test to check the _build_repr helper
REVERT the old GS/RS should also be tested by the common tests.
ENH Add a tuple of all/label based CVS
FIX raise VE even at get_n_splits if labels is None
FIX Fabian's comments
PEP8
2015-10-23 17:28:08 +02:00
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