更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 13s

This commit is contained in:
2024-10-30 10:58:42 +08:00
parent 9a87a95171
commit 7665be967b
+2 -2
View File
@@ -92,13 +92,13 @@ def load_data(filepath):
# 主逻辑
if __name__ == "__main__":
# 加载数据
X, y = load_data('path_to_data_file.txt')
X, y = load_data("./data/horse-colic.data")
# 训练模型
weights = train_logreg(X, y)
# 加载测试数据并预测
X_test, y_test = load_data('path_to_test_data_file.txt')
X_test, y_test = load_data("./data/horse-colic.test")
predictions = predict_logreg(X_test, weights)
# 打印预测结果和实际结果