/** * ReorderLabels - swap values of y[1] to y[L] according to s[]. * @param s new indices order (supposing that it contains the first s.length indices) */ 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); //return D; }
/** * ReorderLabels - swap values of y[1] to y[L] according to s[]. * @param s new indices order (supposing that it contains the first s.length indices) */ 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); //return D; }
/** * Parses a given list of options. * <p/> * * <!-- options-start --> Valid options are: * <p/> * * <pre> * -R <index1,index2-index4,...> * Specifies the order of the attributes (default first-last). * </pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String orderList = Utils.getOption('R', options); if (orderList.length() != 0) { setAttributeIndices(orderList); } if (getInputFormat() != null) { setInputFormat(getInputFormat()); } Utils.checkForRemainingOptions(options); }
m_Reorder.setInputFormat(inputFormat);
m_Reorder.setInputFormat(inputFormat);
/** * Parses a given list of options. * <p/> * * <!-- options-start --> Valid options are: * <p/> * * <pre> * -R <index1,index2-index4,...> * Specifies the order of the attributes (default first-last). * </pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String orderList = Utils.getOption('R', options); if (orderList.length() != 0) { setAttributeIndices(orderList); } if (getInputFormat() != null) { setInputFormat(getInputFormat()); } Utils.checkForRemainingOptions(options); }
m_Reorder.setInputFormat(inputFormat);
m_ReorderOriginal.setAttributeIndicesArray(al.stream().mapToInt(j -> j).toArray()); m_ReorderOriginal.setAllAttributeWeightsToOne(true); m_ReorderOriginal.setInputFormat(data); return Filter.useFilter(data, m_ReorderOriginal); } else { m_ReorderFiltered.setAttributeIndicesArray(al.stream().mapToInt(j -> j).toArray()); m_ReorderFiltered.setAllAttributeWeightsToOne(true); m_ReorderFiltered.setInputFormat(data); return Filter.useFilter(data, m_ReorderFiltered);
m_ReorderOriginal.setAttributeIndicesArray(al.stream().mapToInt(j -> j).toArray()); m_ReorderOriginal.setAllAttributeWeightsToOne(true); m_ReorderOriginal.setInputFormat(data); return Filter.useFilter(data, m_ReorderOriginal); } else { m_ReorderFiltered.setAttributeIndicesArray(al.stream().mapToInt(j -> j).toArray()); m_ReorderFiltered.setAllAttributeWeightsToOne(true); m_ReorderFiltered.setInputFormat(data); return Filter.useFilter(data, m_ReorderFiltered);
reorder.setInputFormat(m_Data); m_Data = Filter.useFilter(m_Data, reorder);
reorder.setInputFormat(m_Data); m_Data = Filter.useFilter(m_Data, reorder);
reorder.setInputFormat(m_Data); m_Data = Filter.useFilter(m_Data, reorder);
reorder.setInputFormat(m_Data); m_Data = Filter.useFilter(m_Data, reorder);
protected Instances reorderAtts(Instances data) throws Exception { Reorder r = new Reorder(); String range = "last"; for (int i = data.numAttributes() - 1; i > 0; i--) { range += "," + i; } r.setAttributeIndices(range); r.setInputFormat(data); data = Filter.useFilter(data, r); return data; }
protected Instances reorderAtts(Instances data) throws Exception { Reorder r = new Reorder(); String range = "last"; for (int i = data.numAttributes() - 1; i > 0; i--) { range += "," + i; } r.setAttributeIndices(range); r.setInputFormat(data); data = Filter.useFilter(data, r); return data; }
reorderFilter.setInputFormat(instances); instances = Filter.useFilter(instances, reorderFilter);
reorderFilter.setInputFormat(instances); instances = Filter.useFilter(instances, reorderFilter);
reorderedIndices[numPredictors] = labelIndices[label1]; filter.setAttributeIndicesArray(reorderedIndices); filter.setInputFormat(dataOneVsOne); dataOneVsOne = Filter.useFilter(dataOneVsOne, filter);