Class AbstractClassifier<O,​R>

  • Type Parameters:
    O - Input type
    R - Result type
    All Implemented Interfaces:
    Algorithm, Classifier<O>
    Direct Known Subclasses:
    PriorProbabilityClassifier

    public abstract class AbstractClassifier<O,​R>
    extends java.lang.Object
    implements Classifier<O>
    Abstract base class for algorithms.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Constructor Detail

      • AbstractClassifier

        public AbstractClassifier()
    • Method Detail

      • autorun

        @Deprecated
        public R autorun​(Database database)
        Deprecated.
        Description copied from interface: Algorithm
        Try to auto-run the algorithm on a database by calling a method called run, with an optional Database first, and with data relations as specified by Algorithm.getInputTypeRestriction().
        Specified by:
        autorun in interface Algorithm
        Parameters:
        database - the database to run the algorithm on
        Returns:
        the Result computed by this algorithm
      • alignLabels

        protected double[] alignLabels​(java.util.List<ClassLabel> l1,
                                       double[] d1,
                                       java.util.Collection<ClassLabel> l2)
        Align the labels for a label query.
        Parameters:
        l1 - List of reference labels
        d1 - Probabilities for these labels
        l2 - List of requested labels
        Returns:
        Probabilities in desired output order