if (i==toFilter.classIndex()) continue; // skip class
AttributeStats stats = toFilter.attributeStats(i);
if (stats.distinctCount < 2) {
// remove constant attributes
attsToDelete[numToDelete++] = i;
} else if (toFilter.attribute(i).isNominal()) {
// remove nominal attributes that vary too much
double variancePercent = (double) stats.distinctCount
/ (double)(stats.totalCount - stats.missingCount) * 100.0;
if (variancePercent > m_maxVariancePercentage) {
attsToDelete[numToDelete++] = i;