question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add label encoder to XGBoostClassifier

See original GitHub issue

I currently get the following DeprecationWarning with XGBoost==1.4.2:

  The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].

Since I know we want to upgrade XGBoost to >1.4.2 for the pandas 1.3.0 release, it could be a good idea to address this too, sooner rather than later 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
kadatatlukishorecommented, Jul 20, 2021

Thanks @angela97lin ! Will start working on this.

2reactions
angela97lincommented, Jul 22, 2021

No problem, always excited to have new contributors!

Read more comments on GitHub >

github_iconTop Results From Across the Web

XGBoost using Label Encoder - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from Google Analytics Customer Revenue Prediction.
Read more >
Xgboost with Different Categorical Encoding Methods - Xia Song
Label encoding is used to transform categorical values into numerical values. ... Split data into training data set and test data set. ......
Read more >
Support GPU input in `XGBClassifier`; deprecate the use of ...
Any data set works, just choose for creditcard.csv . ... Right now, XGBClassifier uses sklearn's label encoder to map the labels to 0....
Read more >
XGBoost Categorical Variables: Dummification vs encoding
I want to answer this question not just in terms of XGBoost but in terms of any problem dealing with categorical data. While...
Read more >
Data Preparation for Gradient Boosting with XGBoost in Python
We can easily convert the string values to integer values using the LabelEncoder. The three class values (Iris-setosa, Iris-versicolor, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found