You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I found an error between predicted probability and probability derived from the explainer.
In the sample data set (agaricus) it is between -0.015 and -0.017. For other data sets error could be higher than 0.1.
Is it normal or there are ways to avoid this error?
Reproducible example:
library(lightgbm) # v2.1.0 or above
library(lightgbmExplainer)
set.seed(12345)
Hi! I found an error between predicted probability and probability derived from the explainer.
In the sample data set (agaricus) it is between -0.015 and -0.017. For other data sets error could be higher than 0.1.
Is it normal or there are ways to avoid this error?
Reproducible example:
library(lightgbm) # v2.1.0 or above
library(lightgbmExplainer)
set.seed(12345)
Load Data
data(agaricus.train, package = "lightgbm")
Train a model
lgb.dtrain <- lgb.Dataset(agaricus.train$data, label = agaricus.train$label)
lgb.params <- list(objective = "binary")
lgb.model <- lgb.train(lgb.params, lgb.dtrain, 5)
Build Explainer
lgb.trees <- lgb.model.dt.tree(lgb.model) # First get a lgb tree
explainer <- buildExplainer(lgb.trees)
compute contribution for each data point
pred.breakdown <- explainPredictions(lgb.model, explainer, agaricus.train$data)
Show waterfall for the 8th observation
showWaterfall(lgb.model, explainer, lgb.dtrain, agaricus.train$data, 8, type = "binary")
should be close to zero
predict(lgb.model,agaricus.train$data)[8] - (exp(sum(pred.breakdown[8,]))/(exp(sum(pred.breakdown[8,])) + 1))
obvious bias in errors
plot(predict(lgb.model,agaricus.train$data) - (exp(rowSums(pred.breakdown))/(exp(rowSums(pred.breakdown)) + 1)))
The text was updated successfully, but these errors were encountered: