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

This commit is contained in:
2024-11-13 16:18:56 +08:00
parent 4c9f84d6d9
commit baf8e77bad
+20
View File
@@ -5,6 +5,26 @@ from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
import joblib # 用于保存模型
"""
实验说明:
自行编写实现数据加载与预测病马死亡的对率回归算法。
注意事项:
在 function.py 中实现对率回归算法。
可以自行导入其他库,需要在 requirements.txt 添加依赖,若未在 requirements.txt 中添加使用到的依赖,则无法自动评测,成绩为零。
自动评测脚本仅会加载 train_logreg、predict_logreg 和 load_data 函数,请勿修改函数名。
测评环境:
CPU: Intel Xeon(R) CPU E3-1231 v3 @ 3.40GHz
OS: Ubuntu 22.04.4 LTS
Python: 3.10.12
numpy: 2.1.1 """
id = "202210423204"
name = "陈垣豪"
def sigmoid(z):
"""计算sigmoid函数"""
return 1.0 / (1 + np.exp(-z))