From f84d583fc1b759c65e5fcd246807f9f449f99123 Mon Sep 17 00:00:00 2001 From: LufsX Date: Sat, 26 Oct 2024 17:48:09 +0800 Subject: [PATCH] fix: bug --- public/experiment/logreg/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/experiment/logreg/main.py b/public/experiment/logreg/main.py index ebe2e8d..3dd4dcc 100644 --- a/public/experiment/logreg/main.py +++ b/public/experiment/logreg/main.py @@ -63,7 +63,7 @@ def evaluate_logreg( - float: 分类准确率。 """ correct = 0 - total = 68 # LogReg 测试样本数 + total = 68 # LogReg 测试样本数 temp_log_details = [] try: @@ -77,7 +77,7 @@ def evaluate_logreg( for i in range(len(test_data)): # 获取测试数据中的每个样本 result = user_test_func(test_data[i], wegihts) - if result == test_labels[i]: + if result == test_labels[i] and test_labels[i] != -1: correct += 1 else: temp_log_details.append(