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

[Warning] UserWarning: Using categorical_feature in Dataset. #3718

Closed
ucasiggcas opened this issue Jan 4, 2021 · 7 comments
Closed

[Warning] UserWarning: Using categorical_feature in Dataset. #3718

ucasiggcas opened this issue Jan 4, 2021 · 7 comments

Comments

@ucasiggcas
Copy link

hi,dear all
I tried according to the link docs, but has the warning, could you pls help me ?
train_data = lgb.Dataset(data, label=label, feature_name=['c1', 'c2', 'c3'], categorical_feature=['c3'])

Warning (from warnings module):
  File "D:\python\lib\site-packages\lightgbm\basic.py", line 1291
    warnings.warn('Using categorical_feature in Dataset.')
UserWarning: Using categorical_feature in Dataset.
@StrikerRUS
Copy link
Collaborator

Hi @ucasiggcas !
Everything is fine! This warning is to make you confident that categorical features are not lost. Refer to
#3625 (comment).

@domkm
Copy link

domkm commented Jan 31, 2023

This is extremely odd. I've never come across a library that logs a warning when things are working correctly. I'd recommend at least updating the message to make it clear to the user that nothing is wrong.

@jameslamb
Copy link
Collaborator

This is an open source project, you're welcome to propose a pull request changing its behavior.

@domkm
Copy link

domkm commented Feb 1, 2023

Apologies if my tone was impolite. It was unintentional but, upon rereading, I believe it may have been.

Would a PR to remove this warning be merged?

@jameslamb
Copy link
Collaborator

Thanks for saying that!

Would a PR to remove this warning be merged?

Definitely, I agree with your assessment. But I looked tonight and found that actually...this warning has already been removed from lightgbm.

This issue is a duplicate of #3379, and the warning was removed in #4768 (November 2021).

Unfortunately, most changes merged to master after October 27, 2021 still haven't made it into a release. So if you pip install lightgbm, you may still experience this warning. The fix will be in v4.0.0, the next release of LightGBM. You can follow #5153 to be automatically notified when that release comes out. We apologize for the long delay, and are trying to get that release ready as fast as possiblle.

@domkm
Copy link

domkm commented Feb 1, 2023

That's great! Thank you very much.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants