-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC Add warm start section for tree ensembles #29001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
doc/modules/ensemble.rst
Outdated
>>> X, y = make_classification(n_samples=100, random_state=1) | ||
>>> clf = RandomForestClassifier(n_estimators=10) | ||
>>> clf = clf.fit(X, y) # fit with 10 trees | ||
>>> _ = clf.set_params(n_estimators=20, warm_start=True) # set warm_start and increase num of estimators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line too long, might be a good idea to move the comment to the line above?
Also, do you think it makes sense to show something about the estimator before and after the second fit? To show how it changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I just printed len(clf.estimators_)
.
I guess ideally we would show that the first 10 estimators are the same but I couldn't think of a good way to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could export the trees with graphviz and show, but this is already a good improvement. Further improvements are very much welcome. Thanks @lucyleeow
Reference Issues/PRs
closes #22041
What does this implement/fix? Explain your changes.
warm_start
#24579), which is confusing. I thought about making a single section and talk about both ensemble and gradient boosted trees but thought it didn't fit withensemble.rst
page as its currently divided into sections for each estimator type.warm_start
together withrandom_state
is poorly documented #22041). I thought about adding this section in the docstrings (withwarm_start
param or at the end) of the 6 estimators but thought this was better as we can give an example as well. Happy to change though.Any other comments?