From: <ji...@us...> - 2011-11-18 10:02:54
|
Revision: 3416 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3416&view=rev Author: jialva Date: 2011-11-18 10:02:43 +0000 (Fri, 18 Nov 2011) Log Message: ----------- DL-Learner fuzzy extension adapted to new DL-Learner configuration and working properly ;) Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-17 17:39:45 UTC (rev 3415) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-18 10:02:43 UTC (rev 3416) @@ -20,10 +20,12 @@ package org.dllearner.learningproblems; import java.util.Collection; +import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; import java.util.SortedSet; +import java.util.TreeSet; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.AbstractReasonerComponent; @@ -61,7 +63,14 @@ } public void setFuzzyEx(Map<Individual, Double> fuzzyEx) { - this.fuzzyEx = fuzzyEx; + fuzzyExamples = new TreeSet<FuzzyIndividual>(); + + Iterator it = fuzzyEx.keySet().iterator(); + + while (it.hasNext()) { + Individual i = (Individual) it.next(); + this.fuzzyExamples.add(new FuzzyIndividual(i.getName(), fuzzyEx.get(i).doubleValue())); + } } protected boolean useRetrievalForClassification = false; Modified: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf 2011-11-17 17:39:45 UTC (rev 3415) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:02:43 UTC (rev 3416) @@ -19,7 +19,7 @@ lp.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:east1", "ex:east2" } lp.negativeExamples = { "ex:west6", "ex:west7" } -lp.fuzzyEx = [("ex:east1",0.6)] +lp.fuzzyEx = [("http://www.example.com/fuzzyTrains.owl#east1",1.0),("http://www.example.com/fuzzyTrains.owl#east2",1.0),("http://www.example.com/fuzzyTrains.owl#west6",0.0),("http://www.example.com/fuzzyTrains.owl#west7",0.0)] // create learning algorithm to run alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |