Skip to content

Commit

Permalink
feat: logs for progress
Browse files Browse the repository at this point in the history
  • Loading branch information
OUALI Maha authored and Mahaspace committed Nov 19, 2023
1 parent 0439af9 commit a807df8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions size_matters/evaluation/accuracy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from random import sample

import logging
import matplotlib.pyplot as plt
import numpy as np
import ray
Expand All @@ -16,6 +16,10 @@
from size_matters.utils.inventory import COLUMNS, PLOT_OPTIONS, RULES, Dataset
from size_matters.utils.utils import confidence_margin_mean

logging.basicConfig(
level=logging.INFO, format="'%(asctime)s - %(levelname)s - %(message)s'"
)


def compare_methods(dataset: Dataset, max_voters: int, n_batch: int) -> NDArray:
"""
Expand All @@ -33,6 +37,8 @@ def compare_methods(dataset: Dataset, max_voters: int, n_batch: int) -> NDArray:

# initialize the accuracy array
accuracy = np.zeros([5, n_batch, max_voters - 1])

logging.info("Vote started : running the different methods ")
for num in tqdm(
range(1, max_voters), desc="Number of voters", position=0, leave=True
):
Expand Down Expand Up @@ -77,7 +83,7 @@ def compare_methods(dataset: Dataset, max_voters: int, n_batch: int) -> NDArray:
)
for i, rule in enumerate(rules):
accuracy[i, batch, num - 1] = 1 - zero_one_loss(G, rule)

logging.info("Vote completed")
zero_one_margin = np.zeros([len(rules), max_voters - 1, 3])
for num in range(1, max_voters):
for i in range(len(rules)):
Expand Down

0 comments on commit a807df8

Please sign in to comment.