ds.replaceColumn(9, 4, 1, 0);
final List<BasicData> trainingData = ds.extractSupervised(0, 9, 9, 1);
final MultipleLinearRegression reg = new MultipleLinearRegression(9);
reg.setLinkFunction(new LogitLinkFunction());
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());
} catch (Throwable t) {
t.printStackTrace();
}