Commit Graph

74 Commits

Author SHA1 Message Date
kaichogami cdb9dba63e Added doc, tests
Added test for partial_fit when mini-batch doesn't have all target classes. Changed doc for better explaination of the use of  paramter in partial_fit method. Used generator for passing of classes in OvO in Parallel processing instead of estimator.pop().
2016-01-02 20:20:09 +05:30
kaichogami fb3574d719 Added partial_fit method for ovo and ovr
FIX issue #4167 implementing online learning where base estimators have patial_fit method.
2016-01-01 13:18:18 +05:30
Varun 8a391bea9f added check for type in test_check_classification_targets 2015-11-11 17:45:32 -05:00
Varun bc3c3db777 #5782 added test case for check_classification_targets() 2015-11-10 17:06:39 -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
Raghav R V 7e29af034b MAINT remove deprecated stuff that will no longer be supported in 0.18 2015-10-19 10:44:42 +02:00
Raghav R V 664d78eb7c MAINT Remove support for the deprecated sequence of sequences
MAINT Remove sequence of sequence support from datasets
MAINT Remove return_indicator param
MAINT Remove multilabel-seq test in OVR
MAINT Remove multilable-seq test in check_cv
MAINT Remove multilabel seq test in label_binarizer
TST type_of_target returns "unknown" for multilabel-sequence types
TST _check_targets should raise a ValueError
DOC show multilabel indicator as an example; remove return_indicator param
DOC use consistent lower case y for target
2015-08-11 22:26:44 +05:30
Andreas Mueller a8626b36a6 TST/COSMIT remove nose call boilerplate 2015-05-28 14:54:01 -04:00
Andreas Mueller b9d8fd56a2 ENH support for sparse coef_ in ovr classifier 2015-05-15 20:26:38 -04:00
Andreas Mueller d89c215013 Add tags to classifiers and regressors to identify them as such. 2015-03-31 19:59:49 -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
Andreas Mueller deeaf0ad35 change default to shuffle=True in SGDClassifier and friends. 2015-03-03 11:56:23 -05:00
Raghav R V e20d1a4391 ENH decision_function now returns #votes and scaled scores.
ENH use the decision_function to compute the prediction
TST Added test to assertain correlation of decision function and prediction
    Add test to check if ties are broken using decision function
    Add decision_function tests to check for votes/scores
    ovo_ties test will use decision function to calculate votes and score.
DOC Add entry to OvO's doc regarding how ties are broken
DOC Clean up the predict / decision_function methods' docstring.
PEP8 Minor PEP8 clean up.
2015-02-09 14:39:11 +05:30
Lars Buitinck 40c03d4880 COSMIT pep8 fixes to sklearn/tests 2014-12-18 16:40:01 +01:00
Javier López Peña 744614dfba Check if targets is a numpy array and convert it into one if it isn't 2014-11-30 11:26:38 +00:00
Lars Buitinck b584ac47be FIX ovr predict_proba in the binary case
Previous commit fixed the shape, but swapped the actual probabilities.
2014-09-29 22:51:19 +02:00
Will Lamond 6e123c0661 Fixes ovr in the binary classifier case, and adds support for lists of feature arrays in the multiclass case. 2014-09-26 21:31:41 -04:00
Arnaud Joly 0807e19dc2 MAINT deprecate fit_ovr, fit_ovo, fit_ecoc, predict_ovr, predict_ovo, predict_ecoc and predict_proba_ovr 2014-07-19 12:17:22 +02:00
Andreas Mueller eb2098f26f Closes #2360. Fix tiebreaking. 2014-07-18 16:48:08 +02:00
Hamzeh Alsalhi 9f45e3730f Modified sparse OvR to handle sparse target data
Defaulted label binarizer to set sparse_output=True when training ovr
classifiers, edited Label binarizer to allow for sparse binary column output
2014-07-18 12:10:50 +02:00
Vlad Niculae e072fbce62 Turn useless line of code into descriptive comment 2014-07-15 12:44:05 +02:00
Joel Nothman e633f25233 ENH make_multilabel_classification for large n_features: faster and sparse output support 2014-07-08 11:13:58 +02:00
Joel Nothman 82864ad73b FIX avoid using sequences of sequences and fix tests 2014-06-24 16:27:05 -04:00
Joel Nothman d2db017058 TST use assert_warns and modernise test for constant predictor 2014-06-24 15:55:21 -04:00
Joel Nothman 51d4f75d06 FIX case where label is constantly absent 2014-06-23 11:53:46 -04:00
Joel Nothman fa76ac38ee FIX OvR with constant label for non-predict methods 2014-06-23 10:52:01 -04:00
Joel Nothman 28eb1ebe15 Assert or ignore all sequence of sequences deprecation warnings 2014-06-05 11:20:36 +02:00
Andrew Tulloch 8eeda198d2 [tests] Use Python 3 zip/Python 2 zip consistently in tests 2014-03-03 13:02:17 +00:00
Lars Buitinck 0f5685b8ee FIX predict_proba status on SGD and SVC when disabled
Using a property trick suggested by @mblondel. The following now
works:

    >>> clf = SVC(probability=False)
    >>> hasattr(clf, "predict_proba")
    False

