Commit Graph

126 Commits

Author SHA1 Message Date
Nikolay Mayorov 5b3f51515b MAINT: Get rid of classes in test_mutual_info.py 2016-01-22 00:27:16 +05:00
Nikolay Mayorov 375b070263 TST: Speed up 2 tests related to mutual info 2016-01-22 00:27:16 +05:00
Nikolay Mayorov d3a497aec4 BUG: Fix copy logic for mutual info functions 2016-01-22 00:27:16 +05:00
Nikolay Mayorov 051d3a285d MAINT: Slightly improve logic of discrete-continuous MI estimation 2016-01-22 00:27:16 +05:00
Nikolay Mayorov ffc4fe91da TST: Change tolerance checks in test_mutual_info.py 2016-01-22 00:27:16 +05:00
Nikolay Mayorov 835102ab6a API: Split mutual_info into _regression and _classif 2016-01-22 00:27:15 +05:00
Nikolay Mayorov c1aea3f868 MAINT: Renamed module mutual_info to mutual_info_ 2016-01-22 00:27:15 +05:00
Nikolay Mayorov df08defb05 ENH: Implemented mutual_info function 2016-01-22 00:27:15 +05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
MechCoder d13f519ba5 Parallelize embarrassingly parallel loop in RFECV.fit 2015-12-06 20:58:06 -05:00
Andreas Mueller 776e53b127 skip unstable tests on 32bit platform 2015-11-02 15:21:22 -05: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
Arnaud Rachez 5db2adf93c MAINT Removed deprecated stuff. 2015-10-21 10:24:23 +02:00
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
MechCoder c805fbc79b Refactor tests 2015-10-10 22:05:40 -04:00
MechCoder 5a0db1717a 1. Added parameter prefit to pass in a fitted estimator.
2. Use assert_warns instead of catch_warnings
3. Remove depracation warnings in common tests.
2015-10-09 01:57:36 -04:00
MechCoder acf5f160a8 Merge SelectFromModel and L1-selection examples
Add test to check the threshold can be set without refitting
2015-10-05 11:25:07 -04:00
MechCoder 2ee718cc75 Add narrative docs and fix examples 2015-10-05 11:25:06 -04:00
MechCoder 10176d9897 Now a fitted estimator can be passed to SelectFromModel 2015-10-05 11:25:06 -04:00
MechCoder 459cb9ba3d Remove warm start 2015-10-05 11:19:57 -04:00
maheshakya c438f78996 Implemented SelectFromModel meta-transformer 2015-10-05 11:19:57 -04: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
Andreas Mueller f369d3ab0f Fix RFE / RFECV estimator tags 2015-05-29 11:36:38 -04:00
Andreas Mueller 79ea587e05 FIX make rfe feature importance test deterministic. 2015-04-28 18:26:22 -04:00
Wei Xue c165327940 Add regression test for the number of subsets of features 2015-04-20 12:58:29 -04:00
Wei Xue 7bbf10a598 ENH optimize rfecv by eliminating the for loop 2015-04-20 12:27:31 -04:00
Vincent Michel 0f0e58d35e Fix RFE - Add the possibility to use feature_importances rather than coef_ when existing, see #2121 2015-04-02 14:56:48 +02:00
Wei Xue 17ee7dd79b DOC & COSMIT deprecate estimator_params in RFE and RFE_CV in docstring 2015-03-29 12:47:53 -04:00
Raghav R V cd2ee7e454 MAINT docstring --> comments to prevent nose from using doc in verbose mode 2015-03-21 11:16:49 +05:30
Wei Xue b741aa3e5c FIX coding style #4292 2015-03-10 14:46:10 -04:00
Wei Xue 9f312a72b3 Correct warning messages and move warnings to fit method #4292 2015-03-10 10:47:15 -04:00
Wei Xue 08b97b32c2 Deprecate estimator_params in RFE and RFECV #4292 2015-03-09 16:45:46 -04:00
Andreas Mueller f12a441655 raise noise in test again, be ascii 2015-02-24 16:26:24 -05:00
Olivier Grisel 95f1d9562b FIX DOC TST: alpha is an uppper bound on FDR 2015-02-24 16:26:24 -05:00
Andreas Mueller 700babc43f extensive (excessive?) testing of FDR 2015-02-24 16:26:24 -05:00
Andrew Tulloch 1add39ff11 [Feature Selection] Fix SelectFDR thresholding bug (#2771)
From https://github.com/scikit-learn/scikit-learn/issues/2771, we were
not correctly scaling the alpha
parameter (http://en.wikipedia.org/wiki/False_discovery_rate#Benjamini.E2.80.93Hochberg_procedure)
with the number of features (== hypothesis).  Thus, the alpha
parameter was not invariant wrt the number of features.

The correction is as suggested in the original issue, and a test has
been added that verifies that for various numbers of features, an
appropriate false discovery rate is generated when using the selector.
2015-02-24 16:25:58 -05:00
Loïc Estève 5c0c5c672c MAINT use absolute imports in tests
as per the guideline in:
http://scikit-learn.org/stable/developers/#coding-guidelines
2015-02-10 13:40:31 +01:00
jnothman 95681eecca Merge pull request #4206 from ogrisel/fix-strict-select-fdr
[MRG] explicit warning message for strict selectors

Also fixes #4059
2015-02-07 21:54:45 +11:00
Olivier Grisel 2ce9eac717 TST more strict selectors with empty support 2015-02-07 11:37:06 +01:00
Olivier Grisel bc5b403af3 FIX #4059: explicit warning for strict selectors 2015-02-06 12:06:34 +01:00
bhsu 97e3b96801 PEP8 compliance 2015-02-05 15:26:46 -05:00
bhsu 13b6aec5f3 non-inheriting estimator added for rfe, cross validation, and pipeline tests
non-inheriting estimator added for cross validation

non-inheriting estimator added for pipeline

reconciled diffs
2015-01-29 22:02:38 -05:00
Raghav R V 88555987cc PEP8 Fix E101, E111 errors and W191, W293, W293 and W391 warnings. 2015-01-08 04:28:24 +05:30
Alexandre Gramfort 6039b1864b Merge pull request #3824 from nmayorov/rfecv_bugfix
[MRG+1] FIX: Bug in RFECV when step is not 1
2014-12-15 09:06:41 +01:00
Nikolay Mayorov ad7e772422 Fixed a bug in RFECV when step != 1 2014-12-15 02:53:27 +03:00
Joel Nothman 081a554698 FIX P/R/F metrics and scorers are now for binary problems only by default
Scorers for different average parameters have been added.
2014-12-09 13:56:51 +11:00
Borja Ayerdi 2fecf6facf Fix RFE n_features minimum value #3812 and make it simpler. 2014-11-24 18:05:00 +01:00
Borja Ayerdi 60cadce9d1 Fix RFE n_features minimum value #3812 2014-11-20 19:19:40 +01:00
MechCoder 0bd095f9d6 FIX: Raise warnings in f_classif a given feature is constant throughout 2014-10-08 19:32:47 +02:00
Olivier Grisel e01749068c MAINT fix prng in test_f_oneway_ints
Not fixing the PRNG cause the test to fail randomly under windows
where the 4 decimals place check can be too strict for some unlucky
random draws of test data.
2014-07-29 08:54:47 +02:00