-C <col> Sets the attribute index (default last).
-F <value index> Sets the first value's index (default first).
-S <value index> Sets the second value's index (default last).
209210211212213214215216217218219220221222223
} if (m_classValueIndex != 0) { // nothing to do if == 0 // swap selected index with index 0 try { SwapValues sv = new SwapValues(); sv.setAttributeIndex(""+(dataSet.classIndex()+1)); sv.setFirstValueIndex("first"); sv.setSecondValueIndex(""+(m_classValueIndex+1)); sv.setInputFormat(dataSet); Instances newDataSet = Filter.useFilter(dataSet, sv); newDataSet.setRelationName(dataSet.relationName()); return newDataSet; } catch (Exception ex) { if (m_logger != null) {
279280281282283284285286287288289290291292293
} if (classValueIndex != 0) { // nothing to do if == 0 // swap selected index with index 0 try { SwapValues sv = new SwapValues(); sv.setAttributeIndex(""+(dataSet.classIndex()+1)); sv.setFirstValueIndex("first"); sv.setSecondValueIndex(""+(classValueIndex+1)); sv.setInputFormat(dataSet); Instances newDataSet = Filter.useFilter(dataSet, sv); newDataSet.setRelationName(dataSet.relationName()); return newDataSet; } catch (Exception ex) { if (m_logger != null) {
164165166167168169170171172173174175176177178
289290291292293294295296297298299300301302303
6465666768697071727374757677
return data; } protected Instances swapValues(int attIndex, Instances data) throws Exception { SwapValues s = new SwapValues(); s.setAttributeIndex("" + attIndex); s.setFirstValueIndex("first"); s.setSecondValueIndex("last"); s.setInputFormat(data); data = Filter.useFilter(data, s); return data; }