int precision = 0;
for (int i = 0; i < N; i++) {
// Classify a test vector using the Java object
// (in a real application, this should not be one of the training vectors)
double d = model.classify(traindata[i]);
if ((traindata[i].getLabel() < 0 && d < 0)
|| (traindata[i].getLabel() > 0 && d > 0)) {
precision++;
}
if (i % 10 == 0) {