Commit Graph

350 Commits

Author SHA1 Message Date
Raghav R V c20c76e2cb FIX use the model_selection 2016-04-04 16:05:36 +02:00
giorgiop 328ebfa865 ENH RandomizedPCA collapsed into PCA 2016-03-11 09:10:37 +11:00
YenChenLin e2e773d05d Add test for init errors 2016-02-17 00:43:10 +08:00
Olivier Grisel 83d1cf4256 MAINT speed up slow test_iforest_sparse 2016-02-08 11:24:20 +01:00
rasbt 4f2cd80a06 raise NotFittedError in VotingClassifier and unit test improvements 2016-02-04 16:19:56 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Gilles Louppe 889e2d4024 Merge pull request #5678 from betatim/no-warning-iforest
[MRG+1] IsolationForest max_samples warning and calculation
2015-11-11 15:02:37 +01:00
Tim Head bc85b78b12 Test max_samples_ attribute, set max_depth in BaseBagging 2015-11-04 08:35:42 +01:00
Tim Head 1f650db6dc Test for max_depth calculation and re-adding max_samples_ property
Added a test that checks if max_depth is recalculated for
small samples.

Readded the max_samples_ property to gain access to it in
predict()
2015-11-03 11:37:47 +01:00
Andreas Mueller 776e53b127 skip unstable tests on 32bit platform 2015-11-02 15:21:22 -05:00
Olivier Grisel b9b32db8e6 MAINT make nosetests verbose output more informative 2015-10-29 09:51:40 +01:00
yelite fea218e5cf In tree, min_samples_split and min_samples_leaf now accept float number as percentage. 2015-10-24 23:18:52 +02:00
ngoix a75eb63194 iforest
example + benchmark

explanation

make some private functions + fix public API

IForest using BaseForest base class for trees

debug + plot_iforest

classic anomaly detection datasets and benchmark

small modif

BaseBagging inheritance

shuffle dataset before benchmarking

BaseBagging inheritance

remove class label 4 from shuttle dataset

pep8 + rm shuttle.csv bench_IsolationForest.png + doc decision_function

add tests

remove comments

fetching kddcup99 and shuttle datasets

fetching kddcup99 and shuttle datasets

pep8

fetching kddcup99 and shuttle datasets

pep8

new files iforest.py and test_iforest.py

sc

alternative to pandas (but very slow)
in kddcup99.py

faster parser

sc

pep8 + cleanup + simplification

example outlier detection

clean and correct

idem

random_state added

percent10=True in benchmark

mc

remove shuttle + minor changes

sc

undo modif on forest.py and recompile cython on _tree.c

fix travis

cosmit

change bagging to fix travis

Revert "change bagging to fix travis"

This reverts commit 30ea500eb818c7a2c6ea5c3d63e75c6935aa3a35.

add max_samples_ in BaseBagging.fit to fix travis

mc

API : don't add fit param but use a private _fit + update tests + examples to avoid warning

adapt to the new structure of _tree.pyx

cosmit

add performance test for iforest

add _tree.c _utils.c _criterion.c

TST : pass on tests

remove test

relax roc-auc to fix AppVeyor

add test on toy samples

Handle depth averaging at python level

plot example: rm html add png

load_kddcup99 -> fetch_kddcup99 + doc

Take into account arjoly comments

sh -> shuffle

add decision_path code from #5487 to bench

Take into account arjoly comments

Revert "add decision_path code from #5487 to bench"

This reverts commit 46ad44ab487f4fd2728d927cbe09000330e8663e.

