You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
To make it more easier to use, I'd suggest to:
expose warm_start in IsolationForest.__init__(), default False;
document it in the same way as it is documented for RandomForestClassifier, i.e. say:
+1 to expose warm_start in IsolationForest, unless there was a good reason for not doing so in the first place. I could not find any related discussion in the IsolationForest PR #4163. ping @ngoix@agramfort?
Activity
albertcthomas commentedon Mar 16, 2019
+1 to expose
warm_startinIsolationForest, unless there was a good reason for not doing so in the first place. I could not find any related discussion in the IsolationForest PR #4163. ping @ngoix @agramfort?agramfort commentedon Mar 19, 2019
albertcthomas commentedon Mar 19, 2019
PR welcome @petibear. Feel
free to ping me when it’s ready for reviews :).
pmarko1711 commentedon Mar 19, 2019
OK, I'm working on it then.
Happy to learn the process (of contributing) here.
pmarko1711 commentedon Mar 23, 2019
@albertcthomas it's ready
ENH iForest - expose warm_start (#13451) (#13496)
ENH iForest - expose warm_start (scikit-learn#13451) (scikit-learn#13496
Revert "ENH iForest - expose warm_start (scikit-learn#13451) (scikit-…
Revert "ENH iForest - expose warm_start (scikit-learn#13451) (scikit-…
ENH iForest - expose warm_start (scikit-learn#13451) (scikit-learn#13496