From 98976a035ac3a429eeb4af25b77c8c10a1844986 Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Wed, 21 Jan 2026 11:23:20 +0100 Subject: [PATCH] rename gain column if necessary --- R/glex.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/glex.R b/R/glex.R index 6b385d6..85f73e8 100644 --- a/R/glex.R +++ b/R/glex.R @@ -119,6 +119,9 @@ glex.xgb.Booster <- function(object, x, max_interaction = NULL, features = NULL, # Convert model trees <- xgboost::xgb.model.dt.tree(model = object, use_int_id = TRUE) trees$Type <- "<" + if ("Gain" %in% colnames(trees)) { + data.table::setnames(trees, "Gain", "Quality") + } # Calculate components res <- calc_components(trees, x, max_interaction, features, weighting_method, max_background_sample_size)