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

This commit is contained in:
2024-11-03 14:59:56 +08:00
parent 2d8ae9a430
commit a33c39759e
+1 -1
View File
@@ -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]#特征