Git Product home page Git Product logo

Comments (5)

hbaniecki avatar hbaniecki commented on August 28, 2024

Hi,
I have a minimal example of the change in variable order:

library("DALEX")
library("iBreakDown")
set.seed(1313)
model_titanic_glm <- glm(survived ~ .,
                         data = titanic_imputed, family = "binomial")
explain_titanic_glm <- explain(model_titanic_glm,
                               data = titanic_imputed[,-8],
                               y = titanic_imputed$survived,
                               label = "glm")

bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=6:1)
bd_glm

bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=1:6)
bd_glm

bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=c('age:gender', 'class', 'embarked', 'fare', 'sibsp'))
bd_glm

bd_glm <- local_interactions(explain_titanic_glm, titanic_imputed[1, ], order=c('age:gender', 'embarked:class', 'sibsp:fare'))
bd_glm

Estimation of SHAP by repeating contributions over different orders is possible using the shap function:
https://modeloriented.github.io/iBreakDown/reference/break_down_uncertainty.html
More on the topic of these methods can be found in the EMA e-book http://ema.drwhy.ai/shapley.html

from ibreakdown.

aruaud avatar aruaud commented on August 28, 2024

Thanks Hubert! I tried your example and it indeed works fine :) However, when passing an order with all variables and possible interactions, I do not get any interaction anymore but only the contributions of single variables. Is it that not all interactions can be passed to the function?

And thanks for pointing to the shap() function! I had been using it but could not find how to calculate SHAP values for interactions with it? This is why I switched to the local_interaction() function..

from ibreakdown.

hbaniecki avatar hbaniecki commented on August 28, 2024

I believe that each variable can be mentioned only once e.g. if 'age' is apparent, then 'age:gender' cannot be used. Additionally, I see that when passing interactions as strings, only one name convention is possible e.g. 'age:gender' not 'gender:age'.

As for SHAP with interactions, I think that it would be a great feature/method to consider.

from ibreakdown.

aruaud avatar aruaud commented on August 28, 2024

I see, thanks Hubert for the clarification! And so not all pairwise interactions can be assessed nor single and interactions.. That could also be a nice feature too :)
Looking forward to the shap interactions!

from ibreakdown.

hbaniecki avatar hbaniecki commented on August 28, 2024

I think this could remain open

from ibreakdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.