/** * generates an index string describing a random subspace, suitable for * the Remove filter. * * @param indices the attribute indices * @param subSpaceSize the size of the subspace * @param classIndex the class index * @param random the random number generator * @return the generated string describing the subspace */ protected String randomSubSpace(Integer[] indices, int subSpaceSize, int classIndex, Random random) { Collections.shuffle(Arrays.asList(indices), random); StringBuffer sb = new StringBuffer(""); for(int i = 0; i < subSpaceSize; i++) { sb.append(indices[i]+","); } sb.append(classIndex); if (getDebug()) System.out.println("subSPACE = " + sb); return sb.toString(); }
/** * generates an index string describing a random subspace, suitable for * the Remove filter. * * @param indices the attribute indices * @param subSpaceSize the size of the subspace * @param classIndex the class index * @param random the random number generator * @return the generated string describing the subspace */ protected String randomSubSpace(Integer[] indices, int subSpaceSize, int classIndex, Random random) { Collections.shuffle(Arrays.asList(indices), random); StringBuffer sb = new StringBuffer(""); for(int i = 0; i < subSpaceSize; i++) { sb.append(indices[i]+","); } sb.append(classIndex); if (getDebug()) System.out.println("subSPACE = " + sb); return sb.toString(); }