def test_save_history_best_not_valid(tmpdir, history): _save_history_csv(history, tmpdir, True, METRIC_VAL_ACCURACY, 11) df = pd.read_csv(tmpdir + "/model_history.csv") check = df[df["best"] == 1] assert list(check["epoch"])[0] == 5
def test_save_history_no_best(tmpdir, history): _save_history_csv(history, tmpdir, True, "loss", None) df = pd.read_csv(tmpdir + "/model_history.csv") check = df[df["best"] == 1] assert list(check["epoch"])[0] == 5
def test_save_history_best_loss(tmpdir, history): _save_history_csv(history, tmpdir, True, METRIC_VAL_LOSS, 3) df = pd.read_csv(tmpdir + "/model_history.csv") check = df[df["best"] == 1] assert list(check["epoch"])[0] == 2
def test_save_history_best_acc(tmpdir, history): _save_history_csv(history, tmpdir, True, VAL_ACC, 1) df = pd.read_csv(tmpdir + "/model_history.csv") check = df[df["best"] == 1] assert list(check["epoch"])[0] == 0