Skip to content

Commit 56a0667

Browse files
committed
Consolidate two operations into one
1 parent 02bf429 commit 56a0667

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/inspect_evals/worldsense/_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ def preprocess_scores(
5050

5151
# Calculate weighted values and biases
5252
score_df["weight"] = score_df["answer"].map(weight_mapping).astype(float)
53-
score_df["bias"] = score_df["answer"].map(bias_mapping).astype(float)
53+
score_df["bias"] = (
54+
score_df["answer"].map(bias_mapping).astype(float) * score_df["weight"]
55+
)
5456
score_df["value"] = score_df["value"].astype(float) * score_df["weight"]
55-
score_df["bias"] *= score_df["weight"]
5657

5758
# Group and normalize
5859
grouped_scores = (

0 commit comments

Comments
 (0)