giuseppec / giuseppec/iml

Question: Why zeroth and first intervals are grouped together in calculate.ale.num?

Open
#199 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
503
Forks
87
PR merge metrics
No merged PRs in 30d

Description

Hi @christophM, I am trying to implement a simpler function to calculate _ALE_ and allow me to resample (bootstrap or jackknife) and construct some confidence interval around the estimated ALE.

After a two days failing to understand the reasoning for grouping the first two intervals together in line 18 following, I hope it is OK to ask you here for the rationale behind it.

```
18: interval.index[interval.index == 0] <- 1
```

With that, the first two groups are twice as big as the others (given a somewhat uniformly distributed variable) and I was getting an up tick at the very start of the distribution, as in the following image, across several variables and was worried that this could be some sort of side effect of this bigger grouping.

![image](https://user-images.githubusercontent.com/31955632/197294799-1171a3e6-56fd-4ca0-87b7-6070c3d75325.png)

Maybe related: in line 38, 0 is prepended in the cumulated sum vector. Is that relevand or is it just to calculate _middle point_ for each interval, as indicated in the comment?

I appreciate your time and any comment on this matter.
(And really appreciate your book as well!)

-------------
The rest of the function:

https://github.com/christophM/iml/blob/2d18ff4ad87769da8b24a364127181447b5d3791/R/FeatureEffect-ale.R#L6-L60

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.