Skip to content

Commit 90275bd

Browse files
committed
work on online appendix. Just need to finish mitigation strats and sort out tables.
1 parent 0e00724 commit 90275bd

87 files changed

Lines changed: 5080 additions & 8142 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.qmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ repository:
1616

1717
- [Paper](paper/paper.pdf)
1818
- [Notebooks](dev/notebooks/)
19+
- [Supplementary Appendix](build/dev/notebooks/appendix.html) (download the HTML and view in browser)
1920
- [Artifacts](https://github.com/pat-alt/AlgorithmicRecourseDynamics.jl/releases/tag/artifacts) (including data and experimental results)
2021

2122
In this work we investigate what happens if Algorithmic Recourse is actually implemented by a large number of individuals. The chart below illustrates what we mean by Endogenous Macrodynamics in Algorithmic Recourse: (a) we have a simple linear classifier trained for binary classification where samples from the negative class ($y=0$) are marked in blue and samples of the positive class ($y=1$) are marked in orange; (b) the implementation of AR for a random subset of individuals leads to a noticable domain shift; (c) as the classifier is retrained we observe a corresponding model shift; (d) as this process is repeated, the decision boundary moves away from the target class.

_freeze/dev/notebooks/appendix/execute-results/html.json

Lines changed: 15 additions & 0 deletions
Large diffs are not rendered by default.

_quarto.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
project:
2+
title: "AlgorithmicRecourseDynamics.jl"
3+
output-dir: build
4+
execute-dir: project
5+
filters:
6+
- lua/abstract-to-meta.lua
7+
- quarto
8+
bibliography: https://raw.githubusercontent.com/pat-alt/bib/main/bib.bib
9+
execute:
10+
freeze: auto # re-render only when source changes
11+
12+
13+

build/dev/notebooks/appendix.html

Lines changed: 4856 additions & 0 deletions
Large diffs are not rendered by default.

dev/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/_quarto.yml

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

dev/_variables.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ This is a supplementary appendix to the research paper **Endogenous Macrodynamic
1515

1616
# Experimental Results {#sec-results}
1717

18-
{{< include ../dev/notebooks/experiments/synthetic.qmd >}}
18+
{{< include experiments/synthetic.qmd >}}
1919

20-
{{< include ../dev/notebooks/experiments/real_world.qmd >}}
20+
{{< include experiments/real_world.qmd >}}
2121

22-
{{< include ../dev/notebooks/experiments/mitigation_strategies.qmd >}}
22+
{{< include experiments/mitigation_strategies.qmd >}}
2323

2424
# Generators {#sec-generators}
2525

26-
{{< include ../dev/notebooks/generators/gravitational_generator.qmd >}}
26+
{{< include generators/gravitational_generator.qmd >}}
2727

28-
{{< include ../dev/notebooks/generators/clap_roar_generator.qmd >}}
28+
{{< include generators/clap_roar_generator.qmd >}}

dev/notebooks/experiments/mitigation_strategies.qmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
## Mitigation Strategies
22

33
```{julia}
4+
#| eval: true
45
using Pkg; Pkg.activate("dev")
56
```
67

78
```{julia}
9+
#| eval: true
810
include("dev/utils.jl")
911
using AlgorithmicRecourseDynamics
1012
using CounterfactualExplanations, Flux, Plots, PlotThemes, Random, LaplaceRedux, LinearAlgebra
@@ -28,7 +30,7 @@ generators = Dict(
2830
)
2931
```
3032

31-
## Synthetic
33+
### Synthetic
3234

3335
```{julia}
3436
max_obs = 1000

dev/notebooks/experiments/real_world.qmd

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
## Real-World Data
22

33
```{julia}
4+
#| eval: true
45
using Pkg; Pkg.activate("dev")
56
```
67

78
```{julia}
9+
#| eval: true
810
include("dev/utils.jl")
911
using AlgorithmicRecourseDynamics
1012
using CounterfactualExplanations, Flux, Plots, PlotThemes, Random, LaplaceRedux, LinearAlgebra
1113
theme(:wong)
1214
output_path = output_dir("real_world")
13-
www_path = www_dir("real_world")
15+
www_path = www_dir("real_world");
1416
```
1517

1618
```{julia}
@@ -58,7 +60,7 @@ experiments = set_up_experiments(
5860
)
5961
```
6062

61-
## Running Experiment
63+
### Experiment
6264

6365
```{julia}
6466
n_evals = 5
@@ -78,6 +80,8 @@ results = run_experiments(
7880
Serialization.serialize(joinpath(output_path,"results.jls"),results)
7981
```
8082

83+
### Plots
84+
8185
```{julia}
8286
using Serialization
8387
results = Serialization.deserialize(joinpath(output_path,"results.jls"))
@@ -97,8 +101,50 @@ for (data_name, res) in results
97101
end
98102
```
99103

104+
#### Line Charts
105+
106+
@fig-real-line shows the evolution of the evaluation metrics over the course of the experiment.
107+
108+
```{julia}
109+
#| eval: true
110+
#| fig-cap: "Line Charts"
111+
#| fig-subcap:
112+
#| - "California Housing"
113+
#| - "Credit Default"
114+
#| - "GMSC"
115+
#| layout-ncol: 1
116+
#| label: fig-real-line
117+
img_files = readdir(www_path)[contains.(readdir(www_path),"line_chart")]
118+
img_files = joinpath.(www_path,img_files)
119+
for img in img_files
120+
display(load(img))
121+
end
122+
```
123+
124+
#### Error Bar Charts
125+
126+
@fig-real-error shows the evaluation metrics at the end of the experiments.
127+
128+
```{julia}
129+
#| eval: true
130+
#| fig-cap: "Error Bar Charts"
131+
#| fig-subcap:
132+
#| - "California Housing"
133+
#| - "Credit Default"
134+
#| - "GMSC"
135+
#| layout-ncol: 1
136+
#| label: fig-real-error
137+
img_files = readdir(www_path)[contains.(readdir(www_path),"errorbar_chart")]
138+
img_files = joinpath.(www_path,img_files)
139+
for img in img_files
140+
display(load(img))
141+
end
142+
```
143+
100144
### Chart in paper
101145

146+
@fig-real-paper shows the chart that went into the paper.
147+
102148
```{julia}
103149
using DataFrames, Statistics
104150
model_ = :FluxEnsemble
@@ -156,6 +202,13 @@ img = Images.load(rcopy(R"temp_path"))
156202
Images.save(joinpath(www_path,"paper_real_world_results.png"), img)
157203
```
158204

205+
```{julia}
206+
#| label: fig-real-paper
207+
#| fig-cap: "Chart in paper"
208+
#| eval: true
209+
Images.load(joinpath(www_path,"paper_real_world_results.png"))
210+
```
211+
159212

160213

161214

0 commit comments

Comments
 (0)