fix: 修复 Step8 模型生成路径错误及特征分离未过滤坐标列导致的 0 模型 Bug

- view 层 Step8View.update_work_directory 不再生成 <work_dir>/indices/<basename>_indices.csv,改为生成标准的 <work_dir>/8_Modeling/ 模型存放目录;FileSelectWidget 标签与文件过滤器同步调整为目录语义(输出模型目录 / All Files (*.*)),消除'保存目录被存成 csv 文件'导致的 train_models 跳过判定。
This commit is contained in:
DXC
2026-06-17 14:15:34 +08:00
parent c2740c2bde
commit 91881d564a
2 changed files with 24 additions and 17 deletions

View File

@ -288,11 +288,24 @@ class WaterQualityModelingBatch:
# 提取所有目标列从0列到feature_start_index-1列
y_dict = {}
target_columns = data.columns[:feature_start_index]
print(f"检测到的目标列: {list(target_columns)}")
print(f"检测到的潜在目标列: {list(target_columns)}")
# 新增:跳过非预测目标的系统保留列
ignore_cols = {'ID', 'id', 'Id', 'Longitude', 'Latitude', 'Lon', 'Lat', 'longitude', 'latitude', 'lon', 'lat', 'Station', 'station'}
for col_name in target_columns:
# 过滤黑名单列
if col_name in ignore_cols:
print(f" 跳过目标列 '{col_name}': 属于系统保留列或空间坐标")
continue
y_series = data[col_name]
# 过滤非数值类型列 (避免将纯文本备注等拿去回归)
if not pd.api.types.is_numeric_dtype(y_series):
print(f" 跳过目标列 '{col_name}': 非数值类型")
continue
# 检查是否有非空值
if not y_series.isna().all():
y_dict[col_name] = y_series