| 1 | Expose warm_start in Isolation forest |
| 2 | It seems to me that `sklearn.ensemble.IsolationForest` supports incremental addition of new trees with the `warm_start` parameter of its parent class, `sklearn.ensemble.BaseBagging`. |
| 3 | |
| 4 | Even though this parameter is not exposed in `__init__()` , it gets inherited from `BaseBagging` and one can use it by changing it to `True` after initialization. To make it work, you have to also increment `n_estimators` on every iteration. |
| 5 | |
| 6 | It took me a while to notice that it actually works, and I had to inspect the source code of both `IsolationForest` and `BaseBagging`. Also, it looks to me that the behavior is in-line with `sklearn.ensemble.BaseForest` that is behind e.g. `sklearn.ensemble.RandomForestClassifier`. |
| 7 | |
| 8 | To make it more easier to use, I'd suggest to: |
| 9 | * expose `warm_start` in `IsolationForest.__init__()`, default `False`; |
| 10 | * document it in the same way as it is documented for `RandomForestClassifier`, i.e. say: |
| 11 | ```py |
| 12 | warm_start : bool, optional (default=False) |
| 13 | When set to ``True``, reuse the solution of the previous call to fit |
| 14 | and add more estimators to the ensemble, otherwise, just fit a whole |
| 15 | new forest. See :term:`the Glossary <warm_start>`. |
| 16 | ``` |
| 17 | * add a test to make sure it works properly; |
| 18 | * possibly also mention in the "IsolationForest example" documentation entry; |
| 19 | |