fix bug with max_samples != int
2015-10-24 15:17:32 +02: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
MechCoder 80e22b3ddf Patch liblinear for sample_weights in LogisticRegression(and CV) 2015-10-23 00:00:31 -04:00
Arnaud Joly 7d4755e317 Add a decision_path function to forest estimator 2015-10-21 17:05:56 +02:00
Arnaud Rachez 62633f701b Addressed comments on PR #5451 2015-10-21 10:24:23 +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
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Manoj Kumar 652b950074 Merge pull request #4242 from MechCoder/select_from_model
[MRG+1] Implemented SelectFromModel meta-transformer
2015-10-10 23:15:06 -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
Vighnesh Birodkar 735dd1fdca Fix warnings during tests 2015-10-08 14:52:21 -04:00
MechCoder 2416e2aee6 Catch filters instead of removing the tests 2015-10-05 11:24:02 -04:00
Jacob Schreiber 02c0029baa ENH gbt sparse support 2015-09-28 13:44:12 -07:00
Gilles Louppe 3575db60a1 TEST: check parallel computation 2015-09-14 07:38:01 +02:00
Gilles Louppe 5f589fbbb4 TEST: reduce test time, variable name, etc 2015-09-13 20:09:07 +02:00
Gilles Louppe bcc6f1bf57 TEST: take comments into account 2015-09-12 18:41:26 +02:00
Gilles Louppe 78974def03 TEST: use sklearn.fixes.bincount 2015-09-12 16:08:10 +02:00
Gilles Louppe 25dbb155a6 TEST: stronger tests for variable importances 2015-09-12 15:18:51 +02:00
Gilles Louppe 7e2453ac48 Merge pull request #5242 from arjoly/stable-test-2
FIX unstable test due to bootstrap and unset random state
2015-09-11 09:16:08 +02:00
Arnaud Joly 994cbe1faf FIX unstable test due to bootstrap and unset random state 2015-09-10 14:36:44 +02:00
Olivier Grisel 470b9a48be Merge pull request #5228 from jmschrei/gb_apply
[MRG+1] Apply method added to GradientBoosting
2015-09-10 10:37:25 +02:00
Jacob Schreiber bc225a5e1a ENH apply method added to Gradient Boosting 2015-09-10 10:32:51 +02: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
Gilles Louppe 7fccf45e49 Merge pull request #5207 from MechCoder/ensemble_sample_weight_bug
[MRG+1] [BUG] AdaBoostRegressor should not raise errors if the base_estimator does not support sample_weights
2015-09-09 08:48:13 +02:00
Matti Lyra e648fb9bc4 Added the option of passing in a sparse X matrix into decision function, plus tests for sparse for all prediction functions. 2015-09-07 18:05:42 +02:00
MechCoder bb2acedac9 AdaBoostRegressor should not raise errors if the base_estimator
does not support sample_weights
2015-09-06 23:30:37 -04:00
Gael Varoquaux 190abde442 Merge pull request #4881 from sonnyhu/weighted_least_squares
[MRG + 1] add sample_weight into LinearRegression
2015-08-30 16:35:00 +01:00
Sonny Hu a88f6ecf9d add sample_weight into LinearRegression 2015-08-13 14:32:07 -04: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
Olivier Grisel a45a50efa4 Merge pull request #5019 from glouppe/voting-get_params
[MRG+1] FIX: ensure that get_params returns VotingClassifier own params
2015-07-23 21:28:24 +02:00
Olivier Grisel 77d3fd9332 Merge pull request #4967 from stephen-hoover/threshold-boosting-samme_proba
[MRG+2] BUG Use epsilon threshold in `_samme_proba`
2015-07-23 21:18:34 +02:00
Gilles Louppe 34c4930591 FIX: ensure that get_params returns VotingClassifier own params 2015-07-23 08:34:26 +02:00
Ankur Ankan 4243412173 fixes bug in oob_score when X is sparse.csc matrix [refs #4744] 2015-07-17 14:46:14 +05:30
Stephen Hoover 0156dcf114 BUG Use epsilon threshold in `_samme_proba` and `_boost_real`
Instead of thresholding <0 probabilities to 1e-5, threshold <epsilon to epsilon. This avoids the issue of, e.g., probability values of 0 becoming larger than values of 1e-7.

Add a unit test for `_samme_proba` which checks that probability ordering is unchanged.

Resolves issue #4944 .
2015-07-12 13:34:40 -05:00
Alexandre Gramfort 1c07dec209 Merge pull request #4894 from tw991/rf
fix dtype transform problem in KNN and RandomForest
2015-06-24 23:33:10 +02:00
Tian Wang 9f06156f20 add a new int array to store indices 2015-06-24 11:22:01 -04:00
jnothman 8b44fa197d Merge pull request #4824 from amueller/testing_less_warnings
minor fixes to the tests, don't raise as many warnings in the test suite
2015-06-09 22:30:22 +10:00
Jungkook Park 8453daa6b9 Use expit function to compute the probability in ExponentialLoss class. 2015-06-08 13:03:52 -04:00