On Mon, Aug 15, 2011 at 7:20 PM, Jörn Kottmann <[email protected]> wrote:
> On 8/15/11 3:27 PM, Jörn Kottmann wrote: > >> I had something like this in mind >> void misclassified(T gold, T predicted); >> where T is the generics type for the Sample object. >> >> What do you think? >> > > I just had a look at the current code, where we can pass > the printErrors flag to the XYEvaluator classes. > > There we have a number of printError methods in the Evaluator class, > which are called from the actual implementation from evaluateSample. > > I suggest that we create a new abstract EvalutationErrorPrinter class, > which > is then sub-classed by the individual error printer classes. In this > individual > classes we implement the above proposed misclassified (which needs to be > part of an interface) > and call the printError methods. > > Alternatively to EvalutationErrorPrinter we could also use static > imports for the printError methods. > > I don't think it is a big change, because we already have all the > implementations, > we just need to move them a little around for the proposed error reporting > API. > > Lets see how that could look for Name Finder: > > We define the MissclassifiedSampleListener interface, > with one void missclassified(T reference, T prediction) method. > > Then the EvaluationErrorPrinter class, with all the printError methods. > > And we have also a NameEvaluationErrorListener class which extends > EvalutationErrorPrinter > and implements MissclassifiedSampleListener<**NameSample>. > This class implements the missclassified(NameSample reference, NameSample > prediction) > method according to the interface, and can simply call one of the > printError methods from it. > Thank you, Jörn. I am working on it now.
