iml icon indicating copy to clipboard operation
iml copied to clipboard

plotting FeatureEffect object

Open Lukpawlik opened this issue 4 years ago • 4 comments

Hi, I want to plot only one column of FeatureEffect object (ALE plot). New iml seems to have this argument (ncols) but after installing from Github (iml version 0.10.1.9000) there is still no such possibility of plotting. How can I solve it? Best, Lukasz

Lukpawlik avatar Sep 14 '21 06:09 Lukpawlik

Do you mean FeatureEffect or FeatureEffects? For FeatureEffects there should be an option ncol

christophM avatar Sep 14 '21 07:09 christophM

True, I mixed that up. I will try with FeatureEffects. Thanks

Lukpawlik avatar Sep 14 '21 07:09 Lukpawlik

Ok., now I can explain in better, I hope. I need only a left side of each ALE plot; only results for the positive class of the response variable under the impact of a given predictor. What I mean is that the two panels of ALE plot mirror each other and according to one reviewer the right panel is redundant. I'm trying to remove the right panel but so far have not found an appropriate solution. Thanks image

Lukpawlik avatar Sep 14 '21 09:09 Lukpawlik

Hi, @Lukpawlik , for the two classes task,you can try to focus on one class,like:

x = test[which(names(test) != "dam")] #
model_1 = Predictor$new(ranger_learner, data = x, y = test$dam, type = "prob", class = "1") # focus on the class 1 dam 
model <- Predictor$new(ranger_learner, data = x, y = test$dam, type = "prob") # this will creat a mirror plot in Feature Effects,but would be useful when calling the FeatureImp.

# Feature Effects
effect_FE = FeatureEffects$new(predictor = model_1, method = "ale")  # you might also want to try other method like ”ice“ 
plot(effect_FE)

# FeatureImp
effect_FI = FeatureImp$new(model, loss = "ce")
effect_FI$plot(features = num_features)

ljhburn avatar Sep 17 '21 08:09 ljhburn