From: <lor...@us...> - 2009-12-22 19:02:31
|
Revision: 1950 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1950&view=rev Author: lorenz_b Date: 2009-12-22 19:02:23 +0000 (Tue, 22 Dec 2009) Log Message: ----------- Continued evaluation stuff. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationComputingScript.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationGUI.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/GraphicalCoveragePanel.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationComputingScript.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationComputingScript.java 2009-12-22 10:47:34 UTC (rev 1949) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationComputingScript.java 2009-12-22 19:02:23 UTC (rev 1950) @@ -9,6 +9,7 @@ import java.net.URL; import java.text.DecimalFormat; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -48,6 +49,8 @@ private static int minInstanceCount = 3; private static int algorithmRuntimeInSeconds = 10; + + private static int allListsComputingCount = 5; private static DecimalFormat df = new DecimalFormat(); @@ -57,7 +60,9 @@ private static boolean useApproximations = false; private static boolean computeApproxDiff = false; + private Set<NamedClass> reducedClassesSet; + private Map<NamedClass, List<EvaluatedDescriptionClass>> fastEquivalenceStandardMap = new HashMap<NamedClass, List<EvaluatedDescriptionClass>>(); private Map<NamedClass, List<EvaluatedDescriptionClass>> fastEquivalenceFMeasureMap = new HashMap<NamedClass, List<EvaluatedDescriptionClass>>(); private Map<NamedClass, List<EvaluatedDescriptionClass>> fastEquivalencePredaccMap = new HashMap<NamedClass, List<EvaluatedDescriptionClass>>(); @@ -92,9 +97,9 @@ public EvaluationComputingScript(URL fileURL) throws ComponentInitException, MalformedURLException, LearningProblemUnsupportedException{ loadOntology(fileURL); + computeWithApproximation(); computeSuggestions(); computeGenFMeasureWithoutDefaultNegation(); - computeWithApproximation(); saveResults(); } @@ -111,7 +116,7 @@ private void saveResults() { OutputStream fos = null; - File file = new File("test.ser"); + File file = new File("test2.ser"); try { fos = new FileOutputStream(file); ObjectOutputStream o = new ObjectOutputStream(fos); @@ -154,7 +159,8 @@ } } - private void computeSuggestions() throws ComponentInitException, MalformedURLException, LearningProblemUnsupportedException { + private void computeSuggestions() throws ComponentInitException, MalformedURLException, + LearningProblemUnsupportedException { ComponentManager cm = ComponentManager.getInstance(); TreeSet<EvaluatedDescriptionClass> suggestions; for (int i = 0; i <= 1; i++) { @@ -173,11 +179,7 @@ prefixes = reasoner.getPrefixes(); // loop through all classes - Set<NamedClass> classes = new TreeSet<NamedClass>(reasoner.getNamedClasses()); - classes.remove(new NamedClass("http://www.w3.org/2002/07/owl#Thing")); - // reduce number of classes for testing purposes - // shrinkSet(classes, 20); - for (NamedClass nc : classes) { + for (NamedClass nc : reducedClassesSet) { // check whether the class has sufficient instances int instanceCount = reasoner.getIndividuals(nc).size(); if (instanceCount < minInstanceCount) { @@ -188,129 +190,129 @@ + " with " + instanceCount + " instances"); ClassLearningProblem lp = cm.learningProblem(ClassLearningProblem.class, reasoner); lp.getConfigurator().setClassToDescribe(nc.getURI().toURL()); - for(int j = 0; j <= 1; j++){ - if(j == 0){ + for (int j = 0; j <= 1; j++) { + if (j == 0) { lp.getConfigurator().setType("equivalence"); System.out.println("Learning equivalentClass expressions"); } else { lp.getConfigurator().setType("superClass"); System.out.println("Learning superClass expressions"); } - for(int k = 0; k <= 3; k++){ - if(k == 0){ - lp.getConfigurator().setAccuracyMethod("standard"); - System.out.println("Using accuracy method: standard"); - } else if(k == 1){ - lp.getConfigurator().setAccuracyMethod("fmeasure"); - System.out.println("Using accuracy method: F-Measure"); - } else if(k == 2){ - lp.getConfigurator().setAccuracyMethod("pred_acc"); - System.out.println("Using accuracy method: Predictive accuracy"); - } else if(k == 3){ - lp.getConfigurator().setAccuracyMethod("jaccard"); - System.out.println("Using accuracy method: Jaccard"); - } else{ - lp.getConfigurator().setAccuracyMethod("generalised_fmeasure"); - System.out.println("Using accuracy method: Generalised F-Measure"); - } - lp.getConfigurator().setUseApproximations(useApproximations); - lp.init(); - CELOE celoe = cm.learningAlgorithm(CELOE.class, lp, reasoner); - CELOEConfigurator cf = celoe.getConfigurator(); - cf.setUseNegation(false); - cf.setValueFrequencyThreshold(3); - cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds); - cf.setNoisePercentage(noisePercent); - cf.setMaxNrOfResults(10); - celoe.init(); + for (int k = 0; k <= 3; k++) { + if (k == 0) { + lp.getConfigurator().setAccuracyMethod("standard"); + System.out.println("Using accuracy method: standard"); + } else if (k == 1) { + lp.getConfigurator().setAccuracyMethod("fmeasure"); + System.out.println("Using accuracy method: F-Measure"); + } else if (k == 2) { + lp.getConfigurator().setAccuracyMethod("pred_acc"); + System.out.println("Using accuracy method: Predictive accuracy"); + } else if (k == 3) { + lp.getConfigurator().setAccuracyMethod("jaccard"); + System.out.println("Using accuracy method: Jaccard"); + } else { + lp.getConfigurator().setAccuracyMethod("generalised_fmeasure"); + System.out.println("Using accuracy method: Generalised F-Measure"); + } + lp.getConfigurator().setUseApproximations(useApproximations); + lp.init(); + CELOE celoe = cm.learningAlgorithm(CELOE.class, lp, reasoner); + CELOEConfigurator cf = celoe.getConfigurator(); + cf.setUseNegation(false); + cf.setValueFrequencyThreshold(3); + cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds); + cf.setNoisePercentage(noisePercent); + cf.setMaxNrOfResults(10); + celoe.init(); - celoe.start(); - - - // test whether a solution above the threshold was found - EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); - double bestAcc = best.getAccuracy(); - - if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) { - System.out - .println("The algorithm did not find a suggestion with an accuracy above the threshold of " - + (100 * minAccuracy) - + "% or the best description is not appropriate. (The best one was \"" - + best.getDescription().toManchesterSyntaxString(baseURI, - prefixes) - + "\" with an accuracy of " - + df.format(bestAcc) + ".) - skipping"); - suggestions = new TreeSet<EvaluatedDescriptionClass>(); - } else { + celoe.start(); + // test whether a solution above the threshold + // was found + EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); + double bestAcc = best.getAccuracy(); - suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe - .getCurrentlyBestEvaluatedDescriptions(); +// if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) { +// System.out +// .println("The algorithm did not find a suggestion with an accuracy above the threshold of " +// + (100 * minAccuracy) +// + "% or the best description is not appropriate. (The best one was \"" +// + best.getDescription().toManchesterSyntaxString(baseURI, prefixes) +// + "\" with an accuracy of " + df.format(bestAcc) + ".) - skipping"); +// suggestions = new TreeSet<EvaluatedDescriptionClass>(); +// } else { +// +// suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe +// .getCurrentlyBestEvaluatedDescriptions(); +// } + suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe + .getCurrentlyBestEvaluatedDescriptions(); + List<EvaluatedDescriptionClass> suggestionsList = new LinkedList<EvaluatedDescriptionClass>( + suggestions.descendingSet()); + + if (i == 0) { + if (j == 0) { + if (k == 0) { + owlEquivalenceStandardMap.put(nc, suggestionsList); + } else if (k == 1) { + owlEquivalenceFMeasureMap.put(nc, suggestionsList); + } else if (k == 2) { + owlEquivalencePredaccMap.put(nc, suggestionsList); + } else if (k == 3) { + owlEquivalenceJaccardMap.put(nc, suggestionsList); + } else { + owlEquivalenceGenFMeasureMap.put(nc, suggestionsList); + } + } else { + if (k == 0) { + owlSuperStandardMap.put(nc, suggestionsList); + } else if (k == 1) { + owlSuperFMeasureMap.put(nc, suggestionsList); + } else if (k == 2) { + owlSuperPredaccMap.put(nc, suggestionsList); + } else if (k == 3) { + owlSuperJaccardMap.put(nc, suggestionsList); + } else { + owlSuperGenFMeasureMap.put(nc, suggestionsList); + } } - List<EvaluatedDescriptionClass> suggestionsList = new LinkedList<EvaluatedDescriptionClass>( - suggestions.descendingSet()); - - if(i == 0){ - if(j == 0){ - if(k == 0){ - owlEquivalenceStandardMap.put(nc, suggestionsList); - } else if( k == 1){ - owlEquivalenceFMeasureMap.put(nc, suggestionsList); - } else if(k == 2){ - owlEquivalencePredaccMap.put(nc, suggestionsList); - } else if(k == 3){ - owlEquivalenceJaccardMap.put(nc, suggestionsList); - } else { - owlEquivalenceGenFMeasureMap.put(nc, suggestionsList); - } - } else { - if(k == 0){ - owlSuperStandardMap.put(nc, suggestionsList); - } else if( k == 1){ - owlSuperFMeasureMap.put(nc, suggestionsList); - } else if(k == 2){ - owlSuperPredaccMap.put(nc, suggestionsList); - } else if(k == 3){ - owlSuperJaccardMap.put(nc, suggestionsList); - } else { - owlSuperGenFMeasureMap.put(nc, suggestionsList); - } - } + } else { + if (j == 0) { + if (k == 0) { + fastEquivalenceStandardMap.put(nc, suggestionsList); + } else if (k == 1) { + fastEquivalenceFMeasureMap.put(nc, suggestionsList); + } else if (k == 2) { + fastEquivalencePredaccMap.put(nc, suggestionsList); + } else if (k == 3) { + fastEquivalenceJaccardMap.put(nc, suggestionsList); } else { - if(j == 0){ - if(k == 0){ - fastEquivalenceStandardMap.put(nc, suggestionsList); - } else if( k == 1){ - fastEquivalenceFMeasureMap.put(nc, suggestionsList); - } else if(k == 2){ - fastEquivalencePredaccMap.put(nc, suggestionsList); - } else if(k == 3){ - fastEquivalenceJaccardMap.put(nc, suggestionsList); - } else { - fastEquivalenceGenFMeasureMap.put(nc, suggestionsList); - } - } else { - if(k == 0){ - fastSuperStandardMap.put(nc, suggestionsList); - } else if( k == 1){ - fastSuperFMeasureMap.put(nc, suggestionsList); - } else if(k == 2){ - fastSuperPredaccMap.put(nc, suggestionsList); - } else if(k == 3){ - fastSuperJaccardMap.put(nc, suggestionsList); - } else { - fastSuperGenFMeasureMap.put(nc, suggestionsList); - } - } + fastEquivalenceGenFMeasureMap.put(nc, suggestionsList); } -// } + } else { + if (k == 0) { + fastSuperStandardMap.put(nc, suggestionsList); + } else if (k == 1) { + fastSuperFMeasureMap.put(nc, suggestionsList); + } else if (k == 2) { + fastSuperPredaccMap.put(nc, suggestionsList); + } else if (k == 3) { + fastSuperJaccardMap.put(nc, suggestionsList); + } else { + fastSuperGenFMeasureMap.put(nc, suggestionsList); + } + } + } + // } cm.freeComponent(celoe); -// cm.freeComponent(lp); + // cm.freeComponent(lp); } } } cm.freeComponent(lp); } + cm.freeComponent(reasoner); } cm.freeComponent(reasoner); @@ -318,6 +320,13 @@ cm.freeComponent(celoe); } + /** + * Computing results for accuracy method 'Generalised F-Measure'. This is done separate because + * for FastInstanceChecker option useDefaultNegation is set to 'false'. + * @throws ComponentInitException + * @throws MalformedURLException + * @throws LearningProblemUnsupportedException + */ private void computeGenFMeasureWithoutDefaultNegation() throws ComponentInitException, MalformedURLException, LearningProblemUnsupportedException { ComponentManager cm = ComponentManager.getInstance(); @@ -338,12 +347,7 @@ baseURI = reasoner.getBaseURI(); prefixes = reasoner.getPrefixes(); - // loop through all classes - Set<NamedClass> classes = new TreeSet<NamedClass>(reasoner.getNamedClasses()); - classes.remove(new NamedClass("http://www.w3.org/2002/07/owl#Thing")); - // reduce number of classes for testing purposes - // shrinkSet(classes, 20); - for (NamedClass nc : classes) { + for (NamedClass nc : reducedClassesSet) { // check whether the class has sufficient instances int instanceCount = reasoner.getIndividuals(nc).size(); if (instanceCount < minInstanceCount) { @@ -381,19 +385,21 @@ EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); double bestAcc = best.getAccuracy(); - if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) { - System.out - .println("The algorithm did not find a suggestion with an accuracy above the threshold of " - + (100 * minAccuracy) - + "% or the best description is not appropriate. (The best one was \"" - + best.getDescription().toManchesterSyntaxString(baseURI, prefixes) - + "\" with an accuracy of " + df.format(bestAcc) + ".) - skipping"); - suggestions = new TreeSet<EvaluatedDescriptionClass>(); - } else { - - suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe - .getCurrentlyBestEvaluatedDescriptions(); - } +// if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) { +// System.out +// .println("The algorithm did not find a suggestion with an accuracy above the threshold of " +// + (100 * minAccuracy) +// + "% or the best description is not appropriate. (The best one was \"" +// + best.getDescription().toManchesterSyntaxString(baseURI, prefixes) +// + "\" with an accuracy of " + df.format(bestAcc) + ".) - skipping"); +// suggestions = new TreeSet<EvaluatedDescriptionClass>(); +// } else { +// +// suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe +// .getCurrentlyBestEvaluatedDescriptions(); +// } + suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe + .getCurrentlyBestEvaluatedDescriptions(); List<EvaluatedDescriptionClass> suggestionsList = new LinkedList<EvaluatedDescriptionClass>( suggestions.descendingSet()); @@ -501,9 +507,22 @@ } } - cm.freeAllComponents(); + reducedClassesSet = getShrinkedSet(defaultEquivalenceMap.keySet(), allListsComputingCount); + } + private Set<NamedClass> getShrinkedSet(Set<NamedClass> set, int count){ + Set<NamedClass> reducedSet = new HashSet<NamedClass>(); + int i = count; + for(NamedClass nc : set){ + if(i % count == 0){ + reducedSet.add(nc); + } + i++; + } + return reducedSet; + + } /** * @param args * @throws MalformedURLException Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationGUI.java 2009-12-22 10:47:34 UTC (rev 1949) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/EvaluationGUI.java 2009-12-22 19:02:23 UTC (rev 1950) @@ -34,6 +34,7 @@ import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JSeparator; +import javax.swing.JTextField; import javax.swing.JWindow; import javax.swing.SwingUtilities; import javax.swing.UIManager; @@ -60,16 +61,16 @@ */ private static final long serialVersionUID = -3097551929270352556L; - private ResultTable tab1; - private ResultTable tab2; - private ResultTable tab3; - private ResultTable tab4; - private ResultTable tab5; - private ResultTable tab6; - private ResultTable tab7; - private ResultTable tab8; - private ResultTable tab9; - private ResultTable tab10; + private RatingTablePanel tab1; + private RatingTablePanel tab2; + private RatingTablePanel tab3; + private RatingTablePanel tab4; + private RatingTablePanel tab5; + private RatingTablePanel tab6; + private RatingTablePanel tab7; + private RatingTablePanel tab8; + private RatingTablePanel tab9; + private RatingTablePanel tab10; private SelectableClassExpressionsTable defaultTab; @@ -152,7 +153,7 @@ setLayout(new BorderLayout()); classesTable = new MarkableClassesTable(); - classesTable.addClasses(new TreeSet<NamedClass>(owlEquivalenceStandardMap.keySet())); + classesTable.addClasses(new TreeSet<NamedClass>(defaultEquivalenceMap.keySet())); JScrollPane classesScroll = new JScrollPane(classesTable); classesTable.addMouseMotionListener(this); add(classesScroll, BorderLayout.WEST); @@ -197,6 +198,8 @@ } private JPanel createSingleTablePanel(){ + JPanel panel = new JPanel(new GridLayout(3,1)); + JPanel tableHolderPanel = new JPanel(new BorderLayout()); defaultTab = new SelectableClassExpressionsTable(); defaultTab.getSelectionModel().addListSelectionListener(this); @@ -205,44 +208,53 @@ graphPanel = new GraphicalCoveragePanel(""); tableHolderPanel.add(graphPanel, BorderLayout.EAST); + JPanel noSuggestionPanel = new JPanel(); + noSuggestionPanel.add(new JCheckBox("There is no appropriate suggestion for this class in your opinion.")); - return tableHolderPanel; + JPanel alternateSuggestionPanel = new JPanel(); + alternateSuggestionPanel.add(new JTextField("There is an appropriate suggestion in your opinion, but the algorithm did not suggest it.")); + + panel.add(tableHolderPanel); + panel.add(noSuggestionPanel); + panel.add(alternateSuggestionPanel); + + return panel; } private JPanel createMultiTablesPanel(){ JPanel tablesHolderPanel = new JPanel(); tablesHolderPanel.setLayout(new GridLayout(5, 2, 5, 5)); tablesHolderPanel.addMouseMotionListener(this); - tab1 = new ResultTable(); + tab1 = new RatingTablePanel(); tab1.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab1)); - tab2 = new ResultTable(); + tablesHolderPanel.add(tab1); + tab2 = new RatingTablePanel(); tab2.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab2)); - tab3 = new ResultTable(); + tablesHolderPanel.add(tab2); + tab3 = new RatingTablePanel(); tab3.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab3)); - tab4 = new ResultTable(); + tablesHolderPanel.add(tab3); + tab4 = new RatingTablePanel(); tab4.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab4)); - tab5 = new ResultTable(); + tablesHolderPanel.add(tab4); + tab5 = new RatingTablePanel(); tab5.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab5)); - tab6 = new ResultTable(); + tablesHolderPanel.add(tab5); + tab6 = new RatingTablePanel(); tab6.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab6)); - tab7 = new ResultTable(); + tablesHolderPanel.add(tab6); + tab7 = new RatingTablePanel(); tab7.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab7)); - tab8 = new ResultTable(); + tablesHolderPanel.add(tab7); + tab8 = new RatingTablePanel(); tab8.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab8)); - tab9 = new ResultTable(); + tablesHolderPanel.add(tab8); + tab9 = new RatingTablePanel(); tab9.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab9)); - tab10 = new ResultTable(); + tablesHolderPanel.add(tab9); + tab10 = new RatingTablePanel(); tab10.addMouseMotionListener(this); - tablesHolderPanel.add(createSelectablePanel(tab10)); + tablesHolderPanel.add(tab10); return tablesHolderPanel; } @@ -272,17 +284,20 @@ private void showEquivalentSuggestions(NamedClass nc){ messageLabel.setText(EQUIVALENTCLASSTEXT); - tab1.addResults(owlEquivalenceStandardMap.get(nc)); - tab2.addResults(owlEquivalenceFMeasureMap.get(nc)); - tab3.addResults(owlEquivalencePredaccMap.get(nc)); - tab4.addResults(owlEquivalenceJaccardMap.get(nc)); - tab5.addResults(owlEquivalenceGenFMeasureMap.get(nc)); + if(owlEquivalenceStandardMap.get(nc) != null){ + tab1.addResults(owlEquivalenceStandardMap.get(nc)); + tab2.addResults(owlEquivalenceFMeasureMap.get(nc)); + tab3.addResults(owlEquivalencePredaccMap.get(nc)); + tab4.addResults(owlEquivalenceJaccardMap.get(nc)); + tab5.addResults(owlEquivalenceGenFMeasureMap.get(nc)); + + tab6.addResults(fastEquivalenceStandardMap.get(nc)); + tab7.addResults(fastEquivalenceFMeasureMap.get(nc)); + tab8.addResults(fastEquivalencePredaccMap.get(nc)); + tab9.addResults(fastEquivalenceJaccardMap.get(nc)); + tab10.addResults(fastEquivalenceGenFMeasureMap.get(nc)); + } - tab6.addResults(fastEquivalenceStandardMap.get(nc)); - tab7.addResults(fastEquivalenceFMeasureMap.get(nc)); - tab8.addResults(fastEquivalencePredaccMap.get(nc)); - tab9.addResults(fastEquivalenceJaccardMap.get(nc)); - tab10.addResults(fastEquivalenceGenFMeasureMap.get(nc)); defaultTab.addResults(defaultEquivalenceMap.get(nc)); @@ -292,17 +307,20 @@ private void showSuperSuggestions(NamedClass nc){ messageLabel.setText(SUPERCLASSTEXT); - tab1.addResults(owlSuperStandardMap.get(nc)); - tab2.addResults(owlSuperFMeasureMap.get(nc)); - tab3.addResults(owlSuperPredaccMap.get(nc)); - tab4.addResults(owlSuperJaccardMap.get(nc)); - tab5.addResults(owlSuperGenFMeasureMap.get(nc)); + if(owlSuperStandardMap.get(nc) != null){ + tab1.addResults(owlSuperStandardMap.get(nc)); + tab2.addResults(owlSuperFMeasureMap.get(nc)); + tab3.addResults(owlSuperPredaccMap.get(nc)); + tab4.addResults(owlSuperJaccardMap.get(nc)); + tab5.addResults(owlSuperGenFMeasureMap.get(nc)); + + tab6.addResults(fastSuperStandardMap.get(nc)); + tab7.addResults(fastSuperFMeasureMap.get(nc)); + tab8.addResults(fastSuperPredaccMap.get(nc)); + tab9.addResults(fastSuperJaccardMap.get(nc)); + tab10.addResults(fastSuperGenFMeasureMap.get(nc)); + } - tab6.addResults(fastSuperStandardMap.get(nc)); - tab7.addResults(fastSuperFMeasureMap.get(nc)); - tab8.addResults(fastSuperPredaccMap.get(nc)); - tab9.addResults(fastSuperJaccardMap.get(nc)); - tab10.addResults(fastSuperGenFMeasureMap.get(nc)); defaultTab.addResults(defaultSuperMap.get(nc)); @@ -397,13 +415,35 @@ showSuperSuggestions(nc); showSingleTable(); } else if(!showingMultiTables && showingEquivalentSuggestions){ - showMultiTables(); + if(owlEquivalenceStandardMap.get(nc) != null){ + showMultiTables(); + } else { + showSuperSuggestions(nc); + showSingleTable(); + if(currentClassIndex + 1 >= defaultEquivalenceMap.keySet().size()){ + nextFinishButton.setText("Finish"); + nextFinishButton.setActionCommand("finish"); + } + } + } else if(!showingMultiTables && !showingEquivalentSuggestions){ - showMultiTables(); - if(currentClassIndex + 1 >= owlEquivalenceStandardMap.keySet().size()){ - nextFinishButton.setText("Finish"); - nextFinishButton.setActionCommand("finish"); + if(owlEquivalenceStandardMap.get(nc) != null){ + showMultiTables(); + if(currentClassIndex + 1 >= defaultEquivalenceMap.keySet().size()){ + nextFinishButton.setText("Finish"); + nextFinishButton.setActionCommand("finish"); + } + } else { + + currentClassIndex++; + classesTable.setSelectedClass(currentClassIndex); + graphPanel.setConcept(classesTable.getSelectedClass(currentClassIndex)); + + showEquivalentSuggestions(classesTable.getSelectedClass(currentClassIndex)); + showSingleTable(); } + + } else { currentClassIndex++; @@ -503,6 +543,44 @@ } + class RatingTablePanel extends JPanel{ + + /** + * + */ + private static final long serialVersionUID = 7408917327199664584L; + private ResultTable table; + private RatingPanel rating; + + public RatingTablePanel(){ + setLayout(new BorderLayout()); + setBorder(BorderFactory.createLineBorder(Color.BLACK)); + table = new ResultTable(); + add(table, BorderLayout.CENTER); + rating = new RatingPanel(); + add(rating, BorderLayout.EAST); + + } + + public void addResults(List<EvaluatedDescriptionClass> resultList){ + table.addResults(resultList); + } + + public void reset(){ + rating.clearSelection(); + } + + public int getRatingValue(){ + return rating.getSelectedValue(); + } + + public void addMouseMotionListener(MouseMotionListener mL){ + rating.addMouseMotionListener(mL); + table.addMouseMotionListener(mL); + } + + } + class RatingPanel extends JPanel{ /** Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/GraphicalCoveragePanel.java 2009-12-22 10:47:34 UTC (rev 1949) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/GraphicalCoveragePanel.java 2009-12-22 19:02:23 UTC (rev 1950) @@ -490,8 +490,8 @@ int coverage = (int)(((EvaluatedDescriptionClass) eval).getCoverage() * 100); int additionalCount = ((EvaluatedDescriptionClass) eval).getAdditionalInstances().size(); coverageString = "Covers " + coveredInstanceCount + " of " + instanceCount + - "(" + coverage + "%) of all instances"; - coversAdditionalString = "Covers " + additionalCount + " additional instances"; + "(" + coverage + " %) of all instances."; + coversAdditionalString = "Covers " + additionalCount + " additional instances."; getParent().repaint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |