Return error rate for each document using leave-one-out validation
()
| 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 | } |