Class OutlierScoreAdapter

  • All Implemented Interfaces:
    ScoreEvaluation.Adapter, Iter

    public class OutlierScoreAdapter
    extends java.lang.Object
    implements ScoreEvaluation.Adapter
    This adapter can be used for an arbitrary collection of Integers, and uses that id1.compareTo(id2) != 0 for id1 != id2 to satisfy the comparability.

    Note that of course, no id should occur more than once.

    The ROC values would be incorrect then anyway!

    Since:
    0.7.0
    Author:
    Erich Schubert
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      OutlierScoreAdapter advance()
      Moves the iterator forward to the next entry.
      int numPositive()
      Return the number of positive ids.
      int numTotal()
      Return the number of all ids.
      boolean test()
      True if the current object is a positive example.
      boolean tiedToPrevious()
      Test whether the score is the same as the previous objects score.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • set

        private DBIDs set
        Set of positive objects
      • iter

        private DBIDIter iter
        Original iterator.
      • prev

        private double prev
        Previous value.
    • Constructor Detail

      • OutlierScoreAdapter

        public OutlierScoreAdapter​(DBIDs positive,
                                   OutlierResult o)
        Constructor.
        Parameters:
        positive - Positive objects
        o - Result
    • Method Detail

      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public OutlierScoreAdapter advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • tiedToPrevious

        public boolean tiedToPrevious()
        Description copied from interface: ScoreEvaluation.Adapter
        Test whether the score is the same as the previous objects score. When there is no previous result, implementations should return false!
        Specified by:
        tiedToPrevious in interface ScoreEvaluation.Adapter
        Returns:
        Boolean