import pointblank as pb
import polars as pl
temps = [20 + (k * 37 % 11 - 5) * 0.6 for k in range(300)]
for k in range(0, 300, 25):
temps[k] *= 10
readings = pl.DataFrame({"temp": temps})
def evaluate(train, *, seed):
sample = train.sample(fraction=1.0, with_replacement=True, seed=seed)
return abs(sample["temp"].mean() - 20)
validation = (
pb.Validate(data=readings)
.col_vals_between(columns="temp", left=-10, right=45)
.col_vals_lt(columns="temp", value=200)
.interrogate()
)
ablation = (
pb.Ablation(validation, evaluate=evaluate, metric="error", higher_is_better=False)
.drop_each()
.drop_all_but_each()
.run()
)
ablation| Ablation report | |||
error on the full table (300 rows): 7.392 ± 2.207 (lower is better). Each version was evaluated 5 times; Δ is the mean paired difference from removing the same number of random rows. For leaving one out, Δ is what the left-out step's rows add to the other steps: removing every step's rows, compared with removing the other steps' rows, plus as many random rows. |
|||
| Variant | Removed | error | Δ vs random |
|---|---|---|---|
| Variants | |||
Step 1 Expect that values in temp should be between -10 and 45. |
12 4.0% |
0.109 ± 0.080 Δ vs full −7.283 |
−6.901 [−8.634, −5.168] helps |
Step 2 Expect that values in temp should be < 200. |
6 2.0% |
3.449 ± 1.759 Δ vs full −3.943 |
−3.706 [−4.900, −2.512] helps |
All steps 1: Expect that values in temp should be between -10 and 45.2: Expect that values in temp should be < 200. |
12 4.0% |
0.109 ± 0.080 Δ vs full −7.283 |
−6.901 [−8.634, −5.168] helps |
| Leave one out | |||
All steps but step 1 Leaves out step 1: Expect that values in temp should be between -10 and 45.Same rows as Step 2, so it isn't evaluated again |
6 2.0% |
3.449 ± 1.759 Δ vs full −3.943 |
−2.871 [−4.561, −1.181] helps |
All steps but step 2 Leaves out step 2: Expect that values in temp should be < 200.Same rows as Step 1, so it isn't evaluated again |
12 4.0% |
0.109 ± 0.080 Δ vs full −7.283 |
+0.000 [+0.000, +0.000] redundant |
| Intervals are 95% paired t-intervals, not adjusted for multiple comparisons; verdicts use Holm-adjusted p-values. | |||