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 classEvaluatePrecomputedOutlierScores.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) doubleendcgNormalization term E[NDCG].(package private) java.net.URIinfileThe data input file.static java.lang.StringKNOWN_REVERSEDPattern to match a set of known reversed scores.private static LoggingLOGGet static logger.(package private) java.lang.StringnameConstant column to prepend (may be null)(package private) java.nio.file.PathoutfileOutput file name(package private) StreamingParserparserParser to read input data.(package private) NumberVectorpositiveVector of positive values.(package private) java.util.regex.PatternreversePattern 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 booleancheckForNaNs(NumberVector vec)Check for NaN values.static voidmain(java.lang.String[] args)Main method.private voidprocessRow(java.io.PrintStream fout, NumberVector vec, java.lang.String label)voidrun()Runs the application.private voidwriteHeader(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:AbstractApplicationRuns the application.- Specified by:
runin 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:
trueif NaN values are present.
-
main
public static void main(java.lang.String[] args)
Main method.- Parameters:
args- Command line parameters.
-
-