// Path: src/main/java/com/tom_e_white/set_game/predict/PredictCardNumberOnTrainingData.java
// public class PredictCardNumberOnTrainingData {
// 
//     public static double computeAccuracyOnTrainingData() throws IOException {
//         FindCardNumberFeatures cardFeatureCounter = new FindCardNumberFeatures();
//         int correct = 0;
//         int total = 0;
//         for (File file : new File("data/train-out").listFiles((dir, name) -> name.matches(".*\\.jpg"))) {
//             System.out.println(file);
//             int predictedNumber = (int) cardFeatureCounter.find(UtilImageIO.loadImage(file.getAbsolutePath()), false)[0];
//             int actualNumber = cardFeatureCounter.getLabelFromFilename(file.getName());
//             if (predictedNumber == actualNumber) {
//                 correct++;
//             } else {
//                 System.out.println("Incorrect, predicted " + predictedNumber);
//             }
//             total++;
//         }
//         System.out.println("Correct: " + correct);
//         System.out.println("Total: " + total);
//         double accuracy = ((double) correct)/total * 100;
//         System.out.println("Accuracy: " + ((int) accuracy) + " percent");
//         return accuracy;
//     }
//     public static void main(String[] args) throws IOException {
//         computeAccuracyOnTrainingData();
//     }
// }


import com.tom_e_white.set_game.predict.PredictCardNumberOnTrainingData;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertTrue;
package com.tom_e_white.set_game.predict;




public class PredictCardNumberOnTrainingDataTest {
    @Test
    public void test() throws IOException {
// Path: src/main/java/com/tom_e_white/set_game/predict/PredictCardNumberOnTrainingData.java
// public class PredictCardNumberOnTrainingData {
// 
//     public static double computeAccuracyOnTrainingData() throws IOException {
//         FindCardNumberFeatures cardFeatureCounter = new FindCardNumberFeatures();
//         int correct = 0;
//         int total = 0;
//         for (File file : new File("data/train-out").listFiles((dir, name) -> name.matches(".*\\.jpg"))) {
//             System.out.println(file);
//             int predictedNumber = (int) cardFeatureCounter.find(UtilImageIO.loadImage(file.getAbsolutePath()), false)[0];
//             int actualNumber = cardFeatureCounter.getLabelFromFilename(file.getName());
//             if (predictedNumber == actualNumber) {
//                 correct++;
//             } else {
//                 System.out.println("Incorrect, predicted " + predictedNumber);
//             }
//             total++;
//         }
//         System.out.println("Correct: " + correct);
//         System.out.println("Total: " + total);
//         double accuracy = ((double) correct)/total * 100;
//         System.out.println("Accuracy: " + ((int) accuracy) + " percent");
//         return accuracy;
//     }
//     public static void main(String[] args) throws IOException {
//         computeAccuracyOnTrainingData();
//     }
// }


// Path: src/test/java/com/tom_e_white/set_game/predict/PredictCardNumberOnTrainingDataTest.java
import com.tom_e_white.set_game.predict.PredictCardNumberOnTrainingData;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertTrue;

package com.tom_e_white.set_game.predict;




public class PredictCardNumberOnTrainingDataTest {
    @Test
    public void test() throws IOException {
        double accuracy = PredictCardNumberOnTrainingData.computeAccuracyOnTrainingData();