Skip to content

DecisionTreeRegressor and DecisionTreeClassifier do not allow n_subfeatures=-1.  #33

@john-waczak

Description

@john-waczak

The docs for DecisionTreeClassifier hyperparameter :n_subfeatures state:

n_subfeatures=0: number of features to select at random (0 for all, -1 for square root of number of features)

However the value -1 leads to the error "number of features -1 must be >= zero ". I'm not sure if the issue should be handled at this interface or in DecisionTree.jl itself as the function build_forest() has

if n_subfeatures == -1
    n_features = size(features, 2)
    n_subfeatures = round(Int, sqrt(n_features))
 end

while the function build_tree() does not. See this link for the classifier and this other link for the regressor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions