Skip to content

max_features="auto" depreciated in RandomForestClassifier used in feature_scoring.py #127

@EwoutH

Description

@EwoutH

The usage of max_features="auto" as parameter value in RandomForestRegressors and ExtraTreesRegressors is depreciated in scikit-learn 1.1 and will be removed in 1.3. The default value for max_features also changed from from "auto" to "sqrt" in version 1.1.

In analysis/feature_scoring.py this function is used:

def get_rf_feature_scores(
x,
y,
mode=RuleInductionType.CLASSIFICATION,
nr_trees=250,
max_features="auto",

The full warning from the CI:

test_get_rf_feature_scores (test.test_analysis.test_feature_scoring.FeatureScoringTestCase) ... /opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/sklearn/ensemble/_forest.py:427: FutureWarning: max_features='auto' has been deprecated in 1.1 and will be removed in 1.3. To keep the past behaviour, explicitly set max_features='sqrt' or remove this parameter as it is also the default value for RandomForestClassifiers and ExtraTreesClassifiers.

See scikit-learn/scikit-learn#20111 for the motivation and discussion behind the depreciation.

@quaquel What new value is most appropriate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions