From: <jen...@us...> - 2009-02-18 08:54:20
|
Revision: 1610 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1610&view=rev Author: jenslehmann Date: 2009-02-18 08:54:16 +0000 (Wed, 18 Feb 2009) Log Message: ----------- accuracy of solutions displayed; some cleanup Modified Paths: -------------- trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/Info.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/doc/manual/manual.tex 2009-02-18 08:54:16 UTC (rev 1610) @@ -70,30 +70,27 @@ \begin{verbatim} DL-Learner 2008-10-13 command line interface -starting component manager ... OK (81ms) +starting component manager ... OK (157ms) initialising component "OWL file" ... OK (0ms) -initialising component "fast instance checker" ... OK (861ms) -initialising component "two valued definition learning - problem" ... OK (0ms) -initialising component "refinement operator based learning - algorithm II" ... OK (14ms) +initialising component "fast instance checker" ... OK (842ms) +initialising component "pos neg learning problem" ... OK (0ms) +initialising component "refinement operator based + learning algorithm II" ... OK (14ms) starting top down refinement with: Thing (50% accuracy) more accurate (83,33%) class expression found: male solutions (at most 20 are shown): -1: (male and hasChild some Thing) (length 5, depth 3) +1: (male and hasChild some Thing) (accuracy 100%, length 5, depth 3) Algorithm terminated succesfully. number of retrievals: 4 retrieval reasoning time: 0ms ( 0ms per retrieval) number of instance checks: 93 (0 multiple) -instance check reasoning time: 0ms ( 0ms per instance check) -overall reasoning time: 0ms (1,931% of overall runtime) -overall algorithm runtime: 28ms +instance check reasoning time: 1ms ( 0ms per instance check) +overall reasoning time: 1ms (11,016% of overall runtime) +overall algorithm runtime: 17ms \end{verbatim} -\todo{display accuracy of solutions} - The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. In this case the only solution is \verb|male and hasChild some Thing| defining the class father. The last part of the output contains some runtime statistics. \section{DL-Learner Architecture} @@ -126,7 +123,7 @@ Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. \begin{description} - \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. Note: As we use the OWL API for parsing, all formats supported by it are possible\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. We use the OWL API for parsing, so all formats supported by it can be used\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently small to be processed in reasonable time. Please see \cite{2009_ijswis} for details, the parameters for the extraction algorithm are similar (different names only) to the ones here. Some options of the SPARQL component are: \begin{itemize} Modified: trunk/src/dl-learner/org/dllearner/Info.java =================================================================== --- trunk/src/dl-learner/org/dllearner/Info.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/Info.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -3,6 +3,6 @@ package org.dllearner; public class Info { - public static final String build = "2008-10-13"; + public static final String build = "2009-02-17"; } \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -149,10 +149,7 @@ private ExampleBasedNode startNode; // solution protocol - // TODO isn't solution found already true if solutions.size()>=0 ??? - @Deprecated - private boolean solutionFound = false; - private List<Description> solutions = new LinkedList<Description>(); + private List<ExampleBasedNode> solutions = new LinkedList<ExampleBasedNode>(); // used refinement operator and heuristic (exchangeable) private RhoDRDown operator; @@ -300,7 +297,6 @@ candidates.clear(); candidatesStable.clear(); newCandidates.clear(); - solutionFound = false; solutions.clear(); maxExecutionTimeAlreadyReached = false; minExecutionTimeAlreadyReached = false; @@ -493,7 +489,7 @@ boolean solution = checkSubtreePosOnly(bestNode); if (solution) { - solutions.add(bestNode.getConcept()); + solutions.add(bestNode); ExampleBasedNode bestChild = bestNode.getChildren().last(); System.out.println("solution: " + bestNode.getConcept()); System.out.println("maxPosOnlyExpansion: " + maxPosOnlyExpansion); @@ -513,14 +509,11 @@ } - // handle termination criteria - handleStoppingConditions(); - // Anzahl Schleifendurchläufe loop++; }// end while - if (isSolutionFound()) { + if (solutions.size()>0) { //if (solutionFound) { int solutionLimit = 20; // we do not need to print the best node if we display the top 20 solutions below anyway @@ -531,11 +524,11 @@ int show = 1; String manchester = "MANCHESTER:\n"; String kbSyntax = "KBSyntax:\n"; - for (Description c : solutions) { - logger.info(show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + " (length " + c.getLength() - + ", depth " + c.getDepth() + ")"); + for (ExampleBasedNode c : solutions) { + logger.info(show + ": " + c.getConcept().toManchesterSyntaxString(baseURI, prefixes) + " (accuracy " + df.format(100*c.getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples)) + "%, length " + c.getConcept().getLength() + + ", depth " + c.getConcept().getDepth() + ")"); // manchester += show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + "\n"; - kbSyntax += show + ": " + c.toKBSyntaxString() + "\n"; + kbSyntax += show + ": " + c.getConcept().toKBSyntaxString() + "\n"; if (show >= solutionLimit) { break; } @@ -862,8 +855,7 @@ } else { // Lösung gefunden if (quality >= 0 && quality <= allowedMisclassifications && !posOnly) { - solutionFound = true; - solutions.add(refinement); + solutions.add(newNode); } newCandidates.add(newNode); @@ -1294,9 +1286,10 @@ logger.trace("ordered by generality (most special solutions first):"); SubsumptionComparator sc = new SubsumptionComparator(rs); TreeSet<Description> solutionsOrderedBySubsumption = new TreeSet<Description>(sc); - solutionsOrderedBySubsumption.addAll(solutions); +// solutionsOrderedBySubsumption.addAll(solutions); for (Description d : solutionsOrderedBySubsumption) logger.trace("special: " + d); + throw new Error("implementation needs to be updated to show ordered solutions"); } /* * for (int j = 0; j < solutions.size(); j++) { Description d = @@ -1438,94 +1431,6 @@ } - /** - * shows if a solution is found - * @return - */ - private boolean isSolutionFound(){ - if(this.solutionFound){ - return true; - }else if(solutions.size()>0){ - return true; - } - - return false; - - - } - - @Deprecated - private void handleStoppingConditions() { - solutionFound = (guaranteeXgoodDescriptions()); - solutionFound = (minExecutionTimeReached() && solutionFound); - if (maxExecutionTimeReached()) { - stop(); - if (solutions.size() > 0) - solutionFound = true; - } - if(!solutionFound && maxClassDescriptionTests != 0) { - int conceptTests = conceptTestsReasoner + conceptTestsTooWeakList + conceptTestsOverlyGeneralList; - solutionFound = (conceptTests >= maxClassDescriptionTests); - } - } - - @Deprecated - private boolean guaranteeXgoodDescriptions() { - if (guaranteeXgoodAlreadyReached) - return true; - if (solutions.size() > guaranteeXgoodDescriptions) { - if (guaranteeXgoodDescriptions != 1) { - logger.info("Minimum number (" + guaranteeXgoodDescriptions - + ") of good descriptions reached, stopping now."); - } - guaranteeXgoodAlreadyReached = true; - return true; - } else - return false; - - } - - @Deprecated - private boolean maxExecutionTimeReached() { - if (maxExecutionTimeInSeconds == 0) - return false; - if (maxExecutionTimeAlreadyReached) - return true; - long needed = System.currentTimeMillis() - this.runtime; - long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; - if (maxMilliSeconds < needed) { - logger.info("Maximum time (" + maxExecutionTimeInSeconds - + " seconds) reached, stopping now..."); - maxExecutionTimeAlreadyReached = true; - return true; - } else - return false; - - } - - /** - * true if minExecutionTime reached - * - * @return true - */ - @Deprecated - private boolean minExecutionTimeReached() { - if (minExecutionTimeAlreadyReached) - return true; - long needed = System.currentTimeMillis() - this.runtime; - long minMilliSeconds = minExecutionTimeInSeconds * 1000; - if (minMilliSeconds < needed) { - if (minExecutionTimeInSeconds != 0) { - logger.info("Minimum time (" + minExecutionTimeInSeconds - + " seconds) reached, stopping when next solution is found"); - } - minExecutionTimeAlreadyReached = true; - return true; - } else - return false; - - } - public boolean isRunning() { return isRunning; } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -71,7 +71,7 @@ * @see org.dllearner.core.Component#getName() */ public static String getName() { - return "two valued definition learning problem"; + return "pos neg learning problem"; } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java 2009-02-17 19:23:47 UTC (rev 1609) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java 2009-02-18 08:54:16 UTC (rev 1610) @@ -83,7 +83,7 @@ } public static String getName() { - return "positive only definition learning problem"; + return "pos only learning problem"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |