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

Incompatibility Between QuantileDMatrix and xgboost.cv Function #11185

Open
hugocool opened this issue Jan 26, 2025 · 1 comment
Open

Incompatibility Between QuantileDMatrix and xgboost.cv Function #11185

hugocool opened this issue Jan 26, 2025 · 1 comment

Comments

@hugocool
Copy link

I have encountered an issue when attempting to perform cross-validation using the xgboost.cv function with a QuantileDMatrix as input. The operation results in the following error:

XGBoostError: [17:29:55] /workspace/src/data/iterative_dmatrix.h:88: Slicing DMatrix is not supported for Quantile DMatrix.
Stack trace:
  [bt] (0) /opt/pysetup/.venv/lib/python3.10/site-packages/xgboost/lib/libxgboost.so(+0x22dcbc) [0x7f7553e2dcbc]
  [bt] (1) /opt/pysetup/.venv/lib/python3.10/site-packages/xgboost/lib/libxgboost.so(+0x525d31) [0x7f7554125d31]
  [bt] (2) /opt/pysetup/.venv/lib/python3.10/site-packages/xgboost/lib/libxgboost.so(XGDMatrixSliceDMatrixEx+0x15b) [0x7f7553d448cb]
  [bt] (3) /usr/lib/x86_64-linux-gnu/libffi.so.8(+0x7e2e) [0x7f76ce294e2e]
  [bt] (4) /usr/lib/x86_64-linux-gnu/libffi.so.8(+0x4493) [0x7f76ce291493]
  [bt] (5) /opt/pyenv/versions/3.10.12/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0x12ea5) [0x7f76cdcf0ea5]
  [bt] (6) /opt/pyenv/versions/3.10.12/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0xc940) [0x7f76cdcea940]
  [bt] (7) /opt/pyenv/versions/3.10.12/lib/libpython3.10.so.1.0(_PyObject_MakeTpCall+0x8c) [0x7f76d4175e8c]
  [bt] (8) /opt/pyenv/versions/3.10.12/lib/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x8f84) [0x7f76d4122ed4]

Steps to Reproduce:

  1. Create a QuantileDMatrix from a dataset.
  2. Attempt to perform cross-validation using xgboost.cv with this QuantileDMatrix.

Expected Behavior:

The xgboost.cv function should either:

  • Support cross-validation with QuantileDMatrix.
  • Clearly document that QuantileDMatrix is incompatible with xgboost.cv and provide guidance on alternative approaches.

Environment Details:

  • XGBoost version: 2.1.3
  • Python version: 3.10
  • Operating System: ubuntu 24

Additional Information:

This issue arises because QuantileDMatrix does not support slicing operations, which are integral to the cross-validation process in xgboost.cv. While alternative approaches exist, such as using the standard DMatrix or implementing custom cross-validation, it would be beneficial for users if the library either supported this functionality or provided clear documentation regarding this limitation.

@trivialfis
Copy link
Member

Thank you for raising the issue. We are looking for suggestions on how to design a new CV interface #11000

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

2 participants