/** * generates a permutation of the attributes. * * @param numAttributes the number of attributes. * @param classAttributes the index of the class attribute. * @param random the random number generator. * @return a permutation of the attributes */ protected int [] attributesPermutation(int numAttributes, int classAttribute, Random random) { int [] permutation = new int[numAttributes-1]; int i = 0; for(; i < classAttribute; i++){ permutation[i] = i; } for(; i < permutation.length; i++){ permutation[i] = i + 1; } permute( permutation, random ); return permutation; }