//convert to coordinates in the training instance space.
double x = convertFromPanelX(mouseX);
double y = convertFromPanelY(mouseY);
//build the training instance
Instance newInstance = new DenseInstance(m_trainingData.numAttributes());
for (int i = 0; i < newInstance.numAttributes(); i++) {
if (i == classAttIndex) {
newInstance.setValue(i,classValue);
}
else if (i == m_xAttribute)
newInstance.setValue(i,x);
else if (i == m_yAttribute)
newInstance.setValue(i,y);
else newInstance.setMissing(i);
}
//add it to our data set.
addTrainingInstance(newInstance);
}