From: <jen...@us...> - 2008-01-26 19:25:36
|
Revision: 429 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=429&view=rev Author: jenslehmann Date: 2008-01-26 11:25:33 -0800 (Sat, 26 Jan 2008) Log Message: ----------- algorithm fixes and beautification Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-01-26 01:51:11 UTC (rev 428) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-01-26 19:25:33 UTC (rev 429) @@ -287,6 +287,7 @@ // options to it algorithm = new ExampleBasedROLearner( learningProblem, + rs, operator, algHeuristic, // usedConcepts, @@ -305,7 +306,7 @@ } public static String getName() { - return "example driven refinement operator based learning algorithm [not working]"; + return "example driven refinement operator based learning algorithm"; } @Override Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-01-26 01:51:11 UTC (rev 428) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-01-26 19:25:33 UTC (rev 429) @@ -148,6 +148,7 @@ public ExampleBasedROLearner( LearningProblem learningProblem, + ReasoningService rs, RefinementOperator operator, ExampleBasedHeuristic heuristic, // Set<AtomicConcept> allowedConcepts, @@ -167,27 +168,29 @@ this.posOnlyLearningProblem = (PosOnlyDefinitionLP) learningProblem; posOnly = true; } - - // this.heuristic = heuristic; - // candidate sets entsprechend der gewählten Heuristik initialisieren + this.rs = rs; + this.operator = (RhoDown) operator; + // initialise candidate set with heuristic as ordering candidates = new TreeSet<ExampleBasedNode>(heuristic); - // newCandidates = new TreeSet<Node>(nodeComparator); + // this.noisePercentage ... + this.writeSearchTree = writeSearchTree; + this.replaceSearchTree = replaceSearchTree; + this.searchTreeFile = searchTreeFile; + this.useTooWeakList = useTooWeakList; + this.useOverlyGeneralList = useOverlyGeneralList; + this.useShortConceptConstruction = useShortConceptConstruction; } public void start() { - // Suche wird mit Top-Konzept gestartet + // start search with most general concept Top top = new Top(); ExampleBasedNode topNode = new ExampleBasedNode(top); - // int coveredNegativeExamples = learningProblem.coveredNegativeExamplesOrTooWeak(top); - // aus Top folgen immer alle negativen Beispiele, d.h. es ist nur eine Lösung, wenn - // es keine negativen Beispiele gibt + // top covers all negatives int coveredNegativeExamples = getNumberOfNegatives(); topNode.setCoveredNegativeExamples(coveredNegativeExamples); - // topNode.setHorizontalExpansion(1); // die 0 ist eigentlich richtig, da keine Refinements - // der Länge 1 untersucht wurden candidates.add(topNode); candidatesStable.add(topNode); - // Abbruchvariable => beachten, dass bereits TOP eine Lösung sein kann + // note that TOP may already be a solution solutionFound = (coveredNegativeExamples == 0); solutions = new LinkedList<Concept>(); if(solutionFound) @@ -690,7 +693,7 @@ } public void stop() { - + stop = true; } public Concept getBestSolution() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |