Commit Graph

1034 Commits

Author SHA1 Message Date
Olivier Grisel 2efa626f9b [MRG] Fix strict tests
* FIX test_common: assert_greater_equal(iter_, 1)

The previous check was too strict. It is fine for an estimator to
decide that is has converged in one pass over the data.

* STYLE PEP8

* FIX test_reconstruct_patches_perfect_color too strict

* STYLE flake8 fixes
2016-04-07 09:55:08 +02:00
ningchi 6ce198c78f [MRG] #6581 n_samples of utils.resample can be more when replace is True
* #6581 n_samples can be more when replace is True

* more compact code
2016-04-02 08:58:40 +02:00
Manoj Kumar 3078d7d611 Merge pull request #6127 from hugobowne/MultiOneVsRestClassifier
[MRG+2] MultiOutputClassifier
2016-03-31 23:02:08 -04:00
Maniteja Nandana 29ee54a586 Meta estimator for multi output classification 2016-04-01 07:18:59 +05:30
Manoj Kumar 24198ffbb8 Merge pull request #6419 from nelson-liu/fix_linkcheck
[MRG+1] DOC: Fix broken links
2016-03-30 18:17:48 -04:00
YenChenLin e34bbc1002 Use fused type in inplace normalize 2016-03-26 10:38:17 +08:00
YenChenLin 42d49c8c14 Make assign_rows_csr support Cython fused types 2016-03-25 00:25:36 +08:00
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
giorgiop 328ebfa865 ENH RandomizedPCA collapsed into PCA 2016-03-11 09:10:37 +11:00
Tim Head 07cede74ca Multitarget regression meta estimator
Register OneVsRestRegressor as meta estimator

Rename to a more sensible name

Parallel predict and sparse support

Started MultiOutput documentation

Move code to new file multioutput.py

Continuing the move to new multioutput module

Added sample weight support

Better test for sample weights and actually support weights

Added a new test using weighted vs repeated samples to
test sample weight support. Uncovered that weights
were not actually passed on to underlying estimator.

Comment on multiprocess overheads

Move parallel_helper to utils.fixes

This helper works around a python2 limitation on pickling
instance methods

Example of multi-output regression with gradient boosting

Switch to uniform weighted score and updated example

The example now uses a RF with and without the MultiOutput
meta estimator

Added note for removing `score` method

Addressing comments on MultiOutputRegressor

MultiOutputregressor better test for weighted samples

Fix ups

Use explicit keyword argument for passing sample weights and
fix random_state on train-test split in the example
2016-03-10 16:06:08 -05: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 7e79adca9d Huber regressor
Add gradient calculation in _huber_loss_and_gradient

Add tests to check the correctness of the loss and gradient

Fix for old scipy

Add parameter sigma for robust linear regression

Add gradient formula to robust _huber_loss_and_gradient

Add fit_intercept option and fix tests

Add docs to HuberRegressor and the helper functions

Add example demonstrating ridge_regression vs huber_regression

Add sample_weight implementation

Add scaling invariant huber test

Remove exp and add bounds to fmin_l_bfgs_b

Add sparse data support

Add more tests and refactoring of code

Add narrative docs

review huber regressor

Minor additions to docs and tests

Minor fixes that deals with dealing with NaN values in targets
and old verions of SciPy and NumPy

Add HuberRegressor to robust estimator

Refactored computation of gradient and make docs render properly

Temp

Remove float64 dtype conversion

trivial optimizations and add a note about R

Remove sample_weights special_casing

address @amueller comments
2016-02-25 16:31:08 -05:00
YenChenLin 46fc1be145 Remove redundant words in sklearn 2016-02-23 16:54:03 +08:00
Andreas Mueller de38d1b3e7 make X_stride be np.npy_intp 2016-02-15 14:09:18 +01:00
Gilles Louppe 1784bf3f26 Merge pull request #5863 from trevorstephens/cw_util_fix
[MRG] Fix for missing classes found in y - Fixes #4327
2016-02-11 11:42:47 +01:00
dsquareindia cfa498ca68 FIX in randomized_svd flip sign
Flip sign according to `u` in both cases of `transpose`.
2016-02-08 16:59:44 +01:00
giorgiop 6eca250347 MAINT speed up test_extmath 2016-02-06 18:55:23 +01:00
MechCoder 729be74708 Use row_norms in f_regression 2016-01-10 11:04:09 -05:00
Raghav R V a228016585 Leading underscores for warnings imported from sklearn.exceptions
in other modules where warnings are deprecated.

