Vector<String> tableHeaders = null;
int key = 0;
Vector<String> tableDataRow;
for (MLDataPair dataRow : validationData) {
MLData input = dataRow.getInput();
MLData validIdeal = dataRow.getIdeal();
MLData computatedIdeal = getCalculatedResult(dataRow, method);
int inputCount = input.size();
int idealCount = validIdeal == null ? 0 : validIdeal.size();
tableDataRow = new Vector<String>();
if (tableHeaders == null) {
tableHeaders = new Vector<String>();
for (int i = 0; i < inputCount; i++) {
tableHeaders.add("Input " + i);
}
for (int i = 0; i < computatedIdeal.size(); i++) {
tableHeaders.add("Ideal " + i);
tableHeaders.add("Result " + i);
}
}
for (int i = 0; i < inputCount; i++) {
tableDataRow.add(new Double(input.getData(i)).toString());
}
for (int i = validation.size(); i < idealCount; i++) {
validation.add(new XYSeries("Validation"));
computation.add(new XYSeries("Computation"));
createChart();
}
for (int i = 0; i < computatedIdeal.size(); i++) {
double c = computatedIdeal.getData(i);
if (idealCount > 0) {
double v = validIdeal.getData(i);
validation.get(i).add(key, v);
tableDataRow.add(new Double(v).toString());