Skip to main content
. 2025 Sep 11;15(18):2304. doi: 10.3390/diagnostics15182304
Algorithm 1 Ensemble Feature Selection with SHAP Refinement
  • Input: Dataset D with features X, labels y, threshold θ

  • Normalize X and split into train/test sets

  • function Fitness(solution)

  •       Convert solution to binary mask

  •       if no feature selected then

  •             return 1.0

  •       end if

  •       Train SVM on selected features

  •       return 1− accuracy

  • end function

  • Define a binary optimization problem with Fitness as objective

  • Run HHO, mGTO, and ZOA to generate feature masks

  • Apply majority voting to obtain ensemble mask

  • Train SVM using features selected by ensemble mask

  • Compute SHAP values; rank features by mean absolute value

  • Select top features achieving θ cumulative SHAP contribution

  • Output: Optimized feature subset XSHAP