Skip to content

Commit 02d9b02

Browse files
minor style fixes
1 parent b39182e commit 02d9b02

4 files changed

Lines changed: 11 additions & 21 deletions

File tree

components-core/src/main/java/org/dllearner/core/AbstractClassExpressionLearningProblem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
* @author Lorenz Buehmann
3434
*
3535
*/
36-
public abstract class AbstractClassExpressionLearningProblem<T extends Score> extends AbstractLearningProblem<T, OWLClassExpression, EvaluatedDescription<T>> implements LearningProblem {
36+
public abstract class AbstractClassExpressionLearningProblem<T extends Score>
37+
extends AbstractLearningProblem<T, OWLClassExpression, EvaluatedDescription<T>>
38+
implements LearningProblem {
3739

3840
protected OWLDataFactory dataFactory = new OWLDataFactoryImpl();
3941
@ConfigOption(description = "load examples via class expression selector")

components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
* @author Jens Lehmann
3131
*
3232
*/
33-
public abstract class AbstractLearningProblem<T extends Score, V extends OWLObject, W extends EvaluatedHypothesis<V, T>> extends AbstractComponent implements LearningProblem {
33+
public abstract class AbstractLearningProblem<T extends Score, V extends OWLObject, W extends EvaluatedHypothesis<V, T>>
34+
extends AbstractComponent
35+
implements LearningProblem {
3436

3537
@ConfigOption(description="The reasoner component variable to use for this Learning Problem")
3638
protected AbstractReasonerComponent reasoner;

components-core/src/main/java/org/dllearner/learningproblems/Heuristics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public static double[] getAScoreApproximationStep1(double beta, int nrOfPosExamp
252252
// method approximates t * a / |R(A)|
253253
double[] interval = Heuristics.getConfidenceInterval95Wald(nrOfSuccessfulInstanceChecks, nrOfInstanceChecks);
254254
double diff = beta * (interval[1] - interval[0]);
255-
double ret[] = new double[2];
255+
double[] ret = new double[2];
256256
ret[0] = beta * interval[0] + 0.5*diff;
257257
ret[1] = diff;
258258
return ret;
@@ -289,7 +289,7 @@ public static double[] getAScoreApproximationStep2(int nrOfPosClassifiedPositive
289289
double lowerBorder = Heuristics.getAScore(recallLowerBorder, precisionLowerBorder, beta);
290290
double upperBorder = Heuristics.getAScore(recallUpperBorder, precisionUpperBorder, beta);
291291
double diff = upperBorder - lowerBorder;
292-
double ret[] = new double[2];
292+
double[] ret = new double[2];
293293
ret[0] = lowerBorder + 0.5*diff;
294294
ret[1] = diff;
295295
return ret;

components-core/src/main/java/org/dllearner/utilities/examples/ExampleContainer.java

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,14 @@ public int compareTo(@NotNull ExampleContainer e){
7070
return 0;
7171
}
7272

73-
boolean equalPosSize = false;
74-
boolean equalNegSize = false;
75-
76-
if(getPositiveExamples().size() == e.getPositiveExamples().size()){
77-
equalPosSize = true;
78-
}
79-
if(getNegativeExamples().size() == e.getNegativeExamples().size()){
80-
equalNegSize = true;
81-
}
82-
73+
boolean equalPosSize = getPositiveExamples().size() == e.getPositiveExamples().size();
74+
boolean equalNegSize = getNegativeExamples().size() == e.getNegativeExamples().size();
8375

8476
if(equalPosSize && !equalNegSize)return 1;
8577
if(equalNegSize && !equalPosSize)return -1;
86-
if(!equalPosSize && !equalPosSize)return 1;
87-
78+
if(!equalPosSize && !equalNegSize)return 1;
8879

8980
return 1;
90-
9181
}
9282

9383
public SortedSet<OWLIndividual> getNegativeExamples() {
@@ -96,8 +86,4 @@ public SortedSet<OWLIndividual> getNegativeExamples() {
9686
public SortedSet<OWLIndividual> getPositiveExamples() {
9787
return positiveExamples;
9888
}
99-
100-
101-
102-
10389
}

0 commit comments

Comments
 (0)