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

This commit is contained in:
2024-11-02 16:01:17 +08:00
parent aed20500d2
commit 5af2a8e163
+3 -10
View File
@@ -1,5 +1,6 @@
# function.py
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
"""
实验说明:
@@ -17,17 +18,8 @@ import numpy as np
- numpy: 2.1.1
"""
"""
请在这里填写学号和姓名,不填写即成绩无效。
"""
id = "202210423130"
name = "董秋"
# 这里写自己的代码实现
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
def sigmoid(z):
return 1.0 / (1 + np.exp(-z))
@@ -85,6 +77,7 @@ def load_data(filepath):
data = np.array(data)
labels = np.array(labels)
# 将标签二分类化,2和3为0,其余为1
target_variable = np.where((labels == 2) | (labels == 3), 0, 1)