* FIX enforce deterministic behaviour in BaseBagging
* DOC add entry in whats new for model changes
* add comments
* revert space
* revert space right place
* Typo
* FIX change estimators_samples_
* TST check size training set and hash during bootstrapping
* DOC/TST API entry in doc and style correction
* DOC move entry in the right section
* DOC add missing author and issue
* DOC add details in whats new entry
* FIX add hash from joblib in utils
* iter
In order to fix#11408, this swaps `joblib` and `_joblib`. It however, allows users to access joblib's `Memory` or `Parallel` functionality without accessing `sklearn.externals._joblib` by importing `Memory`, `Parallel`, etc. into `sklearn.utils`.
* fixed OOB_Score bug for bagging slassifiers.
See: https://github.com/scikit-learn/scikit-learn/issues/8933
* Added white space
* more white space fixing
* Adding test for oob_score validity
* removing pandas, replacing with numpy matrices
* fixing white space
* more white space fixing
* white space ...
* fixed labels to allow for strings
* white space
* simplifying test
* white space
* reformatting test
* white space
* pressed enter at end of file
* removing line at end of file
* FIX adaboost estimators not randomising correctly
(fixes#7408)
FIX ensure nested random_state is set in ensembles
* DOC add what's new
* Only affect *__random_state, not *_random_state for now
* TST More informative assertions for ensemble tests
* More specific testing of different random_states
* Remove heavy memory footprint for OOB scoring from bagging.
- Remove `estimators_samples` attribute from `BaseBagging`
- Add method `_get_estimators_samples` to `BaseBagging` that
returns a generator producing sample indices on demand.
- Slight refactor of `_parallel_build_estimators()` to
isolate and group lines accessing random state.
* Replaced `BaseBagging.estimators_samples_` attribute with property.
- Accessing `BaseBagging.estimators_samples_` now triggers call to
`BaseBagging._get_estimators_samples` as well as deprecation
warning for release 0.20.
- This should make the fix for the OOB memory issue fully backwards
compatible.
* Remove print statement.
* Added test, made new method more general.
- Added test to `test_bagging.py` to ensure that indices generated
on the fly are identical to indices generated at fit time.
- Refactored `_get_estimators_samples()` to `_get_estimators_indices()`,
now both feature and samples indices are returned.
- Refactored `estimators_samples_()` to deal with above.
* Rename index generating functions and arguments.
* `estimators_samples_()` returns list instead of generator
* Removed `estimators_samples_` deprection warning.
* Actually removed `estimators_samples_` deprecation warning.
* New mask generation function, new bagging test, new BaseBagging attributes.
- Added new private function in bagging.py that converts indices to
a boolean mask.
- Added new bagging test to make sure identical OOB scores are generated
when the same estimator if fit with fixed random state and identical
training data.
- Added new private attributes `BaseBagging._max_features` and
`BaseBagging._max_samples` to store validated input values.
* Streamlined code, improved `estimators_samples_()` documentation.
- Removed `max_samples` argument from `_parallel_build_estimators()`,
this value is now accessed via `ensemble._max_samples`.
- Removed validation of `ensemble.max_features` and `max_samples`,
instead use `ensemble._max_features` and `ensemble._max_samples`
which are assumed to be already validated.
- Removed unnecessary `samples` variable from `_parallel_build_estimators()`.
- Changed the way `random_state` is generated in `_parallel_build_estimators()`
and `BaseBagging._get_estimators_data_draws()` to direct numpy method to
reflect that seeds created in `BaseBagging._fit()` are trustworthy.
- Due to above removed generation of new seed for each estimator in
`_parallel_build_estimators()` and `BaseBagging._get_estimators_data_draws()`.
- Added documentation to `BaseBagging.estimators_samples_()` property
indicating the reason it's generated dynamically and the associated performance
penalty.
- Returned `BaggingClassifier._set_oob_score()` and `BaggingRegressor._set_oob_score()`
to directly accessing `self.estimators_samples_`.
* Streamlined code, improved `estimators_samples_()` documentation.
- Removed `max_samples` argument from `_parallel_build_estimators()`,
this value is now accessed via `ensemble._max_samples`.
- Removed validation of `ensemble.max_features` and `max_samples`,
instead use `ensemble._max_features` and `ensemble._max_samples`
which are assumed to be already validated.
- Removed unnecessary `samples` variable from `_parallel_build_estimators()`.
- Changed the way `random_state` is generated in `_parallel_build_estimators()`
and `BaseBagging._get_estimators_data_draws()` to direct numpy method to
reflect that seeds created in `BaseBagging._fit()` are trustworthy.
- Due to above removed generation of new seed for each estimator in
`_parallel_build_estimators()` and `BaseBagging._get_estimators_data_draws()`.
- Added documentation to `BaseBagging.estimators_samples_()` property
indicating the reason it's generated dynamically and the associated performance
penalty.
- Returned `BaggingClassifier._set_oob_score()` and `BaggingRegressor._set_oob_score()`
to directly accessing `self.estimators_samples_`.
* PEP8, remove optional arguments, add public function to utils.
- Update indentation and line length to conform to PEP8.
- Update `estimators_samples_()` docstring to conform to PEP8 and
PEP257.
- Remove optional arguments to `BaseBagging._get_estimators_data_draws()`,
rename to `BaseBagging._get_estimators_indices()`.
- Remove optional arguments from `_generate_mask_from_indices()`,
move to `utils.metaestimators`, rename to `indices_to_mask()`.
* Add indices_to_mask to __all__ in utils.metaestimators
* Move utils function, new test for `estimators_samples` correctness.
- Moved `indices_to_mask` from `utils.metaestimators` to `utils.validation`
- Added new test to `ensemble.test_bagging` to make sure refitting
an individual estimator from the bagging ensemble using the corresponding
samples identified in `BaseBagging.estimators_samples` returns the same model.
* Adjust/remove tests, move `indices_to_mask` to `utils.__init__`.
- Remove test_bagging.test_consistent_index_sampling
- Update formatting checks in test_bagging.test_estimators_samples
to make sure each mask is numpy boolean array
- Move indices_to_mask from utils.validation to utils.__init__
* update class docstring for `estimators_samples_`
- Updated class docstring of `estimators_samples_` attribute for `BaggingClassifier` and `BaggingRegressor` to indicate that samples are identified with boolean masks.
* PEP8, made `max_samples` arg optional in _fit()
- Fixed PEP8 issues.
- Gave `max_samples` argument of `BaseBagging._fit()` a default
value of `None` as indicated in the docstring. Added code to
check for and process `None` value.
- Added a few more comments to `_fit()`.
* 2 new `max_samples` consistency tests, update whats_new.rst
* Minor change
* Update whats_new.rst
- total_n_estimators should be sum(n_estimators) not len(..)
- keyword argument should be after non-keyword argument (call of ``_parallel_build_estimators`` with ``delayed`` on line 365-366.
Add to bagging.Bagging._parallel_build_estimators a total_n_estimators parameter, to improve the (optional) information printed if verbose > 1.
It felt weird to see 6 times in a row "building estimator 1 of 1" without any idea of total number of estimators to build, now it's fixed.
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
* Updated _check_solver_option to include sample_weight check
* Updated all calls to _check_solver_option()
* Updated documentation of class_weight throughout logistic.py
* Added sample_weight parameter to logistic_regression_path.
* Added handling of sample weights to logistic_regression_path.
* Added sample_weight parameter to _log_reg_scoring_path.
* Added handling of sample weights to _log_reg_scoring_path.
* Added sample_weight parameter to fit() in the LogisticRegression class.
* Added handling of sample sample weights in LogisticRegression.fit()
* Added sample_weight parameter to fit() in the LogisticRegressionCV class.
* Added handling of sample weights in LogisticRegressionCV.fit()
* Added test_logistic_regressioncv_sample_weights, which:
* tests that a ValueError is raised if liblinear is used with
sample weights
* tests that passing sample weights as np.ones(y.shape[0]) is
the same as not passing them (default None)
* tests that using both lbfgs and newton-cg solvers with
sample weights yields the same results
* tests that passing class weights to scale one class is the
same as passing sample weights for the training data of just
that class
* Fixed bug with *= in logistic_regression_path.
* Fixed bug in test_logistic_regressioncv_sample_weights where
no data was created prior to fitting.
* Changes to accepted sample_weight type.
* Fixed bug in naming of sample_weight when passed from
_log_reg_scoring_path to logistic_regression_path.
* Fixed issue of sample_weight=None being converted to np.array()
and then not being reconigzed as None.
* Added tests for LogisticRegression
* Attempting to fix same issue as 9d3becf by instead implementing
if statement in bagging.py.
* Added TODO to eliminate check for liblinear w/ sample weights
in bagging.py
Removed the need for printing attributes to raise
exceptions in the tests
Removed unnecessary setting of attributes in the
initialisation.
Moved check for warm_start and oob_score
BaggingClassifier and BaggingRegressor now support warm_starts. Added
basic tests and documentation of the new functionality. Heavily
inspired by work on warm_start for Random forests.