AttributeError: 'DecisionTreeClassifier' object has no attribute 'estimator_'
时间: 2023-10-20 11:08:08 浏览: 181
DecisionTreeClassifier
This error occurs when you try to access the `estimator_` attribute of a `DecisionTreeClassifier` object, but this attribute does not exist.
The `estimator_` attribute is only available for certain scikit-learn models that support the `BaseEnsemble` interface, such as `RandomForestClassifier` or `GradientBoostingClassifier`. These models contain multiple decision trees and the `estimator_` attribute refers to the underlying decision tree(s) used by the model.
To fix this error, you can try using a different scikit-learn model that supports the `estimator_` attribute or check the documentation for the specific model you are using to see what attributes are available.
阅读全文