generated from LufsX/Experiment-LogReg
This commit is contained in:
@@ -117,6 +117,9 @@ def load_data(filepath):
|
||||
data = [line.strip().split() for line in lines]
|
||||
data = [list(map(lambda x: float(x) if x != '?' else np.nan, row)) for row in data]
|
||||
|
||||
# 移除类别标签缺失的样本
|
||||
data = [row for row in data if row[-1] != np.nan]
|
||||
|
||||
# 使用“0”填充缺失值
|
||||
for row in data:
|
||||
for i in range(len(row)):
|
||||
|
||||
Reference in New Issue
Block a user