TitanicConfig.PredictPerish);
// Write out the normalized file, mainly so that you can examine it.
// This file is not actually used by the program.
FileOutputStream fos = new FileOutputStream(normalizePath);
CSVWriter csv = new CSVWriter(new OutputStreamWriter(fos));
csv.writeNext(new String[]{
"id",
"age", "sex-male", "pclass", "sibsp", "parch", "fare",
"embarked-c", "embarked-q", "embarked-s", "name-mil", "name-nobility", "name-dr", "name-clergy"
});
int idx = 0;
for (BasicData data : training) {
String[] line = {
ids.get(idx++),
FormatNumeric.formatDouble(data.getInput()[0], 5),
FormatNumeric.formatDouble(data.getInput()[1], 5),
FormatNumeric.formatDouble(data.getInput()[2], 5),
FormatNumeric.formatDouble(data.getInput()[3], 5),
FormatNumeric.formatDouble(data.getInput()[4], 5),
FormatNumeric.formatDouble(data.getInput()[5], 5),
FormatNumeric.formatDouble(data.getInput()[6], 5),
FormatNumeric.formatDouble(data.getInput()[7], 5),
FormatNumeric.formatDouble(data.getInput()[8], 5),
FormatNumeric.formatDouble(data.getInput()[9], 5),
FormatNumeric.formatDouble(data.getInput()[10], 5),
FormatNumeric.formatDouble(data.getInput()[11], 5),
FormatNumeric.formatDouble(data.getInput()[12], 5),
FormatNumeric.formatDouble(data.getIdeal()[0], 5)
};
csv.writeNext(line);
}
csv.close();
fos.close();
} catch (IOException ex) {
ex.printStackTrace();
}