From: <jen...@us...> - 2009-11-24 07:14:35
|
Revision: 1916 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1916&view=rev Author: jenslehmann Date: 2009-11-24 07:14:29 +0000 (Tue, 24 Nov 2009) Log Message: ----------- introduced parameter for controlling approximate coverage test + minor improvements Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -301,9 +301,9 @@ } if (stop) { - logger.info("Algorithm stopped ("+expressionTests+" descriptions tested).\n"); + logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } else { - logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested).\n"); + logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } if(singleSuggestionMode) { Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -82,6 +82,15 @@ return (Boolean) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "useApproximations") ; } /** +* approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +* @return double +**/ +public double getApproxAccuracy() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "approxAccuracy") ; +} +/** * accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true * default value: standard @@ -118,6 +127,15 @@ reinitNecessary = true; } /** +* @param approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +**/ +public void setApproxAccuracy(double approxAccuracy) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "approxAccuracy", approxAccuracy); +reinitNecessary = true; +} +/** * @param accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true * default value: standard Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -408,6 +408,23 @@ } } + // conf example: + +// import("mutation.owl"); +// +// reasoner = fastInstanceChecker; +// +// problem = classLearning; +// classLearning.classToDescribe = "http://dl-learner.org/mutation#DeletoriousMutation"; +// classLearning.accuracyMethod = "fmeasure"; +// classLearning.approxAccuracy = 0.03; +// +// algorithm = celoe; +// celoe.maxExecutionTimeInSeconds = 10; +// celoe.noisePercentage = 10; +// celoe.maxNrOfResults = 1; +// celoe.singleSuggestionMode = true; + // writing conf file Files.clearFile(confFile); String confHeader = "import(\"" + owlFile.getName() + "\");\n\n"; Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -33,6 +33,7 @@ import org.dllearner.core.configurators.ClassLearningProblemConfigurator; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.DoubleConfigOption; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.options.URLConfigOption; import org.dllearner.core.owl.Axiom; @@ -60,7 +61,7 @@ private boolean equivalence = true; private ClassLearningProblemConfigurator configurator; // approximation of accuracy +- 0.05 % - private static final double approx = 0.05; + private double approx = 0.05; private boolean useApproximations; private boolean useFMeasure; @@ -91,6 +92,8 @@ options.add(type); BooleanConfigOption approx = new BooleanConfigOption("useApproximations", "whether to use stochastic approximations for computing accuracy", true); options.add(approx); + DoubleConfigOption approxAccuracy = new DoubleConfigOption("approxAccuracy", "accuracy of the approximation (only for expert use)", 0.05); + options.add(approxAccuracy); StringConfigOption accMethod = new StringConfigOption("accuracyMethod", "Specifies, which method/function to use for computing accuracy.","standard"); // or domain/range of a property. accMethod.setAllowedValues(new String[] {"standard", "fmeasure", "predacc"}); options.add(accMethod); @@ -106,6 +109,7 @@ classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); useApproximations = configurator.getUseApproximations(); useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); + approx = configurator.getApproxAccuracy(); if(!reasoner.getNamedClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + configurator.getClassToDescribe() + "\" does not exist. Make sure you spelled it correctly."); @@ -333,10 +337,10 @@ double size; if(estimatedA) { // size = 1/(coverageFactor+1) * (coverageFactor * (upperBorderA-lowerBorderA) + Math.sqrt(upperEstimateA/(upperEstimateA+lowerEstimate)) + Math.sqrt(lowerEstimateA/(lowerEstimateA+upperEstimate))); - size = getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); + size = useFMeasure ? getFMeasure(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getFMeasure(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)) : getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); } else { // size = 1/(coverageFactor+1) * (coverageFactor * coverage + Math.sqrt(instancesCovered/(instancesCovered+lowerEstimate)) + Math.sqrt(instancesCovered/(instancesCovered+upperEstimate))); - size = getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); + size = useFMeasure ? getFMeasure(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getFMeasure(recall, instancesCovered/(double)(instancesCovered+upperEstimate)) : getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); } if(size < 0.1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |