Class RankingQualityHistogram<O>

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

    @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

    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)
        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
        Type restriction
      • run

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