diff --git a/function.py b/function.py index 572ba9e..6f2400c 100644 --- a/function.py +++ b/function.py @@ -51,7 +51,7 @@ if __name__ == '__main__': # 训练模型 classifier = colicSklearn() - # 假设我们要测试测试集中的第12个样本(索引为11,因为索引从0开始) - single_sample = testSet[11] # 请确保testSet已经包含测试集的数据 + + single_sample = testSet[11] y_pred = predict_logreg(single_sample, classifier) print(f"预测结果: {y_pred}, 实际结果: {testLabels[11]}") \ No newline at end of file