From: <jen...@us...> - 2008-03-11 17:55:29
|
Revision: 701 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=701&view=rev Author: jenslehmann Date: 2008-03-11 10:55:22 -0700 (Tue, 11 Mar 2008) Log Message: ----------- - search tree traversal and candidate set reduction ML techniques implemented - small test example for double datatype learning - PTE2 carcinogenesis examples added Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/examples/Carcinogenesis.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Added Paths: ----------- trunk/examples/datatypes/ trunk/examples/datatypes/double.conf trunk/examples/datatypes/double.owl Added: trunk/examples/datatypes/double.conf =================================================================== --- trunk/examples/datatypes/double.conf (rev 0) +++ trunk/examples/datatypes/double.conf 2008-03-11 17:55:22 UTC (rev 701) @@ -0,0 +1,20 @@ +/** + * Simple test example for double datatypes using the height + * of persons. + * + * possible solution: + * height <= 1.84 + * + * Copyright (C) 2008, Jens Lehmann + */ + +algorithm = refexamples; +// refexamples.writeSearchTree = true; +refexamples.searchTreeFile = "log/doubleTree.txt"; +reasoner = fastInstanceChecker; + +import("double.owl"); + ++"http://dl-learner.org/examples/double#frank" +-"http://dl-learner.org/examples/double#peter" +-"http://dl-learner.org/examples/double#susan" Added: trunk/examples/datatypes/double.owl =================================================================== --- trunk/examples/datatypes/double.owl (rev 0) +++ trunk/examples/datatypes/double.owl 2008-03-11 17:55:22 UTC (rev 701) @@ -0,0 +1,121 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY owl11 "http://www.w3.org/2006/12/owl11#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl11xml "http://www.w3.org/2006/12/owl11-xml#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY double "http://dl-learner.org/examples/double#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://dl-learner.org/examples/double#" + xml:base="http://dl-learner.org/examples/double" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl11="http://www.w3.org/2006/12/owl11#" + xmlns:owl11xml="http://www.w3.org/2006/12/owl11-xml#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:double="http://dl-learner.org/examples/double#"> + <owl:Ontology rdf:about=""/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://dl-learner.org/examples/double#height --> + + <owl:DatatypeProperty rdf:about="#height"> + <rdfs:domain rdf:resource="#Person"/> + <rdfs:range rdf:resource="&xsd;double"/> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://dl-learner.org/examples/double#Man --> + + <owl:Class rdf:about="#Man"> + <rdfs:subClassOf rdf:resource="#Person"/> + </owl:Class> + + + + <!-- http://dl-learner.org/examples/double#Person --> + + <owl:Class rdf:about="#Person"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + </owl:Class> + + + + <!-- http://dl-learner.org/examples/double#Woman --> + + <owl:Class rdf:about="#Woman"> + <rdfs:subClassOf rdf:resource="#Person"/> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://dl-learner.org/examples/double#frank --> + + <Man rdf:about="#frank"> + <height rdf:datatype="&xsd;double">1.82</height> + </Man> + + + + <!-- http://dl-learner.org/examples/double#peter --> + + <Man rdf:about="#peter"> + <height rdf:datatype="&xsd;double">1.91</height> + </Man> + + + + <!-- http://dl-learner.org/examples/double#susan --> + + <Woman rdf:about="#susan"> + <height rdf:datatype="&xsd;double">1.86</height> + </Woman> +</rdf:RDF> Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-03-10 17:53:52 UTC (rev 700) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-03-11 17:55:22 UTC (rev 701) @@ -174,6 +174,10 @@ return ret; } + public double getAccuracy(int nrOfPositiveExamples, int nrOfNegativeExamples) { + return (coveredPositives.size() + nrOfNegativeExamples - coveredNegatives.size())/(double)(nrOfPositiveExamples+nrOfNegativeExamples); + } + public Set<Individual> getCoveredPositives() { return coveredPositives; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-03-10 17:53:52 UTC (rev 700) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-03-11 17:55:22 UTC (rev 701) @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.NavigableSet; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -106,6 +107,18 @@ // ALL r.TOP is improper and automatically expanded further private boolean testProperness = false; + // tree traversal means to run through the most promising concepts + // and connect them in an intersection to find a solution + // (this is called irregularly e.g. every 100 seconds) + private boolean useTreeTraversal = false; + + // candidate reduction: using this mechanism we can simulate + // the divide&conquer approach in many ILP programs using a + // clause by clause search; after a period of time the candidate + // set is reduced to focus CPU time on the most promising concepts + private boolean useCandidateReduction = true; + private int candidatePostReductionSize = 30; + // setting to true gracefully stops the algorithm private boolean stop = false; @@ -228,7 +241,7 @@ public void start() { // calculate quality threshold required for a solution - allowedMisclassifications = (int) Math.round(noise * nrOfExamples); + allowedMisclassifications = (int) Math.round(noise * nrOfExamples); // start search with start class if(startDescription == null) { @@ -250,6 +263,11 @@ algorithmStartTime = System.nanoTime(); long lastPrintTime = 0; + long lastTreeTraversalTime = System.nanoTime(); + long lastReductionTime = System.nanoTime(); + // try a traversal after 100 seconds + long traversalInterval = 1000l * 1000000000l; + long reductionInterval = 100l * 1000000000l; long currentTime; while(!solutionFound && !stop) { @@ -262,6 +280,18 @@ logger.debug("--- loop " + loop + " started ---"); } + // traverse the current search tree to find a solution + if(useTreeTraversal && (currentTime - lastTreeTraversalTime > traversalInterval)) { + traverseTree(); + lastTreeTraversalTime = System.nanoTime(); + } + + // reduce candidates to focus on promising concepts + if(useCandidateReduction && (currentTime - lastReductionTime > reductionInterval)) { + reduceCandidates(); + lastReductionTime = System.nanoTime(); + } + // chose best node according to heuristics bestNode = candidates.last(); // extend best node @@ -695,6 +725,130 @@ } return false; } + + // TODO: investigate whether it makes sense not to store all individuals + // in the nodes, but instead perform instance checks in tree traversal + // (it is only run in large intervals so it shouldn't be too expensive) + private void traverseTree() { +// ExampleBasedNode startNode = candidatesStable.last(); + ExampleBasedNode startNode = findBestTraversalStartNode(); + Description currentDescription = startNode.getConcept(); + Set<Individual> currentCoveredPos = startNode.getCoveredPositives(); + Set<Individual> currentCoveredNeg = startNode.getCoveredNegatives(); + double currentAccuracy = startNode.getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples); + int currentMisclassifications = nrOfPositiveExamples - currentCoveredPos.size() + currentCoveredNeg.size(); + System.out.println("tree traversal start node " + startNode.getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI)); + System.out.println("tree traversal start accuracy: " + currentAccuracy); + int i=0; + // start from the most promising nodes + NavigableSet<ExampleBasedNode> reverseView = candidatesStable.descendingSet(); + for(ExampleBasedNode currNode : reverseView) { + // compute covered positives and negatives + SortedSet<Individual> newCoveredPositives = new TreeSet<Individual>(currentCoveredPos); + newCoveredPositives.retainAll(currNode.getCoveredPositives()); + SortedSet<Individual> newCoveredNegatives = new TreeSet<Individual>(currentCoveredNeg); + newCoveredNegatives.retainAll(currNode.getCoveredNegatives()); + + // compute the accuracy we would get by adding this node + double accuracy = (newCoveredPositives.size() + nrOfNegativeExamples - newCoveredNegatives.size())/(double)(nrOfPositiveExamples+nrOfNegativeExamples); + int misclassifications = nrOfPositiveExamples - newCoveredPositives.size() + newCoveredNegatives.size(); + int misclassifiedPositives = nrOfPositiveExamples - newCoveredPositives.size(); + + int lostPositives = currentCoveredPos.size() - newCoveredPositives.size(); + + // TODO: maybe we should also consider a minimum improvement when adding something + // otherwise we could overfit + // we give double weith to lost positives, i.e. when one positive is lost at least + // two negatives need to be uncovered + boolean consider = (misclassifications + lostPositives < currentMisclassifications) && + (misclassifiedPositives <= allowedMisclassifications); +// boolean consider = (misclassifications < currentMisclassifications) && +// (misclassifiedPositives <= allowedMisclassifications); + + // concept has been chosen, so construct it + if(consider) { + + // construct a new concept as intersection of both + Intersection mc = new Intersection(currentDescription, currNode.getConcept()); + + ConceptTransformation.cleanConceptNonRecursive(mc); + ConceptTransformation.transformToOrderedNegationNormalFormNonRecursive(mc, conceptComparator); + +// System.out.println("extended concept to: " + mc); + System.out.println("misclassifications: " + misclassifications); + System.out.println("misclassified positives: " + misclassifiedPositives); + System.out.println("accuracy: " + accuracy); + + // update variables + currentDescription = mc; + currentCoveredPos = newCoveredPositives; + currentCoveredNeg = newCoveredNegatives; + currentMisclassifications = misclassifications; + currentAccuracy = accuracy; + + if(accuracy > 1 - noise) { + System.out.println("traversal found " + mc); + System.out.println("accuracy: " + accuracy); + System.exit(0); + } + } + + i++; + if(i==1000) + break; + } + + } + + // we look for a node covering many positives and hopefully + // few negatives; we give a strong penalty on uncovered positives + private ExampleBasedNode findBestTraversalStartNode() { + // 2 points for each covered pos + 1 point for each uncovered neg + int currScore = 0; + int i = 0; + ExampleBasedNode currNode = null; + NavigableSet<ExampleBasedNode> reverseView = candidatesStable.descendingSet(); + for(ExampleBasedNode node : reverseView) { + int score = 2 * node.getCoveredPositives().size() + (nrOfNegativeExamples - node.getCoveredNegatives().size()); + if(score > currScore) { + currScore = score; + currNode = node; + } + i++; + // limit search because stable candidate set can grow very large + if(i == 10000) + break; + } + return currNode; + } + + private void reduceCandidates() { + Iterator<ExampleBasedNode> it = candidatesStable.descendingIterator(); + Set<ExampleBasedNode> promisingNodes = new HashSet<ExampleBasedNode>(); + int i = 0; + while(it.hasNext() && promisingNodes.size()<candidatePostReductionSize) { + ExampleBasedNode node = it.next(); +// System.out.println(node.getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI)); + // first criterion: the considered node should have an accuracy gain over its parent + // (avoids to use only the most promising node + all its refinements with equal accuracy) + boolean hasAccuracyGain = (node.getParent() == null) || (node.getCoveredPositives().size() != node.getParent().getCoveredPositives().size()) + || (node.getCoveredNegatives().size() != node.getParent().getCoveredNegatives().size()); + // second criterion: uncovered positives; it does not make much sense to pick nodes with + // low potential for reaching a solution (already at the limit of misclassified positives) + int misclassifiedPositives = nrOfPositiveExamples - node.getCoveredPositives().size(); + boolean hasRefinementPotential = (misclassifiedPositives <= Math.floor(0.65d*allowedMisclassifications)); + boolean keep = hasAccuracyGain && hasRefinementPotential; + if(keep) { + promisingNodes.add(node); + } + i++; + } + candidates.retainAll(promisingNodes); + System.out.println("searched " + i + " nodes and picked the following promising descriptions:"); + for(ExampleBasedNode node : promisingNodes) + System.out.println(node.getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI)); + } + /* private Set<Individual> computeQuality(Description refinement, Set<Individual> coveredPositives) { Set<Individual> ret = new TreeSet<Individual>(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-03-10 17:53:52 UTC (rev 700) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-03-11 17:55:22 UTC (rev 701) @@ -21,8 +21,9 @@ import java.util.List; -import org.dllearner.core.owl.BooleanValueRestriction; +import org.dllearner.core.owl.DatatypeValueRestriction; import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Thing; import org.dllearner.utilities.ConceptComparator; /** @@ -77,7 +78,7 @@ private double expansionPenaltyFactor; private double gainBonusFactor; private double nodeChildPenalty = 0.0001; - private double startNodeBonus = 0.1; + private double startNodeBonus = 0.8; // examples private int nrOfNegativeExamples; @@ -140,9 +141,15 @@ private static int getHeuristicLengthBonus(Description description) { int bonus = 0; - if(description instanceof BooleanValueRestriction) + // do not count TOP symbols (in particular in ALL r.TOP and EXISTS r.TOP) + // as they provide no extra information + if(description instanceof Thing) bonus = 1; + // some bonus for doubles because they are already penalised by length 3 + if(description instanceof DatatypeValueRestriction) + bonus = 1; + List<Description> children = description.getChildren(); for(Description child : children) { bonus += getHeuristicLengthBonus(child); Modified: trunk/src/dl-learner/org/dllearner/examples/Carcinogenesis.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/Carcinogenesis.java 2008-03-10 17:53:52 UTC (rev 700) +++ trunk/src/dl-learner/org/dllearner/examples/Carcinogenesis.java 2008-03-11 17:55:22 UTC (rev 701) @@ -122,8 +122,10 @@ public static void main(String[] args) throws FileNotFoundException, IOException, ParseException { + // TODO: newgroups are not mapped currently String[] files = new String[] { "newgroups.pl", "ames.pl", "atoms.pl", "bonds.pl", "gentoxprops.pl", - "ind_nos.pl", "ind_pos.pl", + "ind_nos.pl", "ind_pos.pl", "pte2/canc_nos.pl", "pte2/pte2ames.pl", "pte2/pte2atoms.pl", + "pte2/pte2bonds.pl", "pte2/pte2gentox.pl", "pte2/pte2ind_nos.pl", "pte2/pte2newgroups.pl" // "train.b" => not a pure Prolog file but Progol/Aleph specific }; File owlFile = new File("examples/carcinogenesis/pte.owl"); @@ -252,20 +254,23 @@ appendNegExamples(confTrainFile, negTrainExamples); // generating test examples for PTE-1 - File confPTE1File = new File("examples/carcinogenesis/testpte1.conf"); - Files.clearFile(confPTE1File); + // => put all in one file, because they were used as training for PTE-2 + // File confPTE1File = new File("examples/carcinogenesis/testpte1.conf"); + // Files.clearFile(confPTE1File); File testPTE1Positives = new File(prologDirectory + "pte1.f"); File testPTE1Negatives = new File(prologDirectory + "pte1.n"); List<Individual> posPTE1Examples = getExamples(testPTE1Positives); List<Individual> negPTE1Examples = getExamples(testPTE1Negatives); - appendPosExamples(confPTE1File, posPTE1Examples); - appendNegExamples(confPTE1File, negPTE1Examples); + appendPosExamples(confTrainFile, posPTE1Examples); + appendNegExamples(confTrainFile, negPTE1Examples); - // TODO: how to get PTE-2 predictions? the pte-2 directory suggests - // that all are positive which is not true (according to the papers) - // solution: go to "http://ntp-server.niehs.nih.gov/" and click - // on "Testing Status of Agents at NTP" + // create a PTE-2 test file + File confPTE2File = new File("examples/carcinogenesis/testpte2.conf"); + Files.clearFile(confPTE2File); + Files.appendFile(confPTE2File, "import(\"pte.owl\");\nreasoner=fastInstanceChecker;\n\n"); + Files.appendFile(confPTE2File, getPTE2Examples()); + } private static List<Axiom> mapClause(Clause clause) throws IOException, ParseException { @@ -361,7 +366,7 @@ axioms.add(dpa); // either parse this or ashby_alert - not both - ashby_alert contains // all information in ind already - } else if (headName.equals("ind")) { + } else if (headName.equals("ind") || headName.equals("ring_no")) { String compoundName = head.getArgument(0).toPLString(); String structureName = head.getArgument(1).toPLString(); int count = Integer.parseInt(head.getArgument(2).toPLString()); @@ -555,4 +560,86 @@ newGroups.addAll(list); } + /** + * <p>To find out whether a substance is carinogenetic go to + * "http://ntp-server.niehs.nih.gov/" and click + * on "Testing Status of Agents at NTP".</p> + * + * Levels: + * <ul> + * <li>CE = clear evidence</li> + * <li>SE = some evidence</li> + * <li>E = equivocal evidence</li> + * <li>NE = no evidence</li> + * </ul> + * Levels CE and SE are positive examples. E and NE negative examples. + * Experiments are performed on rats and mice of both genders, so we + * have four evidence values. An example is positive if at least one + * value is SE or CE. + * + * <p>Some values are taken from the IJCAI-97 paper of Muggleton.</p> + * + * <p>Positives (19): <br /> + * <ul> + * <li>t3 (SE+3NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCACAFD4-123F-7908-7B521E4F665EFBD9</li> + * <li>t5: paper</li> + * <li>t7: paper</li> + * <li>t8: paper</li> + * <li>t9 (3CE+SE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD7C6869-123F-7908-7BDEA4CFAA55CEA8</li> + * <li>t10: paper</li> + * <li>t12 (2SE+E+NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCB0ADE0-123F-7908-7BEC101C7309C4DE</li> + * <li>t14 (2CE+2NE) probably 111-42-2 instead of 11-42-2: http://ntp.niehs.nih.gov/index.cfm?objectid=BCC60FF1-123F-7908-7B2D579AA48DE90C</li> + * <li>t15: paper</li> + * <li>t16 (2CE+SE+E): http://ntp.niehs.nih.gov/index.cfm?objectid=BCC5D9CE-123F-7908-7B959CCE5262468A</li> + * <li>t18 (2SE+E+NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCA087AA-123F-7908-7B79FDFDE3CDCF87</li> + * <li>t19 (2CE+E+NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCAE5690-123F-7908-7B02E35E2BB57694</li> + * <li>t20 (2SE+E+NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCF95607-123F-7908-7B0761D3C515CC12</li> + * <li>t21 (CE+3NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCFCB63C-123F-7908-7BF910C2783AE9FE</li> + * <li>t22 (SE+3NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD8345C2-123F-7908-7BC52FEF80F110E1</li> + * <li>t23 (4CE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCADD2D9-123F-7908-7B5C8180FE80B22F</li> + * <li>t24 (CE+E): http://ntp.niehs.nih.gov/index.cfm?objectid=BCFB19FF-123F-7908-7B845E176F13E6E1</li> + * <li>t25 (3CE+SE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD2D2A62-123F-7908-7B0DA824E782754C</li> + * <li>t30 (2CE+SE+E) : http://ntp.niehs.nih.gov/index.cfm?objectid=BCB13734-123F-7908-7BEBA533E35A48B7</li> + * </ul> + * </p> + * + * <p>Negatives (10): + * <ul> + * <li>t1 (4NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD9FF53C-123F-7908-7B123DAE0A25B122 </li> + * <li>t2 (4NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCF8651E-123F-7908-7B21DD5ED83CD0FF </li> + * <li>t4: paper</li> + * <li>t6: paper</li> + * <li>t11: paper</li> + * <li>t13 (4NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD136ED6-123F-7908-7B619EE79F2FD062</li> + * <li>t17: paper</li> + * <li>t26 (2E+2NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD1E6209-123F-7908-7B95EB8BAE662CE7</li> + * <li>t27 (E+3NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BCAC5D00-123F-7908-7BC46ECB72A6C91B</li> + * <li>t28 (E+3NE): http://ntp.niehs.nih.gov/index.cfm?objectid=BD34E02A-123F-7908-7BC6791917B591DF</li> + * </ul> + * </p> + * + * <p>Unclear (1): + * <ul> + * <li>t29: probably a negative (see http://ntp.niehs.nih.gov/index.cfm?objectid=BD855EA1-123F-7908-7B573FC3C08188DC) but + * no tests directly for this substance</li> + * </ul> + * </p> + * @return A string for all examples as used in the conf file. + */ + public static String getPTE2Examples() { + String[] pos = new String[] {"t3","t5","t7","t8","t9","t10","t12", + "t14","t15","t16","t18","t19","t20","t21","t22","t23","t24", + "t25","t30"}; + String[] neg = new String[] {"t1", "t2", "t4", "t6", "t11", "t13", + "t17","t26","t27","t28"}; + + String ret = ""; + for(String posEx : pos) + ret += "+" + getURI2(posEx) + "\n"; + for(String negEx : neg) + ret += "-" + getURI2(negEx) + "\n"; + + return ret; + } + } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-03-10 17:53:52 UTC (rev 700) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-03-11 17:55:22 UTC (rev 701) @@ -127,7 +127,7 @@ // splits for double datatype properties in ascening order private Map<DatatypeProperty,List<Double>> splits = new TreeMap<DatatypeProperty,List<Double>>(); - private int maxNrOfSplits = 20; + private int maxNrOfSplits = 10; // staistics public long mComputationTimeNs = 0; @@ -359,6 +359,7 @@ } } else if (description instanceof DatatypeSomeRestriction) { + DatatypeSomeRestriction dsr = (DatatypeSomeRestriction) description; DatatypeProperty dp = (DatatypeProperty) dsr.getRestrictedPropertyExpression(); DataRange dr = dsr.getDataRange(); @@ -956,7 +957,7 @@ int nrOfValues = values.size(); // create split set List<Double> splitsDP = new LinkedList<Double>(); - for(int splitNr=0; splitNr < maxNrOfSplits; splitNr++) { + for(int splitNr=0; splitNr < Math.min(maxNrOfSplits,nrOfValues-1); splitNr++) { int index; if(nrOfValues<=maxNrOfSplits) index = splitNr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |