Skip to main content
. 2026 Jul 27;26(15):4775. doi: 10.3390/s26154775
Algorithm 1. Corrected Fold-Local Bandit-Style Sample Weighting
Input:
Training partition Tf for fold f; held-out partition Vf; labels y; action set
A = {0.25, 0.50, 1.00, 1.25, 1.50}.
learning rate α, discount factor γ, and exploration rate ε.
Output:
Fold-local sample weights wf, trained residual MLP for fold f.
1. Initialize a new fold-local Q-table Qf∈RN×|A| with all values set to zero.
2. For each training sample i∈Tf, select an action index ai using an ε-greedy policy.
3. Assign the preliminary sample weight wi = A[ai].
4. Train a probe residual MLP on Tf using the preliminary weights.
5. Predict the labels of the same fold-local training samples Tf using the probe model.
6. Compute the reward:
ri=1 if y^i=yi,0 otherwise..
7. Update Qf(i,ai) using the observed reward.
8. Reassign final fold-local training weights using the updated Qf.
9. Train a fresh residual MLP on Tf using the final weights.
10. Evaluate the final model once on the held-out fold Vf.
11. Discard Qf before proceeding to the next fold.
Note: The held-out fold Vf is not used in Steps 1–9. It is used only in Step 10 for the final performance estimation. No Q-values, rewards, selected actions, sample weights or prediction outcomes were transferred across the folds.