From: <jen...@us...> - 2009-08-06 14:23:35
|
Revision: 1819 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1819&view=rev Author: jenslehmann Date: 2009-08-06 14:23:17 +0000 (Thu, 06 Aug 2009) Log Message: ----------- - new stat constructor for merging two stat objects - evaluation script extended Modified Paths: -------------- 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/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-08-04 20:07:44 UTC (rev 1818) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-08-06 14:23:17 UTC (rev 1819) @@ -78,10 +78,10 @@ private static DecimalFormat df = new DecimalFormat(); // for performance measurements and development - private static boolean autoMode = true; + private static boolean autoMode = false; private static boolean useFastInstanceChecker = true; - private static boolean useApproximations = false; - private static boolean computeApproxDiff = true; + private static boolean useApproximations = true; + private static boolean computeApproxDiff = false; @SuppressWarnings("unchecked") public static void main(String[] args) throws ComponentInitException, @@ -424,6 +424,24 @@ + accAboveThresholdStatSC.prettyPrint("")); System.out.println("non-perfect (not 100% accuracy) axioms selected: " + nonPerfectCountSC); System.out.println("average number typed by user: " + positionStatSC.prettyPrint("")); + System.out.println(); + + System.out.println("merged statistics for equivalence/superclass:"); + System.out.println("classes above " + (minAccuracy * 100) + "% threshold: " + + (candidatesAboveThresholdCount+candidatesAboveThresholdCountSC)); + System.out.println("axioms learned succesfully: " + (foundDescriptionCount+foundDescriptionCountSC)); + System.out.println("axioms missed: " + (missesCount+missesCountSC)); + System.out.println("class with no sensible axioms: " + (noSensibleDescriptionCount+noSensibleDescriptionCountSC)); + System.out.println("inconsistencies detected: " + (inconsistencyDetected+inconsistencyDetectedSC)); + System.out.println("additional instances found: " + new Stat(moreInstancesCountStat,moreInstancesCountStatSC).prettyPrint("")); + System.out.println("average accuracy overall: " + new Stat(accStat,accStatSC).prettyPrint("")); + System.out.println("average accuracy of selected expressions: " + + new Stat(accSelectedStat,accSelectedStatSC).prettyPrint("")); + System.out.println("average accuracy of expressions above threshold: " + + new Stat(accAboveThresholdStat,accAboveThresholdStatSC).prettyPrint("")); + System.out.println("non-perfect (not 100% accuracy) axioms selected: " + (nonPerfectCount+nonPerfectCountSC)); + System.out.println("average number typed by user: " + new Stat(positionStat,positionStatSC).prettyPrint("")); + System.out.println(); } @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-08-04 20:07:44 UTC (rev 1818) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-08-06 14:23:17 UTC (rev 1819) @@ -39,7 +39,26 @@ //used to give a good percentage output private DecimalFormat df = new DecimalFormat( ".00%" ); + public Stat() { + + } + /** + * Creates a new stat object by merging two stat objects. The result is the same as if + * the numbers, which have been added to stat1 and stat2 would have been added to this + * stat object. + * @param stat1 Statistical object 1. + * @param stat2 Statistical object 2. + */ + public Stat(Stat stat1, Stat stat2) { + count = stat1.count + stat2.count; + sum = stat1.sum + stat2.sum; + squareSum = stat1.squareSum + stat2.squareSum; + min = Math.min(stat1.min, stat2.min); + max = Math.max(stat1.max, stat2.max); + } + + /** * Add a number to this object. * * @param number This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |