generated from LufsX/Experiment-LogReg
This commit is contained in:
+3
-2
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user