Closed nspyrison closed 9 months ago
Not sure if there are other modeling functions to look out for, but maybe something like:
unify <- function(model, x){ .cl <- class(model) if("randomForest" %in% .cl){ ret <- randomForest.unify(model, x) }else if("ranger" %in% .cl){ ret <- ranger.unify(model, x) }else if("gbm" %in% .cl){ ret <- gbm.unify(model, x) }else if("xgb.Booster" %in% .cl){ ret <- xgboost.unify(model, x) }else if("lgb.Booster" %in% .cl){ ret <- lightgbm.unify(model, x) }else if("catboost.Model" %in% .cl){ ret <- catboost.unify(model, x) }else stop("Model is not a treeshap supported model.") ret }
Great idea, I've implemented it in #30
Not sure if there are other modeling functions to look out for, but maybe something like: