Skip to main content
. 2023 Feb 20;23(4):2333. doi: 10.3390/s23042333
Algorithm 2 Fold generation of DOB-SCV (based on Ref. [20])
Require: k             // number of folds
Require: C={C1,C2,,Cn}     // classes
Ensure: F1,F2,,Fk                           // generated folds
F1,F2,,Fk
for i:=1 to n do
      while count(Ci)>0 do
            x1 randomly select sample from Ci
            F1F1{x1}
            CiCi \ {x1}
            for j:=2 to k do
                 x2 select the nearest neighbour of x1 from Ci
                 FjFj{x2}
                 CiCi \ {x2}
                 if count(Ci)=0 then
                      jk                         // end for j
                 end if
            end for
      end while
end for