} else {
numToElim = (numAttrLeft >= m_numToEliminate) ? m_numToEliminate : numAttrLeft;
}
// Build the linear SVM with default parameters
SMO smo = new SMO();
// SMO seems to get stuck if data not normalised when few attributes remain
// smo.setNormalizeData(numAttrLeft < 40);
smo.setFilterType(new SelectedTag(m_smoFilterType, SMO.TAGS_FILTER));
smo.setEpsilon(m_smoPParameter);
smo.setToleranceParameter(m_smoTParameter);
smo.setC(m_smoCParameter);
smo.buildClassifier(trainCopy);
// Find the attribute with maximum weight^2
double[] weightsSparse = smo.sparseWeights()[0][1];
int[] indicesSparse = smo.sparseIndices()[0][1];
double[] weights = new double[trainCopy.numAttributes()];
for (int j = 0; j < weightsSparse.length; j++) {
weights[indicesSparse[j]] = weightsSparse[j] * weightsSparse[j];
}
weights[trainCopy.classIndex()] = Double.MAX_VALUE;