Skip to content

Commit 0113fb6

Browse files
committed
Fix links linear_model
1 parent e0ee0be commit 0113fb6

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

docs/docs/notebooks/synthetic-examples/01_linear_model.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Hopefully, there is a quantity called **heterogeneity** that can be used to chec
2626

2727
`Effector` provides five different feature effect methods, which are summarized in the table below. In all methods, setting `heterogeneity=True` the methods show the level of heterogeneity, along with the average effect.
2828

29-
<center>
30-
3129
| Method | Description | API in `Effector` | Paper |
3230
|-----------------------------------------|------------------------------------|------------------------------------------------------------------------------|-------------------------------------------------------------------|
3331
| [PDP](#partial-dependence-plot-pdp) | Partial Dependence Plot | [PDP]((./../../reference/#effector.pdp.DerivativePDP)) | [Friedman, 2001](https://statweb.stanford.edu/~jhf/ftp/trebst.pdf) | |
@@ -37,12 +35,8 @@ Hopefully, there is a quantity called **heterogeneity** that can be used to chec
3735
| [SHAP](#shap-dependence-plot) | SHAP Dependence Plot | [SHAPDependence](./../../reference/#effector.shap_dependence.SHAPDependence) | [Lundberg et. al, 2017](https://arxiv.org/pdf/1705.07874.pdf) |
3836

3937

40-
</center>
41-
4238
For the rest of the tutorial, we will use the following notation:
4339

44-
<center>
45-
4640
| Symbol | Description |
4741
|------------------------------------------------------------|---------------------------------------------------------|
4842
| $f(\mathbf{x})$ | The black box model |
@@ -52,23 +46,20 @@ For the rest of the tutorial, we will use the following notation:
5246
| $\mathbf{x} = (x_s, x_c) = (x_1, x_2, ..., x_s, ..., x_D)$ | The input features |
5347
| $\mathbf{x}^{(i)} = (x_s^{(i)}, x_c^{(i)})$ | The $i$-th instance of the dataset |
5448

55-
</center>
5649

5750
---
5851
## Dataset and Model
5952

6053
In this example, we will use as black-box function, a simple linear model $y = 7x_1 - 3x_2 + 4x_3$. Since there are no interactions
6154
terms we expect **all** methods to provide the following feature effects and zero heterogeneity:
6255

63-
<center>
6456

6557
| Feature | Feature Effect | Heterogeneity |
6658
| --- | --- | --- |
6759
| $x_1$ | $7x_1$ | 0 |
6860
| $x_2$ | $-3x_2$ | 0 |
6961
| $x_3$ | $4x_3$ | 0 |
7062

71-
</center>
7263

7364

7465
As dataset, we will generate $N=1000$ examples comming from the following distribution:
@@ -367,14 +358,12 @@ The upper subfigure shows how much the feature of interest _contributes_ to the
367358
For example, for $x_1$ the upper subplot shows a linear effect and the lower subplot confirms that the gradient is constantly $7$.
368359
`Effector` offers two alternatives for centering the ALE plot.
369360

370-
<center>
371361

372362
| `centering` | Description | Formula |
373363
|---------------------------|----------------------------------------|-----------------------------------------------------------------------|
374364
| `False` or `zero_start` | Don't enforce any additional centering | c=0 |
375365
| `True` or `zero_integral` | Center around the $y$ axis | c=$\mathbb{E}_{x_s \sim \mathcal{U(x_{s,min},x_{s, max})}}[ALE(x_s)]$ |
376366

377-
</center>
378367
Let's see how centering works for $x_1$:
379368

380369

@@ -472,15 +461,11 @@ In our example, this advantage is not evident; Since there are no interaction te
472461

473462
As with the ALE, there are two alternatives for centering the ALE plot.
474463

475-
<center>
476-
477464
| `centering` | Description | Formula |
478465
|---------------------------|----------------------------------------|-----------------------------------------------------------------------|
479466
| `False` or `zero_start` | Don't enforce any additional centering | c=0 |
480467
| `True` or `zero-integral` | Center around the $y$ axis | c=$\mathbb{E}_{x_s \sim \mathcal{U(x_{s,min},x_{s, max})}}[ALE(x_s)]$ |
481468

482-
</center>
483-
484469
Let's see how this works for $x_1$:
485470

486471

@@ -547,15 +532,11 @@ effector.ShapDP(data=X, model=predict).plot(feature=0, centering=False, show_avg
547532

548533
TODO add content
549534

550-
<center>
551-
552535
| `centering` | Description | Formula |
553536
|---------------------------|----------------------------------------|-----------------------------------------------------------------------|
554537
| `False` or `zero_start` | Don't enforce any additional centering | c=0 |
555538
| `True` or `zero-integral` | Center around the $y$ axis | c=$\mathbb{E}_{x_s \sim \mathcal{U(x_{s,min},x_{s, max})}}[ALE(x_s)]$ |
556539

557-
</center>
558-
559540
Let's see how this works for $x_1$:
560541

561542

@@ -601,16 +582,12 @@ In summary, given a dataset `X: (N, D)` and a black-box model `model: (N, D) ->
601582
the feature effect plot of the $s$-th feature `feature=s` is given with the table below.
602583
The argument `confidence_interval=True|False` indicates whether to plot the standard deviation of the instance-level effects as $\pm$ interval around the feature effect plot. Some methods also require the gradient of the model `model_jac: (N, D) -> (N, D)`.
603584

604-
<center>
605-
606585
| Method | How to use |
607586
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------|
608-
| PDP | [`effector.PDP(X, model).plot(feature, centering, confidence_interval)`]((./../../reference/#effector.pdp.PDP)) |
609-
| d-PDP | [`effector.DerivativePDP(X, model, model_jac).plot(feature, centering, confidence_interval)`](./../../reference/#effector.pdp.DerivativePDP) |
610-
| ALE | [`effector.ALE(X, model).plot(feature, centering, confidence_interval)`](./../../reference/#effector.ale.ALE) |
611-
| RHALE | [`effector.RHALE(X, model, model_jac).plot(feature, centering, confidence_interval)`](./../../reference/#effector.ale.RHALE) |
612-
613-
</center>
587+
| PDP | [`effector.PDP(X, model).plot(feature, centering, confidence_interval)`](../../../api_docs/api_global/#effector.global_effect_pdp.PDP) |
588+
| d-PDP | [`effector.DerivativePDP(X, model, model_jac).plot(feature, centering, confidence_interval)`](../../../api_docs/api_global/#effector.global_effect_pdp.DerPDP) |
589+
| ALE | [`effector.ALE(X, model).plot(feature, centering, confidence_interval)`](../../../api_docs/api_global/#effector.global_effect_ale.ALE) |
590+
| RHALE | [`effector.RHALE(X, model, model_jac).plot(feature, centering, confidence_interval)`](../../../api_docs/api_global/#effector.global_effect_ale.RHALE) |
614591

615592

616593
```python

0 commit comments

Comments
 (0)