Prefix warnings imported from sklearn.exceptions instead of
suffixing to prevent showing both the suffixed warning
and the deprecated warning during tab completion.
2016-01-08 12:40:10 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Francis T. O'Donovan 79006fa1fe Provide 'self' argument to instance method 2015-12-12 01:46:56 -05:00
TomDLT 9f136ff293 ENH add multinomial SAG solver for LogisticRegression 2015-12-04 18:36:37 +01:00
trevorstephens 2738d59ab4 fix for missing classes found in y #4327 2015-11-16 16:36:01 -08:00
Manoj Kumar 08207314b1 Merge pull request #5783 from varun-kr/check_classification_bug
[MRG + 1] BUG :#5782  check_classification_targets returns y instead of y_type
2015-11-14 13:55:22 -05: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
Varun 299c2751ca BUG :#5782 check_classification_targets returns y instead of y_type 2015-11-10 16:02:07 -05:00
Andreas Mueller de3a527905 Merge pull request #5692 from amueller/skip_32_bit_tests
[MRG] Skip 32 bit tests that fail, skip doctests on 32bit
2015-11-05 10:33:33 -05:00
Arthur Mensch 986fb60947 C file removal + cython build + Travis build cache 2015-11-04 14:30:06 +01:00
Andreas Mueller 4bd1286328 COSMIT missing whitespace in error message 2015-11-02 16:24:02 -05:00
Andreas Mueller 776e53b127 skip unstable tests on 32bit platform 2015-11-02 15:21:22 -05:00
Rémy Léone 651ade041e Remove cython warnings
Non-trivial type declarators in shared declaration (e.g. mix of
 pointers and values). Each pointer declaration should be on its own
 line.
2015-11-02 10:33:36 +01:00
Rémy Léone 31f73a699a Simplify chain comparaison 2015-11-01 21:59:38 +01:00
Loïc Estève efe93d4cc6 MAINT update joblib to 0.9.3 2015-10-30 17:43:00 +01:00
Andreas Mueller 965a71517f Merge pull request #5214 from glennq/mlp_refactoring
[MRG + 2] Mlp with adam, nesterov's momentum, early stopping
2015-10-23 19:22:21 +02:00
Glenn Qian 917bacb66e Finish up mlp_refactoring and squash previous commits 2015-10-23 12:08:11 -04: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
Peter Fischer 8ff339eb5b Update test_utils.py
Comment instead of docstring to follow sklearn convention.
Regression test made easier by adding small value to main diagonal of s.p.d. matrix
2015-10-23 08:57:31 +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
Arthur Mensch 1c7168d398 Fix fit_transform, stability issue and scale issue in PLS 2015-10-22 14:25:59 +02:00
Gael Varoquaux 744d161d37 Merge pull request #5431 from hlin117/nan-targets
[MRG + 2] Add check to regression models to raise error when targets are NaN
2015-10-22 09:36:12 +02:00
Andreas Mueller 3891af8d99 iterate, improve. Nesterov's momentum. 2015-10-21 14:43:38 -04:00
Andreas Mueller ee071e00b2 FIX partial fit test for MLP 2015-10-21 14:41:41 -04:00
hlin117 f725485427 #5322: Small change to estimator_check.py 2015-10-21 11:59:21 -05:00
hlin117 1f48814799 #5322: Using multioutput_estimator_convert_y_2d in check_supervised_y_no_nan 2015-10-21 11:54:12 -05:00
Andreas Mueller 3c988d5d1c Merge pull request #5512 from giorgiop/randomized-svd-versionadded
DOC versionadded randomized_svd
2015-10-21 18:45:24 +02:00
giorgiop f45f260ff7 DOC versionadded randomized_svd 2015-10-21 18:28:37 +02:00
hlin117 290e0ea6f2 #5322: Changed check_supervised_y_no_nan to not seed global 2015-10-21 11:26:20 -05:00
hlin117 c45075123a Added documentation about y nan handling in check_X_y 2015-10-21 11:11:08 -04:00
Olivier Grisel 0cb93b0996 Merge pull request #5141 from giorgiop/power-iter-randomized-svd
[MRG + 2] ENH: optimizing power iterations phase for randomized_svd
2015-10-21 13:01:45 +02:00
giorgiop b18f2951e4 randomized_svd: power iter, normalization, benchmark 2015-10-21 11:21:40 +02:00