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.
    Erich Schubert, Guilherme Oliveira Campos
    • Field Detail

      • LOG

        private static final Logging LOG
        Get static logger.

        public static final java.lang.String KNOWN_REVERSED
        Pattern to match a set of known reversed scores.
        See Also:
        Constant Field Values
      • infile 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​( infile,
                                                StreamingParser parser,
                                                java.util.regex.Pattern reverse,
                                                java.nio.file.Path outfile,
                                                java.lang.String name)
        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​( fout)
      • processRow

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

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

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