Skip to content

Commit f8e7bb2

Browse files
docs
1 parent 42dc539 commit f8e7bb2

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# The recommended way to interpret an APLR model
2+
3+
## Main effects
4+
Use the ***get_main_effect_shape*** method to interpret main effects as shown in this [example](https://github.com/ottenbreit-data-science/aplr/blob/main/examples/train_aplr_regression.py). For each main effect, plot the output in a scatter plot.
5+
6+
## Interactions
7+
For best interpretability of interactions, do not use a higher ***max_interaction_level*** than 1. Use the ***calculate_local_contribution_from_selected_terms*** method to interpret interactions as shown in this [example](https://github.com/ottenbreit-data-science/aplr/blob/main/examples/train_aplr_regression.py). For each interaction of interest you can plot the output in a 3D scatter plot.
8+
9+
## Interpretation of model terms and their regression coefficients
10+
For an example on how to interpret the terms in an APLR model, please see ***Section 5.1.3*** in the published article about APLR. You can find this article on [https://link.springer.com/article/10.1007/s00180-024-01475-4](https://link.springer.com/article/10.1007/s00180-024-01475-4) and [https://rdcu.be/dz7bF](https://rdcu.be/dz7bF).

documentation/model_interpretation_example.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/train_aplr_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@
113113
)
114114

115115
# Local (observation specific) contribution to the linear predictor from selected interacting predictors.
116-
# In this example this concerns two-way interaction terms in the model where the second and the third predictors in X interact.
116+
# In this example this concerns two-way interaction terms in the model where the fourth and the seventh predictors in X interact.
117117
# The local contribution will be zero for all observations if there are no such terms in the model.
118118
# The local contribution can help interpreting interactions (or main effects if only one predictor index is specified).
119-
# In this example, the local contribution can be plotted against the predictor values for a visual interpretation.
119+
# For two-way interactions the local contribution can be plotted against the predictor values in a 3D scatter plot.
120120
contribution_from_selected_terms = (
121121
best_model.calculate_local_contribution_from_selected_terms(
122-
X=data_train[predictors], predictor_indexes=[1, 2]
122+
X=data_train[predictors], predictor_indexes=[3, 6]
123123
)
124124
)
125125

0 commit comments

Comments
 (0)