diff --git a/function.py b/function.py index 4533164..bee0046 100644 --- a/function.py +++ b/function.py @@ -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]#特征