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

This commit is contained in:
2024-11-02 14:13:04 +08:00
parent 61367c616d
commit e2f5b6ad04
+2
View File
@@ -101,6 +101,7 @@ def load_data(filepath):
return data, labels return data, labels
def preprocess_data(X): def preprocess_data(X):
"""特征标准化。""" """特征标准化。"""
scaler = StandardScaler() scaler = StandardScaler()
@@ -123,3 +124,4 @@ if __name__ == "__main__":
# 测试单个数据 # 测试单个数据
y_pred = predict_logreg(X_test[11], weights) y_pred = predict_logreg(X_test[11], weights)
print(f"预测结果: {y_pred}, 实际结果: {y_test[11]}") print(f"预测结果: {y_pred}, 实际结果: {y_test[11]}")