Commit Graph

980 Commits

Author SHA1 Message Date
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
Guillaume Lemaitre b3c22194b1 Add the possibility to add prior to Gaussian Naive Bayes
Added the following things:
* Test when the sum is not equal to one
* Test the prediction in case of a large bias for one class
* Test explicitely class_prior_
* Move the function to update the class prior in the GaussianNB class
* Remove the updating of the class prior before to actually compute the mean and variance

Address comments for PR #6180 - Correct the documentation

Address comment PR#6180 - Improve the class prior initialisation and updating
We modify the code to:
* Initialisat self.class_prior_ with the different possibilities (class_prior given or not, fit_prior True or False)
* Update self.class_prior_ only when no class_prior is given and than fit_prior is True

Address comments PR #6180 - Remove useless line

Fix the file according to PEP8 regulations

Update the API to have only class_prior in GaussianNB

Correct prior fitting using samples and not class number

Change name of priors and correct the warning with division by zero

Update the API

Remove functions which were called only once

Add additional test for part of the code which was not covered in GaussianNB

Correct doc formatting

Correct spelling
2016-03-22 18:13:48 -04:00
hugobowne ce11cbc3c5 added MultiOneVsRest classifier & testing suite 2016-03-13 22:49:39 +05:30
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
Andreas Mueller 150afe646e Merge pull request #6379 from lesteve/fix-stratified-shuffle-split-train-test-overlap
[MRG+1] fix StratifiedShuffleSplit train and test overlap
2016-02-29 15:23:23 -05:00
Loïc Estève 07728d9308 FIX StratifiedShuffleSplit train and test overlap
in some edge cases and added test.

Fix was applied in both sklearn.model_selection and
sklearn.cross_validation.
2016-02-26 08:25:25 +01:00
Andreas Mueller 9bff7d6817 add test for auto increasing 2016-02-15 14:09:18 +01:00
Andreas Mueller b5286c35fb weird work-around for spearman test 2016-02-15 14:09:18 +01:00
jarfa c694b9b004 change to test_isotonic_regression_ties_min 2016-02-05 11:28:21 +01:00
jarfa d472a6a79c much faster isotonic regression prediction (involved re-setting interpolation to linear) 2016-02-05 11:28:21 +01:00
dsquareindia 61486862a7 SKF raises error if n_labels<n_folds for individual classes. Updated whats_new 2016-01-21 12:07:28 +05:30
Gael Varoquaux aecf7bc0da Merge pull request #6087 from kaichogami/binary_partial_fit
[MRG+1] Added partial fit method for OvR and OvO.
2016-01-10 10:59:35 +01:00
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
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Alexandre Gramfort c33fa15d3e Merge pull request #5773 from amueller/python3.3_fix_again
[MRG+1] Fix import of reload for python 3.3
2015-12-10 21:31:11 +01:00
hlin117 72d72bfb70 LDA: explained_variance_ratio_ can be found using svd solver 2015-11-30 19:01:42 -06:00
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
Andreas Mueller ae8db69b4a Fix import of reload for python 3.3 2015-11-09 11:27:41 -05:00
Andreas Mueller 0e5553258a FIX port LDA covariance fix to decomposition module 2015-11-02 11:41:17 -05:00
Rémy Léone c95ee28961 remove useless pass 2015-10-31 10:02:35 +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
Andreas Mueller 5d3bb933e0 Merge pull request #5008 from TomDLT/logistic_multiclass
[MRG+1] fix logistic regression class weights
2015-10-22 12:44:37 +02:00
TomDLT d439dc4d9e FIX class_weight in LogisticRegression and LogisticRegressionCV 2015-10-21 17:41:39 +02:00
Arnaud Rachez 5db2adf93c MAINT Removed deprecated stuff. 2015-10-21 10:24:23 +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
Gilles Louppe a4e4cf9875 FIX: remove shuffling in LabelKFold 2015-10-19 16:27:04 +02:00
Alexandre Gramfort 8d2c15c099 Merge pull request #5437 from rvraghav93/remove_deprecated_stuff
[MRG] MAINT remove deprecated stuff that will no longer be supported in 0.18
2015-10-19 15:20:49 +02:00
Gilles Louppe 008adf11ad Merge pull request #5375 from rvraghav93/set_precision
[MRG + 2] FIX precision to float64 across the codebase
2015-10-19 11:02:04 +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
Andreas Mueller 18a53f2409 FIX skip LDA deprecation test on python3.3 that has no reload. 2015-10-16 18:31:47 -04:00
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Andreas Mueller c857e1e3d7 Merge pull request #5349 from jakevdp/naive-bayes-scale
[MRG+1] Naive bayes scale (Fixes #5314)
2015-10-09 18:50:48 -04:00
Vighnesh Birodkar 735dd1fdca Fix warnings during tests 2015-10-08 14:52:21 -04:00
Jake VanderPlas eac920db68 MAINT: minor fixes to GaussianNB epsilon 2015-10-07 07:09:01 -07:00
Jake VanderPlas 83fdaa3fea TST: GaussianNB scale invariance 2015-10-06 17:52:55 -07:00
Gilles Louppe 2556ae0ccd Merge pull request #5300 from glouppe/fix-5292
[MRG+1] Ensure correct LabelKFold folds when shuffle=True
2015-09-28 16:29:07 +02:00
Gilles Louppe 1f4bc26a02 FIX: Ensure correct LabelKFold folds when shuffle=True 2015-09-25 13:26:34 +02:00
Andreas Mueller 2a5652a3d8 Merge pull request #5294 from trevorstephens/lda_qda_fit_params
[MRG] Deprecate fit params in qda and lda
2015-09-22 12:24:23 -04:00
trevorstephens 5271c04759 deprecate fit params in qda and lda
add whatsnew
2015-09-22 07:54:44 -07:00
Andreas Mueller a0ce9e4da0 add future warning to pipeline.inverse_transform with 1d X. 2015-09-21 20:41:47 -04:00
Alexandre Gramfort 37bd275b16 Merge pull request #5283 from TomDLT/remove_warnings
[MRG] Remove some warnings from test suit
2015-09-19 08:38:01 +02:00
TomDLT 628ed2c867 ENH remove some warnings in test suit 2015-09-16 18:27:58 +02:00
benjaminirving fac33adeb6 Adding checks for the input LDA prior 2015-09-16 16:27:41 +02:00
Vinayak Mehta 679936f6bc MAINT Deprecate LDA/QDA in favor of expanded names
The LDA accronym for Linear Discriminant Analysis is ambiguous
because of the newly introduced Latent Dirichlet Allocation model.

We therefore deprecate the sklearn.lda.LDA and sklearn.lda.QDA
in favor of explicit names.
2015-09-11 15:32:11 +02:00
Alexandre Gramfort 9ebc6fe33d Merge pull request #5216 from JPFrancoia/master
Creation of the attribute LDA.explained_variance_ratio_, for the eige…
2015-09-11 11:42:39 +02:00
TomDLT 94eb61960a ENH add sag solver in LogisticRegression and Ridge 2015-09-10 13:28:02 -04:00