final TrainReweightLeastSquares train = new TrainReweightLeastSquares(reg, trainingData);
int iteration = 0;
do {
iteration++;
train.iteration();
System.out.println("Iteration #" + iteration + ", Error: " + train.getError());
} while (iteration < 1000 && train.getError() > 0.01);
query(reg, trainingData);
System.out.println("Error: " + train.getError());