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

Error when using BorutaPy with LogisticRegression #119

Open
codewithawr opened this issue Sep 8, 2023 · 0 comments
Open

Error when using BorutaPy with LogisticRegression #119

codewithawr opened this issue Sep 8, 2023 · 0 comments

Comments

@codewithawr
Copy link

I encountered an error while using BorutaPy with a LogisticRegression model. The issue arises when setting the n_estimators parameter to 'auto' in BorutaPy. The LogisticRegression model does not have the n_estimators parameter, which causes a ValueError. My understanding is that BorutaPy is trying to provide specific arguments to the estimator model that are not present in the LogisticRegression model.

Steps to Reproduce:
Install the necessary libraries:

Bash

pip install Boruta==0.3 scikit-learn==1.3.0 pandas==2.1.0

Python

from BorutaPy import BorutaPy
from sklearn.linear_model import LogisticRegression

# Assuming you have x_train_rfe and y_train defined
bl_model_ob = LogisticRegression(random_state=1)
boruta_selection = BorutaPy(bl_model_ob, n_estimators='auto', verbose=2, random_state=1)
boruta_selection.fit(x_train_rfe, y_train)

Behavior:
Errore

--> 372     depth = self.estimator.get_params()['max_depth']
    373     if depth == None:
    374         depth = 10

KeyError: 'max_depth'

Additional Information:

Python Version: 3.9.12
Operating System: Windows

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

1 participant