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

This commit is contained in:
2024-11-02 15:38:19 +08:00
parent fb6ae18f29
commit 19e9eabc43
+3 -2
View File
@@ -27,7 +27,7 @@ name = "章程鸿"
# 这里写自己的代码实现 # 这里写自己的代码实现
import numpy as np import numpy as np
from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split from sklearn.model_selection import train_test_split
def sigmoid(z): def sigmoid(z):
@@ -87,7 +87,8 @@ def load_data(filepath):
data = np.array(data) data = np.array(data)
labels = np.array(labels) labels = np.array(labels)
target_variable = np.where((labels == 2) | (labels == 3), 0, labels) # 将标签二分类化,2和3为0,其余为1
target_variable = np.where((labels == 2) | (labels == 3), 0, 1)
return data, target_variable return data, target_variable