From: <jen...@us...> - 2010-12-16 12:26:40
|
Revision: 2567 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2567&view=rev Author: jenslehmann Date: 2010-12-16 12:26:33 +0000 (Thu, 16 Dec 2010) Log Message: ----------- implemented noise termination criterion for CELOE Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java trunk/examples/swore/swore.conf Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2010-12-16 09:17:45 UTC (rev 2566) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2010-12-16 12:26:33 UTC (rev 2567) @@ -172,6 +172,7 @@ options.add(CommonConfigOptions.useDoubleDatatypes()); options.add(CommonConfigOptions.maxExecutionTimeInSeconds(10)); options.add(CommonConfigOptions.getNoisePercentage()); + options.add(CommonConfigOptions.getTerminateOnNoiseReached(false)); options.add(CommonConfigOptions.getMaxDepth(7)); options.add(CommonConfigOptions.maxNrOfResults(10)); options.add(CommonConfigOptions.maxClassDescriptionTests()); @@ -331,6 +332,10 @@ return bestEvaluatedDescriptions.getSet(); } + public double getCurrentlyBestAccuracy() { + return bestEvaluatedDescriptions.getBest().getAccuracy(); + } + @Override public void start() { // System.out.println(configurator.getMaxExecutionTimeInSeconds()); @@ -681,7 +686,8 @@ return stop || (configurator.getMaxClassDescriptionTests() != 0 && (expressionTests >= configurator.getMaxClassDescriptionTests())) || - (configurator.getMaxExecutionTimeInSeconds() != 0 && ((System.nanoTime() - nanoStartTime) >= (configurator.getMaxExecutionTimeInSeconds()*1000000000l))); + (configurator.getMaxExecutionTimeInSeconds() != 0 && ((System.nanoTime() - nanoStartTime) >= (configurator.getMaxExecutionTimeInSeconds()*1000000000l))) || + (configurator.getTerminateOnNoiseReached() && (100*getCurrentlyBestAccuracy()>100-configurator.getNoisePercentage())); } private void reset() { @@ -785,4 +791,5 @@ public int getClassExpressionTests() { return expressionTests; } + } Modified: trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java 2010-12-16 09:17:45 UTC (rev 2566) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java 2010-12-16 12:26:33 UTC (rev 2567) @@ -164,6 +164,15 @@ return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "noisePercentage") ; } /** +* terminateOnNoiseReached specifies whether to terminate when noise criterion is met. +* mandatory: false| reinit necessary: true +* default value: false +* @return boolean +**/ +public boolean getTerminateOnNoiseReached() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "terminateOnNoiseReached") ; +} +/** * maxDepth maximum depth of description. * mandatory: false| reinit necessary: true * default value: 7 @@ -372,6 +381,15 @@ reinitNecessary = true; } /** +* @param terminateOnNoiseReached specifies whether to terminate when noise criterion is met. +* mandatory: false| reinit necessary: true +* default value: false +**/ +public void setTerminateOnNoiseReached(boolean terminateOnNoiseReached) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "terminateOnNoiseReached", terminateOnNoiseReached); +reinitNecessary = true; +} +/** * @param maxDepth maximum depth of description. * mandatory: false| reinit necessary: true * default value: 7 Modified: trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2010-12-16 09:17:45 UTC (rev 2566) +++ trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2010-12-16 12:26:33 UTC (rev 2567) @@ -78,6 +78,10 @@ return new BooleanConfigOption("terminateOnNoiseReached", "specifies whether to terminate when noise criterion is met", terminateOnNoiseReachedDefault); } + public static BooleanConfigOption getTerminateOnNoiseReached(boolean defaultValue) { + return new BooleanConfigOption("terminateOnNoiseReached", "specifies whether to terminate when noise criterion is met", defaultValue); + } + public static IntegerConfigOption getMaxDepth(int defaultValue) { return new IntegerConfigOption("maxDepth", "maximum depth of description", defaultValue); } Modified: trunk/examples/swore/swore.conf =================================================================== --- trunk/examples/swore/swore.conf 2010-12-16 09:17:45 UTC (rev 2566) +++ trunk/examples/swore/swore.conf 2010-12-16 12:26:33 UTC (rev 2567) @@ -68,4 +68,4 @@ -"http://ns.softwiki.de/req/Derick_Garnier" -"http://ns.softwiki.de/req/UseOfIcons" -"http://ns.softwiki.de/req/UserCanAccessDataFromEveryComputer" --"http://ns.softwiki.de/req/WindowDesign" \ No newline at end of file +-"http://ns.softwiki.de/req/WindowDesign" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |