public static Evaluation[] eval(LinearClassifier h,
ArrayList<ClassificationInstance> data) {
Evaluation[] res = new Evaluation[data.get(0).yAlphabet.size()];
for (int y = 0; y < data.get(0).yAlphabet.size(); y++) {
res[y] = new Evaluation(0, 0, 0, 0, 0);
}
for (ClassificationInstance inst : data) {
int hx = h.label(inst.x);
for (int y = 0; y < data.get(0).yAlphabet.size(); y++) {
updateEvaluation(res[y], inst.y, hx, y);