Skip to content

Commit

Permalink
Fixed a problem in the sanity check of counts.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRoeder committed Sep 29, 2024
1 parent caa5adf commit 3e6ef41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/dice_research/cel/PruneCEL.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ public static void main(String[] args) throws Exception {
// XXX Choose the learning problem (as JSON file)
JSONLearningProblemReader reader = new JSONLearningProblemReader();
// Collection<LearningProblem> problems = reader.readProblems("LPs/Family/lps.json");
Collection<LearningProblem> problems = reader.readProblems("/home/micha/Downloads/TandF_MST5_reverse.json");
//Collection<LearningProblem> problems = reader.readProblems("/home/micha/Downloads/TandF_MST5_reverse.json");
Collection<LearningProblem> problems = reader.readProblems("/home/micha/Downloads/TandF_MST5.json");
// Collection<LearningProblem> problems =
// reader.readProblems("LPs/QA/TandF_MST5_reverse.json");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected void addResult(ScoredIRI suggestion, ClassExpression newNode, boolean
protected void addResult(ClassExpression newExpression, SelectionScores scores, boolean addedEdge) {
// Check results for sanity
if ((scores.getPosCount() < 0) || (scores.getPosCount() > numberOfPositives) || (scores.getNegCount() < 0)
|| (scores.getPosCount() > numberOfNegatives)) {
|| (scores.getNegCount() > numberOfNegatives)) {
LOGGER.error("Got wrong counts: #positives={}, #negatives={}, expression={}, scores={}",
numberOfPositives, numberOfNegatives, newExpression, scores);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected Collection<ScoredIRI> performQuery(SuggestionData data, Collection<Str
}
data.addBaseScore(scoredIris);
Optional<ScoredIRI> faultyResult = scoredIris.stream().filter(
s -> s.posCount < 0 || s.posCount > data.maxPos || s.negCount < 0 || s.posCount > data.maxNeg)
s -> s.posCount < 0 || s.posCount > data.maxPos || s.negCount < 0 || s.negCount > data.maxNeg)
.findFirst();
if (faultyResult.isPresent()) {
LOGGER.error("Got a faulty count: #positives={}, #negatives={}, scoredIRI={}", data.maxPos, data.maxNeg,
Expand Down

0 comments on commit 3e6ef41

Please sign in to comment.