Package elki.application.greedyensemble
Class EvaluatePrecomputedOutlierScores
- java.lang.Object
-
- elki.application.AbstractApplication
-
- elki.application.greedyensemble.EvaluatePrecomputedOutlierScores
-
public class EvaluatePrecomputedOutlierScores extends AbstractApplication
Class to load an outlier detection summary file, as produced byComputeKNNOutlierScores
, 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
-reversed
. The default value matches several scores known to use reversed values.- Since:
- 0.7.0
- Author:
- Erich Schubert, Guilherme Oliveira Campos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EvaluatePrecomputedOutlierScores.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) double
endcg
Normalization term E[NDCG].(package private) java.net.URI
infile
The data input file.static java.lang.String
KNOWN_REVERSED
Pattern to match a set of known reversed scores.private static Logging
LOG
Get static logger.(package private) java.lang.String
name
Constant column to prepend (may be null)(package private) java.nio.file.Path
outfile
Output file name(package private) StreamingParser
parser
Parser to read input data.(package private) NumberVector
positive
Vector of positive values.(package private) java.util.regex.Pattern
reverse
Pattern to recognize reversed methods.-
Fields inherited from class elki.application.AbstractApplication
REFERENCE, VERSION
-
-
Constructor Summary
Constructors Constructor Description EvaluatePrecomputedOutlierScores(java.net.URI infile, StreamingParser parser, java.util.regex.Pattern reverse, java.nio.file.Path outfile, java.lang.String name)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
checkForNaNs(NumberVector vec)
Check for NaN values.static void
main(java.lang.String[] args)
Main method.private void
processRow(java.io.PrintStream fout, NumberVector vec, java.lang.String label)
void
run()
Runs the application.private void
writeHeader(java.io.PrintStream fout)
-
Methods inherited from class elki.application.AbstractApplication
printErrorMessage, runCLIApplication, usage
-
-
-
-
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.
-
parser
StreamingParser parser
Parser to read input data.
-
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)
-
positive
NumberVector positive
Vector of positive values.
-
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 fileparser
- Streaming input parserreverse
- Pattern for reversed outlier scores.outfile
- Output file namename
- Constant column to prepend
-
-
Method Detail
-
run
public void run()
Description copied from class:AbstractApplication
Runs the application.- Specified by:
run
in classAbstractApplication
-
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.
-
-