Package org.egothor.methodatlas.command
Class EvalAccuracyCommand
java.lang.Object
org.egothor.methodatlas.command.EvalAccuracyCommand
- All Implemented Interfaces:
Command
Utility CLI mode (
-eval-accuracy) that measures how accurate the AI
classification is against a human-reviewed labelled set.
Synopsis:
methodatlas -eval-accuracy <labels.yaml> <predictions.csv> [-eval-format markdown|json] [-eval-min-f1 <0..1>]
labels.yaml— the ground truth, in the-override-fileformat (the recommended source: those entries are already human-reviewed);predictions.csv— a scan CSV produced with-aiand without-override-file, so the AI columns hold genuine AI output;-eval-format—markdown(default) orjson;-eval-min-f1— optional gate: exit1when the F1 of thesecurityRelevantdecision or the micro-averaged tag F1 is below the threshold, or when neither could be computed (no labelled data — a gate must not pass on no evidence).
No scan runs and no AI provider is called: the command only reads the two
files, so it is deterministic and offline. The report is written with
\n line endings regardless of platform.
- Since:
- 6.1.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEvalAccuracyCommand(Path labels, Path predictions, boolean json, OptionalDouble minF1) Creates a command. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(PrintWriter out) Evaluates the predictions against the labels and writes the report.static EvalAccuracyCommandBuilds the command from raw command-line arguments.
-
Field Details
-
FLAG_EVAL_ACCURACY
Flag that selects this utility mode; takes two path arguments.- See Also:
-
FLAG_EVAL_FORMAT
Flag selecting the report format.- See Also:
-
FLAG_EVAL_MIN_F1
Flag setting the minimum acceptable F1.- See Also:
-
-
Constructor Details
-
EvalAccuracyCommand
Creates a command.- Parameters:
labels- override-format YAML with the human-reviewed labelspredictions- scan CSV produced with-aijson-truefor JSON output,falsefor MarkdownminF1- minimum acceptable F1 in[0,1], or empty for no gate
-
-
Method Details
-
fromArgs
Builds the command from raw command-line arguments.- Parameters:
args- raw arguments; must contain-eval-accuracyfollowed by the labels path and the predictions path- Returns:
- a configured command; never
null - Throws:
IllegalArgumentException- if the paths are missing, the format is neithermarkdownnorjson, or the threshold is not a number in[0,1]
-
execute
Evaluates the predictions against the labels and writes the report.- Specified by:
executein interfaceCommand- Parameters:
out- writer that receives the report; nevernull- Returns:
0on success or when no gate is set;1when the-eval-min-f1gate fails- Throws:
IOException- if either input file cannot be read or parsed
-