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

pg 35: XGBoost stump severely underperforming scikit-learn decision tree (xgboost version issue) #22

Open
nasheqlbrm opened this issue Nov 1, 2024 · 0 comments

Comments

@nasheqlbrm
Copy link

In working through, Chapter 5.4, page 35, I was extremely surprised when I saw the XGBoost Stump underperforming the scikit-learn decision tree with a single node. Essentially the XGBoost Stump always predicts 0 (Data Scientist).

I was finally able to figure out that this is an issue for every XGBoost version > 1.7.6 (I tried up till version 2.1.2). In the screenshots below, the first screenshot is where xgboost version 2.1.2 is used, we can see that the accuracy on the test set is 0.5458. The second screenshot is where xgboost version 1.7.6 is used, we can see that the accuracy score on the test set is 0.6243 as in the book.

I am not sure why this is happening but hope this note helps folks working through the book save some head scratching.

xgboost version 2.1.2
Image 11-1-24 at 18 03

xgboost version 1.7.6
Image 11-1-24 at 18 05

@nasheqlbrm nasheqlbrm changed the title pg 35: XGBoost stump severely underperforming scikit-learn decision tree pg 35: XGBoost stump severely underperforming scikit-learn decision tree (xgboost version issue) Nov 1, 2024
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