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);
}

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 ) ; }
reorderlabels - swap values of y [ 1 ] to y [ l ] according to s [ ] .
