Class EvaluatePrecomputedOutlierScores


  • public class EvaluatePrecomputedOutlierScores
    extends AbstractApplication
    Class to load an outlier detection summary file, as produced by ComputeKNNOutlierScores, and compute popular evaluation metrics.

    File format description:

    • Each column is one object in the data set
    • Each line is a different algorithm
    • There is a mandatory label column, containing the method name
    • The first line must contain the ground-truth, titled bylabel, where 0 indicates an inlier and 1 indicates an outlier
    The evaluation assumes that high scores correspond to outliers, unless the method name matches the pattern given using -reversed. The default value matches several scores known to use reversed values.
    Since:
    0.7.0
    Author:
    Erich Schubert, Guilherme Oliveira Campos
    • Field Detail

      • LOG

        private static final Logging LOG
        Get static logger.
      • KNOWN_REVERSED

        public static final java.lang.String KNOWN_REVERSED
        Pattern to match a set of known reversed scores.
        See Also:
        Constant Field Values
      • infile

        java.net.URI infile
        The data input file.
      • reverse

        java.util.regex.Pattern reverse
        Pattern to recognize reversed methods.
      • outfile

        java.nio.file.Path outfile
        Output file name
      • name

        java.lang.String name
        Constant column to prepend (may be null)
      • endcg

        double endcg
        Normalization term E[NDCG].
    • Constructor Detail

      • EvaluatePrecomputedOutlierScores

        public EvaluatePrecomputedOutlierScores​(java.net.URI infile,
                                                StreamingParser parser,
                                                java.util.regex.Pattern reverse,
                                                java.nio.file.Path outfile,
                                                java.lang.String name)
        Constructor.
        Parameters:
        infile - Input file
        parser - Streaming input parser
        reverse - Pattern for reversed outlier scores.
        outfile - Output file name
        name - Constant column to prepend
    • Method Detail

      • writeHeader

        private void writeHeader​(java.io.PrintStream fout)
      • processRow

        private void processRow​(java.io.PrintStream fout,
                                NumberVector vec,
                                java.lang.String label)
      • checkForNaNs

        private boolean checkForNaNs​(NumberVector vec)
        Check for NaN values.
        Parameters:
        vec - Vector
        Returns:
        true if NaN values are present.
      • main

        public static void main​(java.lang.String[] args)
        Main method.
        Parameters:
        args - Command line parameters.