Running the fusion pipeline...
=========================================
Loading data...
- Reading IQA metrics from: data/labeled/train/iqa.csv
- Reading MOS scores from: data/labeled/train/mos_debiased.csv
- Merging IQA and MOS by 'file_name'
- Reading distorted IQA metrics from: data/distorted/iqa.csv
- Loaded 432 training samples and 3132 distorted samples.
Computing PLCC + SRCC ranking of FR metrics...
- Ranking saved to: results/pipeline_fusion/ranking.csv

Selected top-6 metrics:
   1. MS-SSIM
   2. PSNR
   3. PSNR-B
   4. SNR
   5. VIF
   6. UQI
- Top-6 metric names saved to: results/pipeline_fusion/top_k_metrics_k6.txt
Normalizing features...
- Scaler saved to: results/pipeline_fusion/k6/scaler.pkl
- Normalized features saved to: results/pipeline_fusion/k6/x_scaled.csv

Evaluating models using top-6 metrics...

- Training model: Linear
  → Using default parameters (no search).
  PLCC = 0.8147 | SRCC = 0.8284 | MSE = 103.5513 | MAE = 7.7541

- Training model: Ridge
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8135 | SRCC = 0.8290 | MSE = 104.1320 | MAE = 7.7951
  ✓ Best hyperparameters: {'alpha': 0.1}

- Training model: ElasticNet
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8145 | SRCC = 0.8293 | MSE = 103.6559 | MAE = 7.7518
  ✓ Best hyperparameters: {'alpha': 0.01, 'l1_ratio': 0.5, 'max_iter': 5000}

- Training model: BayesianRidge
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8145 | SRCC = 0.8302 | MSE = 103.6396 | MAE = 7.7614
  ✓ Best hyperparameters: {'alpha_1': 0.0001, 'alpha_2': 1e-06, 'lambda_1': 1e-06, 'lambda_2': 0.0001}

- Training model: SVR
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8864 | SRCC = 0.8899 | MSE = 66.4179 | MAE = 6.2226
  ✓ Best hyperparameters: {'C': 100, 'epsilon': 0.01, 'gamma': 'scale'}

- Training model: RandomForest
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8832 | SRCC = 0.8839 | MSE = 67.8397 | MAE = 6.1749
  ✓ Best hyperparameters: {'max_depth': 10, 'min_samples_leaf': 1, 'min_samples_split': 2, 'n_estimators': 500}
 94%|=================== | 407/432 [00:17<00:01]         SHAP summary plot saved.

- Training model: ExtraTrees
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8834 | SRCC = 0.8865 | MSE = 67.6280 | MAE = 6.2240
  ✓ Best hyperparameters: {'max_depth': None, 'min_samples_leaf': 2, 'min_samples_split': 2, 'n_estimators': 500}
 97%|=================== | 419/432 [00:19<00:00]         SHAP summary plot saved.

- Training model: GradientBoosting
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8869 | SRCC = 0.8879 | MSE = 65.9787 | MAE = 6.0817
  ✓ Best hyperparameters: {'learning_rate': 0.05, 'max_depth': 5, 'n_estimators': 200, 'subsample': 0.7}
  SHAP summary plot saved.

- Training model: HistGradientBoosting
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8725 | SRCC = 0.8750 | MSE = 73.6546 | MAE = 6.5383
  ✓ Best hyperparameters: {'l2_regularization': 0.0, 'learning_rate': 0.1, 'max_depth': 10, 'max_iter': 100}

- Training model: XGBoost
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8864 | SRCC = 0.8871 | MSE = 66.0121 | MAE = 6.2138
/home/netoa/Desktop/ISR/.venv/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py:782: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
  warnings.warn(
  ✓ Best hyperparameters: {'colsample_bytree': 1.0, 'learning_rate': 0.01, 'max_depth': 6, 'n_estimators': 500, 'subsample': 0.6}
  SHAP summary plot saved.

- Training model: LightGBM
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8721 | SRCC = 0.8731 | MSE = 73.9197 | MAE = 6.4050
  ✓ Best hyperparameters: {'learning_rate': 0.05, 'max_depth': -1, 'min_child_samples': 5, 'n_estimators': 100, 'num_leaves': 63}
  SHAP summary plot saved.

- Training model: CatBoost
  → Using GridSearchCV for hyperparameter tuning.
  PLCC = 0.8881 | SRCC = 0.8893 | MSE = 65.0763 | MAE = 6.1607
  ✓ Best hyperparameters: {'depth': 8, 'iterations': 500, 'l2_leaf_reg': 3, 'learning_rate': 0.1}
 95%|=================== | 412/432 [00:15<00:00]         SHAP summary plot saved.

Generating pseudo-MOS for distorted data...
- Pseudo-MOS predictions saved to: results/pipeline_fusion/k6/pseudo_mos.csv
Fusion pipeline completed successfully.
=========================================
Best model info:
- Model name: CatBoost
- k: 6
- Top-k metrics: ['MS-SSIM', 'PSNR', 'PSNR-B', 'SNR', 'VIF', 'UQI']
=========================================