ModelOriented / ModelOriented/DALEX

Adding partial derivative and partial log-derivative

Open
#347 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature 💡 long term 📆 looking for help R 🐳
Dominant language
Python
Stars
1.5k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

I think it could useful a function to calculate numerically not just the partial plot of the predictor, like in the function variable_effect_partial_dependency , but also the partial derivative of the predictor for the additive effect:

\begin{equation*}
\frac{\partial f(X)}{\partial X_j}=\lim_{h \to 0} \frac{f(X_j+h| \ X_{-j}) - f(X)}{h} ,
\end{equation*}

and the logarithmic partial derivative for the multiplicative effect:

\begin{equation*}
\frac{\partial log(f(X))}{\partial X_j}=\lim_{h \to 0} \frac{log(f(X_j+h| \ X_{-j})) - log(f(X))}{h} ,
\end{equation*}

It could be possible to calculate it like tha partial response in the variable_effect_partial_dependency function: fixing all other covariates and changing just X_j.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked variable_effect_partial_dependency function and the surrounding model-interpretability API. Define how numerical partial and logarithmic partial derivatives should be exposed, including edge cases for finite differences and logarithms, then add tests showing that changing only X_j produces the expected results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.