Skip to content

Incorrect documentation for warm_start behavior on BaseForest-derived classes #20435

@noahgolmant

Description

@noahgolmant

Describe the issue linked to the documentation

The RandomForestRegressor documentation states:

When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, just fit a whole new forest.

This is also true for all classes that derive from BaseForest, such as RandomForestClassifier and RandomTreesEmbedding.

However, the source code does not reflect this behavior. When n_more_estimators == 0, it does not fit a new forest and instead just recomputes the OOB score if applicable.

Suggest a potential alternative/fix

There are two potential fixes:

  1. Reword the documentation to state:

When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, reuse the existing ensemble.

  1. Modify the actual behavior of this method to fit a new forest in the case where n_more_estimators == 0 to reflect the existing documentation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions