question: public static void reorderLabels ( Instances D , int s [ ] ) throws Exception { int L = s . length ; Reorder f = new Reorder ( ) ; String range = "" ; for ( int j = 0 ; j < L ; j ++ ) { range += String . valueOf ( s [ 0 ] ) + "," ; } range = range + ( L + 1 ) + "-last" ; f . setAttributeIndices ( range ) ; f . setInputFormat ( D ) ; D = Filter . useFilter ( D , f ) ; }
target:  ReorderLabels - swap values of y[1] to y[L] according to s[].