Skip to content

Commit 27b9d82

Browse files
committed
expand expression
1 parent a237405 commit 27b9d82

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/imitation/scripts/compare_to_baseline.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ def compare_results_to_baseline(results_file: types.AnyPath) -> pd.DataFrame:
6565
baseline["count"] = 5
6666
baseline["confidence_level"] = 0.95
6767
# Back out the standard deviation from the margin of error.
68-
baseline["std"] = (
69-
baseline["margin"] * np.sqrt(baseline["count"])
70-
) / scipy.stats.t.ppf(
68+
69+
t_score = scipy.stats.t.ppf(
7170
1 - ((1 - baseline["confidence_level"]) / 2),
7271
baseline["count"] - 1,
7372
)
73+
std_err = baseline["margin"] / t_score
74+
75+
baseline["std"] = std_err * np.sqrt(baseline["count"])
7476

7577
comparison = pd.merge(summary, baseline, on=["algo", "env_name"])
7678

0 commit comments

Comments
 (0)