pbiecek / breakDown

Model Agnostics breakDown plots
https://pbiecek.github.io/breakDown/
102 stars 16 forks source link

support for interaction terms #7

Closed holgerbrandl closed 6 years ago

holgerbrandl commented 6 years ago
# works
lmModel = lm(len ~ supp+dose, data = ToothGrowth)

# does not work but would be great
lmModel = lm(len ~ supp*dose, data = ToothGrowth)
broken(lmModel, ToothGrowth[1,])
pbiecek commented 6 years ago

thanks, interactions are handled now

model <- lm(Sepal.Length~Petal.Width*Species, data=iris)
new_observation <- iris[1,]
br <- broken(model, new_observation)
plot(br)

unfortunately, support for other terms is more difficult right now this will not work:

model <- lm(Sepal.Length~log(Petal.Width), data=iris)
holgerbrandl commented 6 years ago

Awesome, thanks a lot for the patch and the library itself.