Skip to content

Commit

Permalink
chore: use sklearn accuracy method
Browse files Browse the repository at this point in the history
  • Loading branch information
taharallouche authored and Mahaspace committed Apr 7, 2024
1 parent 2ce5c14 commit e21a69d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions size_matters/evaluation/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import matplotlib.pyplot as plt
import numpy as np
from numpy.typing import NDArray
from sklearn.metrics import zero_one_loss
from sklearn.metrics import accuracy_score
from tqdm import tqdm

from size_matters.aggregation.aggregators import (
Expand Down Expand Up @@ -60,9 +60,7 @@ def compare_methods(
condorcet_labels,
)
for i, rule in enumerate(rules):
accuracy[i, batch, num - 1] = 1 - zero_one_loss(
groundtruth.to_numpy().astype(int), rule.to_numpy().astype(int)
)
accuracy[i, batch, num - 1] = accuracy_score(groundtruth, rule)

logging.info("Experiment completed, gathering the results ..")

Expand Down

0 comments on commit e21a69d

Please sign in to comment.