MCPcopy Index your code
hub / github.com/antlr/codebuff / scoreDocuments

Method scoreDocuments

src/org/antlr/codebuff/validation/TestK.java:140–151  ·  view source on GitHub ↗

Return error rate for each document using leave-one-out validation

()

Source from the content-addressed store, hash-verified

138
139 /** Return error rate for each document using leave-one-out validation */
140 public List<Float> scoreDocuments() throws Exception {
141 List<String> allFiles = getFilenames(new File(rootDir), language.fileRegex);
142 List<InputDocument> documents = Tool.load(allFiles, language);
143 List<Float> errors = new ArrayList<>();
144 for (int i = 0; i<documents.size(); i++) {
145 Triple<Formatter,Float,Float> results =
146 validate(language, documents, documents.get(i).fileName, k, null, false, false);
147 Float errorRate = results.c;
148 errors.add(errorRate);
149 }
150 return errors;
151 }
152}

Callers 1

mainMethod · 0.95

Calls 6

loadMethod · 0.95
getFilenamesMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65
addMethod · 0.65
validateMethod · 0.45

Tested by

no test coverage detected