Add accuracy and time in output
This commit is contained in:
@@ -3,6 +3,7 @@ package com.testpbc4;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
@@ -138,8 +139,8 @@ public class App {
|
||||
System.out.println(StringUtils.center(String.format("%d fold cross validation stratified", numFolds), 64));
|
||||
initializeOutput();
|
||||
sc = new Scanner(file);
|
||||
System.out.println(String.format(" # %-30s %-29s", "Dataset", "Seeds"));
|
||||
System.out.println("--- " + "-".repeat(30) + " " + "-".repeat(29));
|
||||
System.out.println(String.format(" # %-30s %-29s %-9s %-9s", "Dataset", "Seeds", "Accuracy", "Time"));
|
||||
System.out.println("--- " + "-".repeat(30) + " " + "-".repeat(29) + " " + "-".repeat(9) + " " + "-".repeat(9));
|
||||
int number = 0;
|
||||
while (sc.hasNextLine()) {
|
||||
dataset = sc.nextLine();
|
||||
@@ -166,10 +167,12 @@ public class App {
|
||||
}
|
||||
|
||||
}
|
||||
System.out.println("");
|
||||
accuracyStat = meanAndDeviation(accuracy);
|
||||
timeStat = meanAndDeviation(timeSpent);
|
||||
complexityStat = meanAndDeviation(complexity);
|
||||
DecimalFormat myFormatter = new DecimalFormat("#,##0.000");
|
||||
String time_formatted = myFormatter.format(timeStat[0]);
|
||||
System.out.println(String.format("%.7f %9s", accuracyStat[0], time_formatted));
|
||||
try {
|
||||
store(dataset, accuracyStat, timeStat, complexityStat);
|
||||
} catch (Exception e) {
|
||||
|
Reference in New Issue
Block a user