Skip to content

Clarify how splits are selected in DecisionTree when using a random splitter #33568

Closed

Description

@cri98li

Describe the issue linked to the documentation

The current documentation for the splitter parameter in DecisionTree-based estimators is ambiguous when splitter='random'. It’s unclear how the threshold is chosen

Suggest a potential alternative/fix

Please add to the documentation something like:
When 'random', the tree first selects a random feature, then computes the minimum and maximum values of that feature, and finally chooses a split threshold randomly from a uniform distribution between these bounds.

Documentation reference (DTClassifier, but also applies to other tree-based classes documentation):

splitter : {"best", "random"}, default="best"
The strategy used to choose the split at each node. Supported
strategies are "best" to choose the best split and "random" to choose
the best random split.

Here is a reference that illustrates the behavior to be described in the documentation:

current_split.threshold = rand_uniform(
min_feature_value,
max_feature_value,
random_state,
)

Thank you for the good work!

Activity

  1. AutoHmn13 commented on Mar 18, 2026

    @AutoHmn13

    I'd like to work on this - I've reviewed the splitter behavior and will submit a PR with updated wording for DecisionTreeClassifier, DecisionTreeRegressor, and the Extra Trees variants

  2. AnneBeyer commented on Mar 24, 2026

    @AnneBeyer
    Member

    There is already a discussion on this going on in #33158.

  3. betatim commented on Mar 24, 2026

    @betatim
    Member

    Apologies, I should have closed this issue when I closed #33576 where I said that we do not want to expand the docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationNeeds Triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions