Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaggle n_estimators issue with DecisionTreeClassifier #116

Open
MarcinKamil84 opened this issue Jul 4, 2023 · 2 comments
Open

Kaggle n_estimators issue with DecisionTreeClassifier #116

MarcinKamil84 opened this issue Jul 4, 2023 · 2 comments

Comments

@MarcinKamil84
Copy link

Here's my code snippet from Kaggle notebook:

rf_cl = RandomForestClassifier()
dt_cl = DecisionTreeClassifier()

estimator = dt_cl

feat_selector = BorutaPy(
    verbose=2,
    estimator=estimator,
    n_estimators='auto',
    max_iter=20
)

feat_selector.fit(np.array(train_set_final), np.array(train_set_labels))

Here's the error:

ValueError: Invalid parameter 'n_estimators' for estimator DecisionTreeClassifier(). Valid parameters are: ['ccp_alpha', 'class_weight', 'criterion', 'max_depth', 'max_features', 'max_leaf_nodes', 'min_impurity_decrease', 'min_samples_leaf', 'min_samples_split', 'min_weight_fraction_leaf', 'random_state', 'splitter'].

With RandomForestClassifier all works fine.
What can be the issue?

@Nimmerfall
Copy link

The DecisionTreeClassifier doesn't seem to have a parameter for n_estimators.
At least i dont see it within the docx -> https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html

@MarcinKamil84
Copy link
Author

Sorry. I have no idea how I missed that. I was sure I checked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants