Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified benchmark/results/figures/sweep-cost-services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark/results/figures/sweep-cost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark/results/figures/sweep-phases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark/results/figures/sweep-scaling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark/results/figures/sweep-selected-phases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
328 changes: 298 additions & 30 deletions benchmark/results/phase-timings.csv

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions benchmark/results/raw/archive/sweep-1794747702.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"tree": "rads",
"dataset": "ehealth",
"algorithm_id": "e587067e-47dc-4835-8f87-5e66fc979adf",
"rep": 1,
"size": 10000,
"seconds": 94.05009038700155,
"run_id": "162e5cdd-b86c-48f1-b123-f2e34c9fa06f",
"status": "exit:0",
"output": "{\"algorithmId\":\"e587067e-47dc-4835-8f87-5e66fc979adf\",\"userCount\":10000,\"eligibleCount\":282,\"eligiblePct\":2.82,\"exclusionBreakdown\":{\"age\":5093,\"hba1c\":8628,\"egfr\":1590,\"ckd\":2545,\"bmi\":4378},\"eligibleRecordIds\":[\"user-000019\",\"user-000023\",\"user-000118\",\"user-000136\",\"user-000143\",\"user-000170\",\"user-000174\",\"user-000280\",\"user-000302\",\"user-000318\",\"user-000336\",\"user-000416\",\"user-000491\",\"user-000495\",\"user-000569\",\"user-000572\",\"user-000620\",\"user-000689\",\"user-000706\",\"user-000708\",\"user-000795\",\"user-000853\",\"user-000863\",\"user-000932\",\"user-000951\",\"user-000979\",\"user-001040\",\"user-001080\",\"user-001094\",\"user-001116\",\"user-001148\",\"user-001151\",\"user-001263\",\"user-001335\",\"user-001348\",\"user-001358\",\"user-001369\",\"user-001370\",\"user-001379\",\"user-001465\",\"user-001533\",\"user-001606\",\"user-001622\",\"user-001637\",\"user-001652\",\"user-001758\",\"user-001837\",\"user-001844\",\"user-001890\",\"user-001912\"]}",
"error": null
},
{
"tree": "secure-rads",
"dataset": "ehealth",
"algorithm_id": "e587067e-47dc-4835-8f87-5e66fc979adf",
"rep": 1,
"size": 10000,
"seconds": 106.02114782100034,
"run_id": "3577f389-620a-461c-bfe0-247501c54907",
"status": "exit:0",
"output": "{\"algorithmId\":\"e587067e-47dc-4835-8f87-5e66fc979adf\",\"userCount\":10000,\"eligibleCount\":282,\"eligiblePct\":2.82,\"exclusionBreakdown\":{\"age\":5093,\"hba1c\":8628,\"egfr\":1590,\"ckd\":2545,\"bmi\":4378},\"eligibleRecordIds\":[\"user-000019\",\"user-000023\",\"user-000118\",\"user-000136\",\"user-000143\",\"user-000170\",\"user-000174\",\"user-000280\",\"user-000302\",\"user-000318\",\"user-000336\",\"user-000416\",\"user-000491\",\"user-000495\",\"user-000569\",\"user-000572\",\"user-000620\",\"user-000689\",\"user-000706\",\"user-000708\",\"user-000795\",\"user-000853\",\"user-000863\",\"user-000932\",\"user-000951\",\"user-000979\",\"user-001040\",\"user-001080\",\"user-001094\",\"user-001116\",\"user-001148\",\"user-001151\",\"user-001263\",\"user-001335\",\"user-001348\",\"user-001358\",\"user-001369\",\"user-001370\",\"user-001379\",\"user-001465\",\"user-001533\",\"user-001606\",\"user-001622\",\"user-001637\",\"user-001652\",\"user-001758\",\"user-001837\",\"user-001844\",\"user-001890\",\"user-001912\"]}\n",
"error": null
}
]
3,602 changes: 3,602 additions & 0 deletions benchmark/results/raw/sweep-1794748065.json

Large diffs are not rendered by default.

25 changes: 17 additions & 8 deletions benchmark/src/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import argparse
import math

import matplotlib as mpl
Expand Down Expand Up @@ -147,7 +148,7 @@ def lowess(x: np.ndarray, y: np.ndarray, frac: float = 0.35) -> np.ndarray:
return out


def scaling_figure(df: pd.DataFrame) -> None:
def scaling_figure(df: pd.DataFrame, *, smooth: bool = True) -> None:
fig, ax = plt.subplots(figsize=(9, 5))
sns.lineplot(
data=df,
Expand All @@ -161,12 +162,13 @@ def scaling_figure(df: pd.DataFrame) -> None:
errorbar=("ci", 95),
ax=ax,
)
means = df.groupby(["dataset_size", "tree"], as_index=False)["total_s"].mean()
for tree in Tree:
points = means[means["tree"] == tree].sort_values("dataset_size")
x = points["dataset_size"].to_numpy(dtype=float)
y = points["total_s"].to_numpy(dtype=float)
ax.plot(x, lowess(x, y), color=PALETTE[tree], linewidth=2.5, label="_smooth")
if smooth:
means = df.groupby(["dataset_size", "tree"], as_index=False)["total_s"].mean()
for tree in Tree:
points = means[means["tree"] == tree].sort_values("dataset_size")
x = points["dataset_size"].to_numpy(dtype=float)
y = points["total_s"].to_numpy(dtype=float)
ax.plot(x, lowess(x, y), color=PALETTE[tree], linewidth=2.5, label="_smooth")
ax.set_xlabel("dataset size (records)")
ax.set_ylabel("total execution time (seconds)")
ax.legend(title=None, frameon=False)
Expand Down Expand Up @@ -208,14 +210,21 @@ def cost_services_figure(df: pd.DataFrame) -> None:
_save(fig, "sweep-cost-services.png")


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("--no-smooth", action="store_true", help="plot raw runs without the LOWESS overlay")
return parser.parse_args()


def main() -> int:
args = parse_args()
sns.set_theme(style="whitegrid", context="notebook")
FIG_DIR.mkdir(parents=True, exist_ok=True)
df = load()
logger.info("loaded {} runs across {} sizes", len(df), df["dataset_size"].nunique())
phases_figure(df)
phases_figure_selected(df)
scaling_figure(df)
scaling_figure(df, smooth=not args.no_smooth)
if "total_cost_usd" in df.columns:
cost_size_figure(df)
cost_services_figure(df)
Expand Down
Loading