This commit is contained in:
2024-10-26 17:48:09 +08:00
parent deadf110aa
commit f84d583fc1
+2 -2
View File
@@ -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(