001package javax.visrec.ml.classification;
002
003import javax.visrec.ml.ClassificationException;
004
005/**
006 * Generic classifier interface, that all classifiers should implement. Provides
007 * a method to classify instances of some class. Implementations should specify
008 * type of objects (class) that are classified.
009 *
010 * @author Zoran Sevarac
011 * @param <T> type of input objects to classify (eg. User, Product, Transaction, Image, etc.)
012 * @param <R> type of classification result.
013 * @see BinaryClassifier
014 * @see MultiClassClassifier
015 * @see ImageClassifier
016 * @since 1.0
017 */
018@FunctionalInterface
019public interface Classifier<T, R> {
020
021    /**
022     * Classifies specified instance of type T and returns classification results of type R.
023     *
024     * @param input some instance to classify
025     * @return classification results for the specified instance
026     */
027    R classify(T input) throws ClassificationException;
028       
029}