diff --git a/src/core/modeling/modeling_batch.py b/src/core/modeling/modeling_batch.py index 17378fd..4e8cda9 100644 --- a/src/core/modeling/modeling_batch.py +++ b/src/core/modeling/modeling_batch.py @@ -10,7 +10,6 @@ warnings.filterwarnings('ignore') # 机器学习模型导入 - 改为回归模型 from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.preprocessing import StandardScaler from sklearn.svm import SVR from sklearn.ensemble import RandomForestRegressor from sklearn.neighbors import KNeighborsRegressor @@ -647,7 +646,6 @@ class WaterQualityModelingBatch: ('imputer', SimpleImputer(strategy='median')), ('preproc', preproc), ('cleaner', _SafeFiniteTransformer()), - ('scaler', StandardScaler()), ('model', base_model), ]) @@ -787,11 +785,6 @@ class WaterQualityModelingBatch: 'mnf_W': np.asarray(_mnf.W_mnf_), 'mnf_n_components': int(getattr(_mnf, 'n_components_', _mnf.n_components)), } - # StandardScaler 参数(C++ 端需复现 (X - mean) / scale) - _scaler = model.named_steps.get('scaler') - if _scaler is not None and hasattr(_scaler, 'mean_'): - _deploy['scaler_mean'] = np.asarray(_scaler.mean_, dtype=np.float64) - _deploy['scaler_scale'] = np.asarray(_scaler.scale_, dtype=np.float64) # SVR 部署矩阵(rbf kernel 需要 support_vectors_) _deploy['svr_dual_coef'] = np.asarray(_svr.dual_coef_) _deploy['svr_intercept'] = np.asarray(_svr.intercept_)