Skip to content

Comments

[Feature] Add XGBoost classifier test-function for tabular ML#17

Open
Shruti1128 wants to merge 9 commits intoSimonBlanke:mainfrom
Shruti1128:add-xgboost-tabular-test
Open

[Feature] Add XGBoost classifier test-function for tabular ML#17
Shruti1128 wants to merge 9 commits intoSimonBlanke:mainfrom
Shruti1128:add-xgboost-tabular-test

Conversation

@Shruti1128
Copy link

@Shruti1128 Shruti1128 commented Feb 14, 2026

Description

Related Issues

Type of Change

  • [BUG] - Bug fix (non-breaking change fixing an issue)
  • [ENH] - New feature (non-breaking change adding functionality)
  • [DOC] - Documentation only
  • [MNT] - Maintenance (refactoring, dependencies, CI)

How was this solved?

Checklist

Required

  • PR title includes appropriate tag: [BUG], [ENH], [DOC] or [MNT]
  • Code passes make check (lint, format, isort)

Tests

  • Tests added/updated for changes
  • No tests needed (briefly explain why: _______)

Documentation

  • Documentation added/updated (docstrings, user guide, examples)
  • No documentation needed (briefly explain why: _______)

Note: New features ([ENH]) typically require both tests and documentation.
Bug fixes ([BUG]) should include a regression test when possible.

Testing

Additional Notes

@Shruti1128
Copy link
Author

Happy to adjust the search space or naming if needed.
Let me know if any changes are required.

@Shruti1128 Shruti1128 closed this Feb 14, 2026
@Shruti1128 Shruti1128 reopened this Feb 14, 2026
Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR.

  • We also need this new class in the init.py files further up.
  • It must be added to the ml dependencies.
  • Tests and documentation should also be added.

@Shruti1128
Copy link
Author

Thanks for the feedback!
I’ve now:
Exposed the class in the higher init.py files.
Added xgboost to the ML optional dependencies.
Added a smoke test for XGBoostClassifierFunction.

Please let me know if anything else should be adjusted.

Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some tests are still failing. What is the reason for the failing tests

@Shruti1128
Copy link
Author

The failing tests are caused by XGBoost receiving integer hyperparameters (e.g., n_estimators, max_depth) as numpy.float64 values during full test evaluation. Although the search space contains integer values, Surfaces' parameter handling may convert them to floats internally.
XGBoost expects native Python integers for parameters such as n_estimators, which leads to a TypeError during training when a float is passed.
I am working on enforcing proper integer casting before model instantiation to resolve this issue.

@Shruti1128
Copy link
Author

Hi Simon,
The earlier failures were due to incorrect parameter casting in the XGBoost objective function (learning_rate was being cast to int, and indentation caused issues). I’ve fixed the type casting and corrected the objective definition.
The latest commit addresses this. Please let me know if anything else needs adjustment.

Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pass, which is great. But you should look how the import paths are for other machine-learning functions. This xgboost test function should be importable in the same way:
https://github.com/SimonBlanke/Surfaces/blob/main/src/surfaces/test_functions/machine_learning/__init__.py
Also change the test import path, then.

@SimonBlanke
Copy link
Owner

There are some conflicts that must be resolved from a recent merge.

@Shruti1128
Copy link
Author

I’ve resolved the merge conflicts and updated the import structure so that XGBoostClassifierFunction is exposed consistently with the other ML functions. I also adjusted the test import path accordingly. Please let me know if anything else should be changed.

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

Successfully merging this pull request may close these issues.

2 participants