xgboost icon indicating copy to clipboard operation
xgboost copied to clipboard

SHAP value with refreshed tree.

Open trivialfis opened this issue 3 years ago • 1 comments

Change https://github.com/dmlc/xgboost/blob/d03794ce7a6d5772bd5c3b7d74b7a92557f2e984/demo/guide-python/update_process.py to using CPU, one should be able to reproduce an error:

  File "./demo/guide-python/update_process.py", line 94, in <module>
    main()
  File "./demo/guide-python/update_process.py", line 68, in main
    refreshed_SHAP = refreshed.predict(Xy, pred_contribs=True)
  File "/home/jiaming/Workspace/XGBoost/xgboost/python-package/xgboost/core.py", line 2085, in predict
    _check_call(
  File "/home/jiaming/Workspace/XGBoost/xgboost/python-package/xgboost/core.py", line 250, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
xgboost.core.XGBoostError: [16:27:43] /home/jiaming/Workspace/XGBoost/xgboost/src/tree/tree_model.cc:1322: Check failed: unique_path[i].pweight == 0 (-nan vs. 0) : Unique path 3 must have zero weight
Stack trace:

trivialfis avatar Aug 24 '22 08:08 trivialfis

This bug is still there (current stable) and update_process.py fails with the same error on a gpu-less computer. Does anyone know a workaround?

vograno avatar Mar 02 '25 00:03 vograno