This simplifies the smoke tests.

Added a note to SVC stating that this should be done in new code.
2014-02-27 18:30:35 +01:00
Gael Varoquaux 3ee7b72426 BUG: OneVsOneClassifier was broken with string labels 2013-12-18 22:51:22 +01:00
Andreas Mueller e488704849 COSMIT pep8 2013-07-23 15:17:32 +02:00
Kyle Kastner 784486126f Cleaned up tests, and removed unused multilabel parameter in decision_function_ovr 2013-07-22 12:56:05 +02:00
Kyle Kastner baffa3017b Strengthened tests for OneVsRestClassifier decision_function 2013-07-22 12:56:05 +02:00
Kyle Kastner 5088875a0c Updated fixes for #2012. 2013-07-22 12:56:05 +02:00
Kyle Kastner cbd65449c0 Added decision_function support to OneVsRestClassifier and a test, test_ovr_single_label_decision_function, in test_multiclass.py 2013-07-22 12:56:05 +02:00
Arnaud Joly d33634d0ce ENH add multilabel support to PRF metric family
Support also in classification_report
2013-05-20 13:08:50 +10:00
Felix Brockherde 34022b5283 FIX scores calculation in ovo multiclass
Verify that ties can be won by all labels
2013-05-04 10:33:49 +02:00
Arnaud Joly 5bcf25fc2f ENH multilabel metrics: accuracy, Hamming, 0-1 loss 2013-03-02 20:41:34 +01:00
Lars Buitinck 645216fb2f Merge pull request #1524 from amueller/break_ovo_ties
MRG break ties in OvO using scores
2013-02-14 06:15:32 -08:00
Lars Buitinck 541987802f P3K range vs. xrange 2013-02-14 02:05:35 +01:00
Andreas Mueller 0449d51029 TST test for breaking OVO ties 2013-02-04 22:43:39 +01:00
Mathieu Blondel 3be27ff640 Cosmits and typos. 2012-12-03 00:18:52 +09:00
Andrew Winterman 482e57685f Spelling is checked, passes Flake8 without errors. 2012-12-02 09:32:28 +00:00
Andrew Winterman 48f0a44640 corrected bad test in test_multiclass
`test_ovr_single_label_predict_proba` wasn't checking consitency between
`predict_proba` and `predict` correctly. Now it is. Nose tests pass except for
1 conerning PIL.
2012-12-02 09:32:28 +00:00
Andrew Winterman c4cbffcc13 divided test for predict_proba into two functions 2012-12-02 09:32:27 +00:00
Andrew Winterman fd930e37da wrote test_ovr_predic_proba method
If anyone has any suggestions for additional testing methods, it would be much
appreciated. Currently implemented:
- Do probabilities sum to one in single label case?
- Is a ValueError raised for base classifier with no predict_proba method?
- Do you arrive at the same predictions from predict_proba and predict?
2012-12-02 09:32:27 +00:00
Mathieu Blondel c1ffbb47e7 Missing random_state in LinearSVC. 2012-11-03 00:53:34 +09:00
Mathieu Blondel afb666c1d0 Use sklearn.utils.testing in tests. 2012-10-25 15:31:35 +09:00
Andreas Mueller 10d9023fca ENH make multi-class more robust in discovering scoring functions 2012-10-07 20:25:50 +02:00
Andreas Mueller 408d3ef86d COSMIT, removed scikits.learn things, removed orphan file. 2012-07-23 22:50:12 +01:00