generated from LufsX/Experiment-LogReg
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@ def load_data(filepath):
|
||||
try:
|
||||
data. append([float(x) if x !='?'else np. nan for x in line_data])
|
||||
except ValueError as e:
|
||||
print(f"Error processing line: {line}. Error: fe}")
|
||||
print(f"Error processing line: {line}. Error: {e}")
|
||||
data = np.array(data)
|
||||
data = np.nan_to_num(data,nan=np.nanmean(data,axis=0))#将缺失值用平均值代替
|
||||
X = data[:,:-1]#特征
|
||||
|
||||
Reference in New Issue
Block a user