Skip to content

Commit 2657075

Browse files
thomaspinderThomas Pinder
andauthored
Multiple Datasets Placebo Testing (#15)
* This PR adds support for multiple datasets to be passed to the `PlaceboTesting` object. * Bump to v0.0.7 * Fix ruff issues --------- Co-authored-by: Thomas Pinder <[email protected]>
1 parent 167efb4 commit 2657075

File tree

11 files changed

+313
-97
lines changed

11 files changed

+313
-97
lines changed

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
# python code formatting
3+
- repo: https://github.com/psf/black
4+
rev: 23.12.1
5+
hooks:
6+
- id: black
7+
args: ["--config", "pyproject.toml"]
8+
9+
# python import sorting
10+
- repo: https://github.com/PyCQA/isort
11+
rev: 5.12.0
12+
hooks:
13+
- id: isort
14+
args: ["--settings-path", "pyproject.toml"]
15+
16+
# remove notebook cell output
17+
- repo: https://github.com/kynan/nbstripout
18+
rev: 0.7.1
19+
hooks:
20+
- id: nbstripout
21+
files: ".ipynb"

docs/examples/azcausal.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "153aaca2",
5+
"id": "0",
66
"metadata": {},
77
"source": [
88
"# AZCausal Integration\n",
@@ -17,7 +17,7 @@
1717
{
1818
"cell_type": "code",
1919
"execution_count": null,
20-
"id": "b134b49f",
20+
"id": "1",
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
@@ -40,7 +40,7 @@
4040
{
4141
"cell_type": "code",
4242
"execution_count": null,
43-
"id": "86ba26f3",
43+
"id": "2",
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
@@ -58,7 +58,7 @@
5858
},
5959
{
6060
"cell_type": "markdown",
61-
"id": "ae979b7b",
61+
"id": "3",
6262
"metadata": {
6363
"title": "We'll now simulate a 5% lift in the treatment group's observations. This"
6464
},
@@ -69,7 +69,7 @@
6969
{
7070
"cell_type": "code",
7171
"execution_count": null,
72-
"id": "45f9e99f",
72+
"id": "4",
7373
"metadata": {},
7474
"outputs": [],
7575
"source": [
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"cell_type": "markdown",
84-
"id": "0ff7c192",
84+
"id": "5",
8585
"metadata": {},
8686
"source": [
8787
"## Fitting a model\n",
@@ -98,7 +98,7 @@
9898
{
9999
"cell_type": "code",
100100
"execution_count": null,
101-
"id": "db0f85d8",
101+
"id": "6",
102102
"metadata": {},
103103
"outputs": [],
104104
"source": [
@@ -111,7 +111,7 @@
111111
},
112112
{
113113
"cell_type": "markdown",
114-
"id": "5c71b479",
114+
"id": "7",
115115
"metadata": {
116116
"title": "We see that SDID has done an excellent job of estimating the treatment"
117117
},
@@ -141,7 +141,7 @@
141141
{
142142
"cell_type": "code",
143143
"execution_count": null,
144-
"id": "59d6a88b",
144+
"id": "8",
145145
"metadata": {},
146146
"outputs": [],
147147
"source": [
@@ -168,7 +168,7 @@
168168
},
169169
{
170170
"cell_type": "markdown",
171-
"id": "5268b01a",
171+
"id": "9",
172172
"metadata": {
173173
"title": "As before, we may now go about estimating the treatment. However, this"
174174
},
@@ -180,7 +180,7 @@
180180
{
181181
"cell_type": "code",
182182
"execution_count": null,
183-
"id": "71d101a2",
183+
"id": "10",
184184
"metadata": {},
185185
"outputs": [],
186186
"source": [

docs/examples/basic.ipynb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "a9b6f601",
5+
"id": "0",
66
"metadata": {},
77
"source": [
88
"# Data Synthesis\n",
@@ -17,7 +17,7 @@
1717
{
1818
"cell_type": "code",
1919
"execution_count": null,
20-
"id": "8c2cf50c",
20+
"id": "1",
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
@@ -45,15 +45,15 @@
4545
},
4646
{
4747
"cell_type": "markdown",
48-
"id": "cbb57d70",
48+
"id": "2",
4949
"metadata": {},
5050
"source": [
5151
"## Simulating a Dataset"
5252
]
5353
},
5454
{
5555
"cell_type": "markdown",
56-
"id": "1c5651e5",
56+
"id": "3",
5757
"metadata": {
5858
"title": "Simulating a dataset is as simple as specifying a `Config` object and"
5959
},
@@ -65,7 +65,7 @@
6565
{
6666
"cell_type": "code",
6767
"execution_count": null,
68-
"id": "c82c01a7",
68+
"id": "4",
6969
"metadata": {},
7070
"outputs": [],
7171
"source": [
@@ -82,7 +82,7 @@
8282
},
8383
{
8484
"cell_type": "markdown",
85-
"id": "dba7ba2f",
85+
"id": "5",
8686
"metadata": {},
8787
"source": [
8888
"### Controlling baseline behaviour\n",
@@ -96,7 +96,7 @@
9696
{
9797
"cell_type": "code",
9898
"execution_count": null,
99-
"id": "812519eb",
99+
"id": "6",
100100
"metadata": {},
101101
"outputs": [],
102102
"source": [
@@ -118,7 +118,7 @@
118118
},
119119
{
120120
"cell_type": "markdown",
121-
"id": "c0659585",
121+
"id": "7",
122122
"metadata": {},
123123
"source": [
124124
"### Reproducibility\n",
@@ -132,7 +132,7 @@
132132
{
133133
"cell_type": "code",
134134
"execution_count": null,
135-
"id": "f686bbca",
135+
"id": "8",
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
@@ -146,7 +146,7 @@
146146
},
147147
{
148148
"cell_type": "markdown",
149-
"id": "5738874c",
149+
"id": "9",
150150
"metadata": {},
151151
"source": [
152152
"Reusing the same config file across simulations"
@@ -155,7 +155,7 @@
155155
{
156156
"cell_type": "code",
157157
"execution_count": null,
158-
"id": "8d1a815e",
158+
"id": "10",
159159
"metadata": {},
160160
"outputs": [],
161161
"source": [
@@ -167,7 +167,7 @@
167167
},
168168
{
169169
"cell_type": "markdown",
170-
"id": "be5854b1",
170+
"id": "11",
171171
"metadata": {},
172172
"source": [
173173
"Or manually specifying and passing your own pseudorandom number generator key"
@@ -176,7 +176,7 @@
176176
{
177177
"cell_type": "code",
178178
"execution_count": null,
179-
"id": "0a654697",
179+
"id": "12",
180180
"metadata": {},
181181
"outputs": [],
182182
"source": [
@@ -190,7 +190,7 @@
190190
},
191191
{
192192
"cell_type": "markdown",
193-
"id": "c0822e35",
193+
"id": "13",
194194
"metadata": {},
195195
"source": [
196196
"### Simulating an effect\n",
@@ -205,7 +205,7 @@
205205
{
206206
"cell_type": "code",
207207
"execution_count": null,
208-
"id": "582df29b",
208+
"id": "14",
209209
"metadata": {},
210210
"outputs": [],
211211
"source": [
@@ -218,7 +218,7 @@
218218
},
219219
{
220220
"cell_type": "markdown",
221-
"id": "4b521ffa",
221+
"id": "15",
222222
"metadata": {},
223223
"source": [
224224
"### More complex generation processes\n",
@@ -231,7 +231,7 @@
231231
{
232232
"cell_type": "code",
233233
"execution_count": null,
234-
"id": "842e65ee",
234+
"id": "16",
235235
"metadata": {},
236236
"outputs": [],
237237
"source": [
@@ -243,7 +243,7 @@
243243
{
244244
"cell_type": "code",
245245
"execution_count": null,
246-
"id": "320d2695",
246+
"id": "17",
247247
"metadata": {},
248248
"outputs": [],
249249
"source": [
@@ -254,7 +254,7 @@
254254
},
255255
{
256256
"cell_type": "markdown",
257-
"id": "324ae45a",
257+
"id": "18",
258258
"metadata": {},
259259
"source": [
260260
"We may also include periodic components in our data"
@@ -263,7 +263,7 @@
263263
{
264264
"cell_type": "code",
265265
"execution_count": null,
266-
"id": "d802fefc",
266+
"id": "19",
267267
"metadata": {},
268268
"outputs": [],
269269
"source": [
@@ -274,7 +274,7 @@
274274
},
275275
{
276276
"cell_type": "markdown",
277-
"id": "5672c0ae",
277+
"id": "20",
278278
"metadata": {},
279279
"source": [
280280
"### Unit-level parameterisation"
@@ -283,7 +283,7 @@
283283
{
284284
"cell_type": "code",
285285
"execution_count": null,
286-
"id": "85343d57",
286+
"id": "21",
287287
"metadata": {},
288288
"outputs": [],
289289
"source": [
@@ -297,7 +297,7 @@
297297
{
298298
"cell_type": "code",
299299
"execution_count": null,
300-
"id": "af121f9f",
300+
"id": "22",
301301
"metadata": {},
302302
"outputs": [],
303303
"source": [
@@ -310,7 +310,7 @@
310310
},
311311
{
312312
"cell_type": "markdown",
313-
"id": "dde5a4db",
313+
"id": "23",
314314
"metadata": {},
315315
"source": [
316316
"## Conclusions\n",

0 commit comments

Comments
 (0)