feat: check test item number
This commit is contained in:
@@ -66,6 +66,13 @@ def evaluate_logreg(
|
||||
total = 68 # LogReg 测试样本数
|
||||
temp_log_details = []
|
||||
|
||||
if len(test_data) > total:
|
||||
log_details.append("测试集样本数不匹配,请检查 load_data 函数!")
|
||||
print("测试集样本数不匹配,请检查 load_data 函数!")
|
||||
log_details.append("成绩为零!")
|
||||
print("成绩为零!")
|
||||
return 0.0
|
||||
|
||||
try:
|
||||
# 训练模型
|
||||
time_start = time.time()
|
||||
|
||||
Reference in New Issue
Block a user