diff --git a/src/model_loader/detail/xgboost_json/delegated_handler.cc b/src/model_loader/detail/xgboost_json/delegated_handler.cc index 71ea12b5..df9c4111 100644 --- a/src/model_loader/detail/xgboost_json/delegated_handler.cc +++ b/src/model_loader/detail/xgboost_json/delegated_handler.cc @@ -518,6 +518,8 @@ bool GBTreeModelHandler::StartArray() { return (push_key_handler>( "trees", reg_tree_params, *output.builder) || push_key_handler, std::vector>("tree_info", output.tree_info) + || push_key_handler, std::vector>( + "weight_drop", output.weight_drop) || push_key_handler("iteration_indptr")); } @@ -546,7 +548,7 @@ bool GBTreeModelHandler::EndObject() { } bool GBTreeModelHandler::is_recognized_key(std::string const& key) { - return key == "trees" || key == "tree_info" || key == "gbtree_model_param" + return key == "trees" || key == "tree_info" || key == "gbtree_model_param" || key == "weight_drop" || key == "iteration_indptr" || key == "cats"; } @@ -710,7 +712,7 @@ bool GradientBoosterHandler::StartArray() { } bool GradientBoosterHandler::EndObject() { - if (name == "dart" && !weight_drop.empty()) { + if (!weight_drop.empty()) { TREELITE_CHECK_EQ(output.size_leaf_vector, 1) << "Dart with vector-leaf output is not yet supported"; output.weight_drop = weight_drop; diff --git a/tests/python/test_xgboost_integration.py b/tests/python/test_xgboost_integration.py index b59f7c42..051856ec 100644 --- a/tests/python/test_xgboost_integration.py +++ b/tests/python/test_xgboost_integration.py @@ -290,7 +290,6 @@ def test_xgb_nonlinear_objective( num_boost_round=integers(min_value=5, max_value=20), ) @settings(**standard_settings()) -@pytest.mark.xfail(reason="https://github.com/dmlc/treelite/issues/668") def test_xgb_dart(dataset, model_format, num_boost_round): # pylint: disable=too-many-locals """Test XGBoost DART model with dummy data"""