From: <jen...@us...> - 2009-06-15 06:15:31
|
Revision: 1797 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1797&view=rev Author: jenslehmann Date: 2009-06-15 06:14:21 +0000 (Mon, 15 Jun 2009) Log Message: ----------- collect more statistical values Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -118,7 +118,7 @@ private ConceptComparator descriptionComparator = new ConceptComparator(); // statistical variables - private int descriptionTests = 0; + private int expressionTests = 0; private int minHorizExp = 0; private int maxHorizExp = 0; @@ -283,9 +283,9 @@ } if (stop) { - logger.info("Algorithm stopped ("+descriptionTests+" descriptions tested).\n"); + logger.info("Algorithm stopped ("+expressionTests+" descriptions tested).\n"); } else { - logger.info("Algorithm terminated successfully ("+descriptionTests+" descriptions tested).\n"); + logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested).\n"); } // print solution(s) @@ -345,7 +345,7 @@ // quality of description (return if too weak) double accuracy = learningProblem.getAccuracyOrTooWeak(description, noise); - descriptionTests++; + expressionTests++; // System.out.println(description + " " + accuracy); if(accuracy == -1) { return false; @@ -503,7 +503,7 @@ nodes = new TreeSet<OENode>(heuristic); descriptions = new TreeSet<Description>(new ConceptComparator()); bestEvaluatedDescriptions.getSet().clear(); - descriptionTests = 0; + expressionTests = 0; } @Override @@ -582,4 +582,10 @@ return minHorizExp; } + /** + * @return the expressionTests + */ + public int getClassExpressionTests() { + return expressionTests; + } } Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -101,6 +101,7 @@ String userInputProtocol = ""; int classCandidatesCount = 0; Stat instanceCountStat = new Stat(); + Stat classExpressionTestsStat = new Stat(); // equivalence classes int candidatesAboveThresholdCount = 0; @@ -109,6 +110,7 @@ int noSensibleDescriptionCount = 0; int inconsistencyDetected = 0; int moreInstancesCount = 0; + int nonPerfectCount = 0; Stat moreInstancesCountStat = new Stat(); Stat accStat = new Stat(); Stat accSelectedStat = new Stat(); @@ -122,6 +124,7 @@ int noSensibleDescriptionCountSC = 0; int inconsistencyDetectedSC = 0; int moreInstancesCountSC = 0; + int nonPerfectCountSC = 0; Stat moreInstancesCountStatSC = new Stat(); Stat accStatSC = new Stat(); Stat accSelectedStatSC = new Stat(); @@ -176,7 +179,8 @@ celoe.init(); celoe.start(); - + classExpressionTestsStat.addNumber(celoe.getClassExpressionTests()); + // test whether a solution above the threshold was found EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); double bestAcc = best.getAccuracy(); @@ -295,6 +299,9 @@ moreInstancesCount++; moreInstancesCountStat.addNumber(additionalInstances); } + if(bestAcc < 0.9999) { + nonPerfectCount++; + } } else { accSelectedStatSC.addNumber(bestAcc); positionStatSC.addNumber(selectedNr); @@ -306,6 +313,9 @@ moreInstancesCountSC++; moreInstancesCountStatSC.addNumber(additionalInstances); } + if(bestAcc < 0.9999) { + nonPerfectCountSC++; + } } } } @@ -323,10 +333,12 @@ .println("knowledge engineering process finished successfully - summary shown below"); System.out.println(); System.out.println("ontology: " + args[0]); + System.out.println("settings: " + minAccuracy + " min accuracy, " + minInstanceCount + " min instances, " + algorithmRuntimeInSeconds + "s algorithm runtime"); System.out.println("user input protocol: " + userInputProtocol); System.out.println("classes in ontology: " + classes.size()); System.out.println("classes with at least " + minInstanceCount + " instances: " + classCandidatesCount); + System.out.println("class expressions tested: " + classExpressionTestsStat.prettyPrint("")); System.out.println(); System.out.println("statistics for equivalence axioms:"); @@ -334,13 +346,14 @@ + candidatesAboveThresholdCount); System.out.println("axioms learned succesfully: " + foundDescriptionCount); System.out.println("axioms missed: " + missesCount); - System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCount); + System.out.println("class with no sensible axioms: " + noSensibleDescriptionCount); System.out.println("average accuracy overall: " + accStat.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStat.prettyPrint("")); - System.out.println("average accuracy of expressions above threshold " + System.out.println("average accuracy of expressions above threshold: " + accAboveThresholdStat.prettyPrint("")); - System.out.println("average number typed by user " + positionStat.prettyPrint("")); + System.out.println("non-perfect (not 100% accuracy) axioms selected: " + nonPerfectCount); + System.out.println("average number typed by user: " + positionStat.prettyPrint("")); System.out.println(); System.out.println("statistics for super class axioms:"); @@ -348,13 +361,14 @@ + candidatesAboveThresholdCountSC); System.out.println("axioms learned succesfully: " + foundDescriptionCountSC); System.out.println("axioms missed: " + missesCountSC); - System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCountSC); + System.out.println("class with no sensible axioms: " + noSensibleDescriptionCountSC); System.out.println("average accuracy overall: " + accStatSC.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStatSC.prettyPrint("")); - System.out.println("average accuracy of expressions above threshold " + System.out.println("average accuracy of expressions above threshold: " + accAboveThresholdStatSC.prettyPrint("")); - System.out.println("average number typed by user " + positionStatSC.prettyPrint("")); + System.out.println("non-perfect (not 100% accuracy) axioms selected: " + nonPerfectCountSC); + System.out.println("average number typed by user: " + positionStatSC.prettyPrint("")); } @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -128,12 +128,16 @@ } public String prettyPrint(String unit) { - DecimalFormat df = new DecimalFormat(); - String str = "av. " + df.format(getMean()) + unit; - str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; - str += "min " + df.format(getMin()) + unit + "; "; - str += "max " + df.format(getMax()) + unit + ")"; - return str; + if(sum > 0) { + DecimalFormat df = new DecimalFormat(); + String str = "av. " + df.format(getMean()) + unit; + str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; + str += "min " + df.format(getMin()) + unit + "; "; + str += "max " + df.format(getMax()) + unit + ")"; + return str; + } else { + return "no data collected"; + } } public String prettyPrint(String unit, DecimalFormat df) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |