@Override public DoubleArray estimate(DataFrame x, Vector y) { Objects.requireNonNull(x, "Input data required."); Objects.requireNonNull(y, "Input target required."); Check.argument(x.rows() == y.size(), "The size of input data and input target don't match."); return errorFunction.apply(classifier.estimate(x), y, classifier.getClasses()); }
@Override public double estimate(Vector example, Object label) { Objects.requireNonNull(example, "Require an example."); int trueClassIndex = classifier.getClasses().loc().indexOf(label); Check.argument(trueClassIndex >= 0, "illegal label %s", label); return errorFunction.apply(classifier.estimate(example), trueClassIndex); }