Class RankingQualityHistogram<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    Algorithm

    @Title("Ranking Quality Histogram")
    @Description("Evaluates the effectiveness of a distance function via the obtained rankings.")
    public class RankingQualityHistogram<O>
    extends java.lang.Object
    implements Algorithm
    Evaluate a distance function with respect to kNN queries. For each point, the neighbors are sorted by distance, then the AUROC is computed. A score of 1 means that the distance function provides a perfect ordering of relevant neighbors first, then irrelevant neighbors. A value of 0.5 can be obtained by random sorting. A value of 0 means the distance function is inverted, i.e. a similarity.

    TODO: Add sampling

    Since:
    0.2
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • distance

        protected Distance<? super O> distance
        Distance function used.
      • numbins

        protected int numbins
        Number of bins to use.
    • Constructor Detail

      • RankingQualityHistogram

        public RankingQualityHistogram​(Distance<? super O> distance,
                                       int numbins)
        Constructor.
        Parameters:
        distance - Distance function to evaluate
        numbins - Number of bins
    • Method Detail

      • getInputTypeRestriction

        public TypeInformation[] getInputTypeRestriction()
        Description copied from interface: Algorithm
        Get the input type restriction used for negotiating the data query.
        Specified by:
        getInputTypeRestriction in interface Algorithm
        Returns:
        Type restriction
      • run

        public HistogramResult run​(Database database,
                                   Relation<O> relation)
        Process a relation
        Parameters:
        database - Database to process
        relation - Relation to process
        Returns:
        Histogram of ranking qualities