From: <jen...@us...> - 2009-12-01 17:59:18
|
Revision: 1927 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1927&view=rev Author: jenslehmann Date: 2009-12-01 17:59:11 +0000 (Tue, 01 Dec 2009) Log Message: ----------- - max execution time for EL base algorithm implemented - cross benchmark extended - several small changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java Added Paths: ----------- trunk/examples/cross-benchmark/arch/arch_el.conf trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf trunk/examples/cross-benchmark/forte/uncle_el.conf trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf trunk/examples/cross-benchmark/poker/pair_el.conf trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf trunk/examples/cross-benchmark/poker/straight_el.conf trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf trunk/examples/cross-benchmark/trains/trains_el.conf trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf Added: trunk/examples/cross-benchmark/arch/arch_el.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_el.conf (rev 0) +++ trunk/examples/cross-benchmark/arch/arch_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,10 @@ +algorithm = el; +el.instanceBasedDisjoints = false; +reasoner = owlAPIReasoner; +import("arch.owl"); + ++c1 ++c4 +-c2 +-c3 +-c5 Added: trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,10 @@ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +reasoner = owlAPIReasoner; +import("arch.owl"); + ++c1 ++c4 +-c2 +-c3 +-c5 Added: trunk/examples/cross-benchmark/forte/uncle_el.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_el.conf (rev 0) +++ trunk/examples/cross-benchmark/forte/uncle_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,116 @@ +/** + * Extracted from the FORTE (First Order Revision of Theories from Examples) + * data set: + * + * http://www.cs.utexas.edu/users/ml/forte.html + * + * The goal of this learning problem is to learn the concept of an uncle. + * + * In the file forte_family.kb, you can find a graphical representation of the + * family tree corresponding to the facts in this file. + * + * possible solution: (male AND (EXISTS hasSibling.EXISTS hasChild.TOP + * OR EXISTS married.EXISTS hasSibling.EXISTS hasChild.TOP)) + * + * Copyright (C) 2007, Jens Lehmann + */ + + +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("forte_family.owl"); + +/** examples **/ + + +// complete example set ++art ++calvin ++carlos ++david ++eric ++fred ++frederick ++george ++harry ++jack ++james ++jonas ++karl ++leon ++mark ++melvin ++neil ++nero ++owen ++paul ++peter ++umo ++walt + +-alfred +-alice +-angela +-ann +-beatrice +-bob +-callie +-carl +-christy +-cornelia +-deanna +-elisa +-f12 +-f14 +-f19 +-f2 +-f20 +-f21 +-f22 +-f23 +-f25 +-f26 +-f28 +-f8 +-fannie +-gail +-helen +-jane +-janet +-kari +-lorrie +-m1 +-m10 +-m11 +-m13 +-m15 +-m16 +-m17 +-m18 +-m24 +-m27 +-m29 +-m3 +-m4 +-m5 +-m6 +-m7 +-m9 +-maria +-martha +-nancy +-nonnie +-oma +-paula +-prissie +-rachel +-ray +-regina +-steve +-susan +-terri +-terry +-wendy + Added: trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,116 @@ +/** + * Extracted from the FORTE (First Order Revision of Theories from Examples) + * data set: + * + * http://www.cs.utexas.edu/users/ml/forte.html + * + * The goal of this learning problem is to learn the concept of an uncle. + * + * In the file forte_family.kb, you can find a graphical representation of the + * family tree corresponding to the facts in this file. + * + * possible solution: (male AND (EXISTS hasSibling.EXISTS hasChild.TOP + * OR EXISTS married.EXISTS hasSibling.EXISTS hasChild.TOP)) + * + * Copyright (C) 2007, Jens Lehmann + */ + + +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("forte_family.owl"); + +/** examples **/ + + +// complete example set ++art ++calvin ++carlos ++david ++eric ++fred ++frederick ++george ++harry ++jack ++james ++jonas ++karl ++leon ++mark ++melvin ++neil ++nero ++owen ++paul ++peter ++umo ++walt + +-alfred +-alice +-angela +-ann +-beatrice +-bob +-callie +-carl +-christy +-cornelia +-deanna +-elisa +-f12 +-f14 +-f19 +-f2 +-f20 +-f21 +-f22 +-f23 +-f25 +-f26 +-f28 +-f8 +-fannie +-gail +-helen +-jane +-janet +-kari +-lorrie +-m1 +-m10 +-m11 +-m13 +-m15 +-m16 +-m17 +-m18 +-m24 +-m27 +-m29 +-m3 +-m4 +-m5 +-m6 +-m7 +-m9 +-maria +-martha +-nancy +-nonnie +-oma +-paula +-prissie +-rachel +-ray +-regina +-steve +-susan +-terri +-terry +-wendy + Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution is: +(severity_harm AND (NOT benefit_victim) AND (vicarious OR voluntary)) + + + Examples: + 23 positive + 20 negative + + ***********************/ + algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +/** background knowledge **/ +import("moral_43instances_complex.owl"); + + +/** Examples **/ ++p0 ++p1 ++p2 ++p3 ++p4 ++p5 ++p6 ++p7 ++p8 ++p9 ++p10 ++p90 ++p91 ++p92 ++p93 ++p94 ++p95 ++p96 ++p97 ++p98 ++p99 ++p100 ++p101 +-n0 +-n1 +-n2 +-n3 +//-n4 +-n5 +-n6 +-n7 +-n8 +-n9 +-n10 +-n90 +-n91 +-n92 +-n93 +-n94 +-n95 +-n96 +-n97 +-n98 +-n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution is: +(severity_harm AND (NOT benefit_victim) AND (vicarious OR voluntary)) + + + Examples: + 23 positive + 20 negative + + ***********************/ + algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +/** background knowledge **/ +import("moral_43instances_complex.owl"); + + +/** Examples **/ ++p0 ++p1 ++p2 ++p3 ++p4 ++p5 ++p6 ++p7 ++p8 ++p9 ++p10 ++p90 ++p91 ++p92 ++p93 ++p94 ++p95 ++p96 ++p97 ++p98 ++p99 ++p100 ++p101 +-n0 +-n1 +-n2 +-n3 +//-n4 +-n5 +-n6 +-n7 +-n8 +-n9 +-n10 +-n90 +-n91 +-n92 +-n93 +-n94 +-n95 +-n96 +-n97 +-n98 +-n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution should be: + guilty = (blameworthy OR vicarious_blame ). + + + Examples: + 23 positive + 20 negative + + ***********************/ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + /** background knowledge **/ + import("moral_43instances.owl"); + + + /** Examples **/ + +p0 + +p1 + +p2 + +p3 + +p4 + +p5 + +p6 + +p7 + +p8 + +p9 + +p10 + +p90 + +p91 + +p92 + +p93 + +p94 + +p95 + +p96 + +p97 + +p98 + +p99 + +p100 + +p101 + -n0 + -n1 + -n2 + -n3 + //-n4 + -n5 + -n6 + -n7 + -n8 + -n9 + -n10 + -n90 + -n91 + -n92 + -n93 + -n94 + -n95 + -n96 + -n97 + -n98 + -n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution should be: + guilty = (blameworthy OR vicarious_blame ). + + + Examples: + 23 positive + 20 negative + + ***********************/ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + /** background knowledge **/ + import("moral_43instances.owl"); + + + /** Examples **/ + +p0 + +p1 + +p2 + +p3 + +p4 + +p5 + +p6 + +p7 + +p8 + +p9 + +p10 + +p90 + +p91 + +p92 + +p93 + +p94 + +p95 + +p96 + +p97 + +p98 + +p99 + +p100 + +p101 + -n0 + -n1 + -n2 + -n3 + //-n4 + -n5 + -n6 + -n7 + -n8 + -n9 + -n10 + -n90 + -n91 + -n92 + -n93 + -n94 + -n95 + -n96 + -n97 + -n98 + -n99 Added: trunk/examples/cross-benchmark/poker/pair_el.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_el.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/pair_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,64 @@ +/** + * See pair.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + +/*Background knowledge*/ +import("pair50.owl"); + +/*Examples*/ +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand1" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" ++"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" ++"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" ++"http://localhost/foo#hand18" ++"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" ++"http://localhost/foo#hand21" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand23" ++"http://localhost/foo#hand24" ++"http://localhost/foo#hand25" ++"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" ++"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" ++"http://localhost/foo#hand35" ++"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" ++"http://localhost/foo#hand38" ++"http://localhost/foo#hand39" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" ++"http://localhost/foo#hand43" +-"http://localhost/foo#hand44" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" ++"http://localhost/foo#hand47" ++"http://localhost/foo#hand48" Added: trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,64 @@ +/** + * See pair.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + +/*Background knowledge*/ +import("pair50.owl"); + +/*Examples*/ +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand1" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" ++"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" ++"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" ++"http://localhost/foo#hand18" ++"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" ++"http://localhost/foo#hand21" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand23" ++"http://localhost/foo#hand24" ++"http://localhost/foo#hand25" ++"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" ++"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" ++"http://localhost/foo#hand35" ++"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" ++"http://localhost/foo#hand38" ++"http://localhost/foo#hand39" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" ++"http://localhost/foo#hand43" +-"http://localhost/foo#hand44" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" ++"http://localhost/foo#hand47" ++"http://localhost/foo#hand48" Added: trunk/examples/cross-benchmark/poker/straight_el.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_el.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/straight_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,71 @@ +/** + * See straight.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +/*Background knowledge*/ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("straight.owl"); + +/*Examples*/ ++"http://localhost/foo#hand1" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand44" + +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" +-"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" +-"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" +-"http://localhost/foo#hand18" +-"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" +-"http://localhost/foo#hand21" +-"http://localhost/foo#hand23" +-"http://localhost/foo#hand24" +-"http://localhost/foo#hand25" +-"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" +-"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" +-"http://localhost/foo#hand35" +-"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" +-"http://localhost/foo#hand38" +-"http://localhost/foo#hand39" +-"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" +-"http://localhost/foo#hand43" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" +-"http://localhost/foo#hand47" +-"http://localhost/foo#hand48" +-"http://localhost/foo#hand49" +-"http://localhost/foo#hand50" +-"http://localhost/foo#hand51" +-"http://localhost/foo#hand52" +-"http://localhost/foo#hand53" +-"http://localhost/foo#hand54" Added: trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,71 @@ +/** + * See straight.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +/*Background knowledge*/ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("straight.owl"); + +/*Examples*/ ++"http://localhost/foo#hand1" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand44" + +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" +-"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" +-"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" +-"http://localhost/foo#hand18" +-"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" +-"http://localhost/foo#hand21" +-"http://localhost/foo#hand23" +-"http://localhost/foo#hand24" +-"http://localhost/foo#hand25" +-"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" +-"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" +-"http://localhost/foo#hand35" +-"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" +-"http://localhost/foo#hand38" +-"http://localhost/foo#hand39" +-"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" +-"http://localhost/foo#hand43" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" +-"http://localhost/foo#hand47" +-"http://localhost/foo#hand48" +-"http://localhost/foo#hand49" +-"http://localhost/foo#hand50" +-"http://localhost/foo#hand51" +-"http://localhost/foo#hand52" +-"http://localhost/foo#hand53" +-"http://localhost/foo#hand54" Added: trunk/examples/cross-benchmark/trains/trains_el.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_el.conf (rev 0) +++ trunk/examples/cross-benchmark/trains/trains_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,28 @@ +/** + * See arch.conf. This is the same learning problem, but loading background + * knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +hidePrefix = "http://example.com/foo#"; + +/*Background knowledge*/ + +import("trains.owl"); + +/*Examples*/ ++"http://example.com/foo#east1" ++"http://example.com/foo#east2" ++"http://example.com/foo#east3" ++"http://example.com/foo#east4" ++"http://example.com/foo#east5" +-"http://example.com/foo#west6" +-"http://example.com/foo#west7" +-"http://example.com/foo#west8" +-"http://example.com/foo#west9" +-"http://example.com/foo#west10" Added: trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,28 @@ +/** + * See arch.conf. This is the same learning problem, but loading background + * knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +hidePrefix = "http://example.com/foo#"; + +/*Background knowledge*/ + +import("trains.owl"); + +/*Examples*/ ++"http://example.com/foo#east1" ++"http://example.com/foo#east2" ++"http://example.com/foo#east3" ++"http://example.com/foo#east4" ++"http://example.com/foo#east5" +-"http://example.com/foo#west6" +-"http://example.com/foo#west7" +-"http://example.com/foo#west8" +-"http://example.com/foo#west9" +-"http://example.com/foo#west10" Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -49,6 +49,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; @@ -393,7 +394,7 @@ if(accuracy > bestAccuracy) { bestAccuracy = accuracy; bestDescription = description; - logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); + logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); // + getTemporaryString(bestDescription)); } return true; } @@ -574,12 +575,21 @@ int current = 1; String str = ""; for(EvaluatedDescription ed : bestEvaluatedDescriptions.getSet().descendingSet()) { - str += current + ": " + descriptionToString(ed.getDescription()) + " " + dfPercent.format(ed.getAccuracy()) + "\n"; + // temporary code + if(learningProblem instanceof PosNegLPStandard) { + str += current + ": " + descriptionToString(ed.getDescription()) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(ed.getDescription(),1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(ed.getDescription(),1)) + ")\n"; + } else { + str += current + ": " + descriptionToString(ed.getDescription()) + " " + dfPercent.format(ed.getAccuracy()) + "\n"; + } current++; } return str; } +// private String getTemporaryString(Description description) { +// return descriptionToString(description) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(description,1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(description,1)) + ")"; +// } + private void updateMinMaxHorizExp(OENode node) { int newHorizExp = node.getHorizontalExpansion(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -34,7 +34,7 @@ public class OEHeuristicRuntime implements Comparator<OENode>{ // strong penalty for long descriptions - private double expansionPenaltyFactor = 0.1; + private double expansionPenaltyFactor = 0.01; // 0.1; // bonus for being better than parent node private double gainBonusFactor = 0.3; // penalty if a node description has very many refinements since exploring Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -32,6 +32,9 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.Configurator; import org.dllearner.core.configurators.ELLearningAlgorithmConfigurator; +import org.dllearner.core.options.CommonConfigOptions; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; @@ -59,6 +62,9 @@ private boolean isRunning = false; private boolean stop = false; + private double treeSearchTimeSeconds = 1.0; + private long treeStartTime; + // a set with limited size (currently the ordering is defined in the class itself) private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); @@ -68,6 +74,7 @@ public ELLearningAlgorithm(PosNegLP problem, ReasonerComponent reasoner) { super(problem, reasoner); + configurator = new ELLearningAlgorithmConfigurator(this); } public static String getName() { @@ -90,13 +97,21 @@ return configurator; } + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); +// options.add(CommonConfigOptions.getNoisePercentage()); +// options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); + return options; + } + @Override public void init() throws ComponentInitException { // currently we use the stable heuristic heuristic = new StableHeuristic(); candidates = new TreeSet<SearchTreeNode>(heuristic); - operator = new ELDown2(reasoner); + operator = new ELDown2(reasoner, configurator.getInstanceBasedDisjoints()); } @Override @@ -104,6 +119,7 @@ stop = false; isRunning = true; reset(); + treeStartTime = System.nanoTime(); // create start node ELDescriptionTree top = new ELDescriptionTree(reasoner, Thing.instance); @@ -157,9 +173,13 @@ parentNode.addChild(node); } +// System.out.println("TEST"); + if(!node.isTooWeak()) { // add as candidate candidates.add(node); + +// System.out.println("TEST2"); // check whether we want to add it to the best evaluated descriptions; // to do this we pick the worst considered evaluated description @@ -178,6 +198,19 @@ } private boolean stoppingCriteriaSatisfied() { + // in some cases, there could be no candidate left ... + if(candidates.isEmpty()) { + return true; + } + + // stop when max time is reached + long runTime = System.nanoTime() - treeStartTime; + double runTimeSeconds = runTime / (double) 1000000000; + + if(runTimeSeconds >= treeSearchTimeSeconds) { + return true; + } + // stop if we have a node covering all positives and none of the negatives SearchTreeNode bestNode = candidates.last(); return (bestNode.getCoveredNegatives() == 0); Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -141,6 +141,7 @@ Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); options.add(CommonConfigOptions.getNoisePercentage()); options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); return options; } @@ -165,7 +166,7 @@ } else { startClass = Thing.instance; } - operator = new ELDown2(reasoner); + operator = new ELDown2(reasoner, configurator.getInstanceBasedDisjoints()); // noise = configurator.getNoisePercentage()/(double)100; @@ -365,6 +366,11 @@ } private boolean treeCriteriaSatisfied() { + // stop if there are no more candidates (unlikely, but can happen) + if(candidates.isEmpty()) { + return true; + } + long runTime = System.nanoTime() - treeStartTime; double runTimeSeconds = runTime / (double) 1000000000; @@ -376,6 +382,7 @@ } private boolean stoppingCriteriaSatisfied() { + // stop if we have a node covering all positives and none of the negatives // SearchTreeNode bestNode = candidates.last(); // return (bestNode.getCoveredNegatives() == 0); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -55,7 +55,25 @@ return component; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithm, "instanceBasedDisjoints") ; +} +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithm, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -73,6 +73,15 @@ public String getStartClass() { return (String) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithmDisjunctive, "startClass") ; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithmDisjunctive, "instanceBasedDisjoints") ; +} /** * @param noisePercentage the (approximated) percentage of noise within the examples. @@ -92,6 +101,15 @@ ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithmDisjunctive, "startClass", startClass); reinitNecessary = true; } +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithmDisjunctive, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -106,7 +106,7 @@ /** * useApproximations whether to use stochastic approximations for computing accuracy. * mandatory: false| reinit necessary: true -* default value: true +* default value: false * @return boolean **/ public boolean getUseApproximations() { @@ -124,7 +124,7 @@ /** * accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true -* default value: standard +* default value: predacc * @return String **/ public String getAccuracyMethod() { @@ -177,7 +177,7 @@ /** * @param useApproximations whether to use stochastic approximations for computing accuracy. * mandatory: false| reinit necessary: true -* default value: true +* default value: false **/ public void setUseApproximations(boolean useApproximations) { ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useApproximations", useApproximations); @@ -195,7 +195,7 @@ /** * @param accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true -* default value: standard +* default value: predacc **/ public void setAccuracyMethod(String accuracyMethod) { ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "accuracyMethod", accuracyMethod); Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -57,6 +57,7 @@ public static String logLevelDefault = "DEBUG"; public static double noisePercentageDefault = 0.0; public static boolean terminateOnNoiseReachedDefault = true; + public static boolean instanceBasedDisjointsDefault = true; public static StringConfigOption getVerbosityOption() { StringConfigOption verbosityOption = new StringConfigOption("verbosity", "control verbosity of output for this component", "warning"); @@ -195,4 +196,8 @@ public static StringConfigOption getLogLevel() { return new StringConfigOption("logLevel", "determines the logLevel for this component, can be {TRACE, DEBUG, INFO}",logLevelDefault); } + + public static BooleanConfigOption getInstanceBasedDisjoints() { + return new BooleanConfigOption("instanceBasedDisjoints", "Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.", instanceBasedDisjointsDefault); + } } Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -371,7 +371,7 @@ // generate a class with all positive examples (optional) if(generatePosExampleClass) { String phenotype = rs.getString("phenotype"); - if(phenotype.toLowerCase().contains("polymorphism")) { + if(!phenotype.toLowerCase().contains("polymorphism")) { kb.addAxiom(new ClassAssertionAxiom(deleteriousMutationClass, mutationInd)); } } @@ -385,13 +385,13 @@ long startWriteTime = System.nanoTime(); OWLAPIReasoner.exportKBToOWL(owlFile, kb, ontologyURI); long writeDuration = System.nanoTime() - startWriteTime; - System.out.println("OK (time: " + Helper.prettyPrintNanoSeconds(writeDuration) + "; file size: " + owlFile.length()/1024 + " KB)."); + System.out.println("OK (entities: " + count + "; time: " + Helper.prettyPrintNanoSeconds(writeDuration) + "; file size: " + owlFile.length()/1024 + " KB)."); // selecting examples // -> only a fraction of examples are selected as positive/negative if(pgSQL) { rs = stmt.executeQuery("SELECT * FROM fiche_mutant, mutants WHERE fiche_mutant.id=mutants.id AND " //lower(phenotype) not like 'polymorphism' AND " - + " (gain_contact is not null) AND (gain_contact != 0)"); + + " (gain_contact is not null)"); // AND (gain_contact != 0)"); } else { rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE " //lower(phenotype) not like 'polymorphism' AND " + " (gain_contact is not null) AND (gain_contact != 0)"); @@ -407,33 +407,28 @@ posExamples.add(new Individual(getURI("mutation" + mutationID))); } } - - // conf example: - -// import("mutation.owl"); -// -// reasoner = fastInstanceChecker; -// -// problem = classLearning; -// classLearning.classToDescribe = "http://dl-learner.org/mutation#DeletoriousMutation"; -// classLearning.accuracyMethod = "fmeasure"; -// classLearning.approxAccuracy = 0.03; -// -// algorithm = celoe; -// celoe.maxExecutionTimeInSeconds = 10; -// celoe.noisePercentage = 10; -// celoe.maxNrOfResults = 1; -// celoe.singleSuggestionMode = true; - + // writing conf file Files.clearFile(confFile); String confHeader = "import(\"" + owlFile.getName() + "\");\n\n"; confHeader += "reasoner = fastInstanceChecker;\n"; + confHeader += "problem = classLearning;\n"; - confHeader += "classLearning.classToDescribe = \"" + deleteriousMutationClass + "\";\n"; + confHeader += "classLearning.classToDescribe = \"" + deleteriousMutationClass + "\";\n"; + confHeader += "classLearning.accuracyMethod = \"fmeasure\";\n"; + confHeader += "classLearning.approxAccuracy = 0.03;\n"; + +// confHeader += "problem = posNegLPStandard;\n"; +// confHeader += "posNegLPStandard.useApproximations = true;\n"; +// confHeader += "posNegLPStandard.accuracyMethod = \"fmeasure\";\n"; +// confHeader += "posNegLPStandard.approxAccuracy = 0.03;\n"; + confHeader += "algorithm = celoe;\n"; - confHeader += "celoe.maxExecutionTimeInSeconds = 100;\n"; - confHeader += "celoe.noisePercentage = 25;\n"; + confHeader += "celoe.maxExecutionTimeInSeconds = 10;\n"; + confHeader += "celoe.noisePercentage = 10;\n"; + confHeader += "celoe.singleSuggestionMode = true;\n"; + confHeader += "celoe.useNegation = true;\n"; + // confHeader += "refexamples.noisePercentage = 15;\n"; // confHeader += "refexamples.startClass = \"" + getURI("Mutation") + "\";\n"; // confHeader += "refexamples.writeSearchTree = false;\n"; @@ -446,6 +441,7 @@ } long runTime = System.nanoTime() - startTime; + System.out.println("Conf file written with " + posExamples.size() + " positive and " + negExamples.size() + " negative examples."); System.out.println("Database successfully converted in " + Helper.prettyPrintNanoSeconds(runTime) + "."); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -138,6 +138,8 @@ Random rand = new Random(1); Collections.shuffle(classInstances, rand); Collections.shuffle(superClassInstances, rand); + + System.out.println(classInstances.size() + " " + superClassInstances.size()); } /** Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -293,14 +293,14 @@ throw new Error("approximating pred. acc not implemented"); } } else { - return getAccuracyOrTooWeakExact(description, noise); + return getPredAccuracyOrTooWeakExact(description, noise); } } /* (non-Javadoc) * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) */ - public double getAccuracyOrTooWeakExact(Description description, double noise) { + public double getPredAccuracyOrTooWeakExact(Description description, double noise) { int maxNotCovered = (int) Math.ceil(noise*positiveExamples.size()); @@ -321,9 +321,41 @@ } } - return positiveExamples.size() - notCoveredPos + notCoveredNeg / (double) allExamples.size(); +// if(useFMeasure) { +// double recall = (positiveExamples.size() - notCoveredPos) / (double) positiveExamples.size(); +// double precision = (positiveExamples.size() - notCoveredPos) / (double) (allExamples.size() - notCoveredPos - notCoveredNeg); +// return getFMeasure(recall, precision); +// } else { + return (positiveExamples.size() - notCoveredPos + notCoveredNeg) / (double) allExamples.size(); +// } } + public double getFMeasureOrTooWeakExact(Description description, double noise) { + int additionalInstances = 0; + for(Individual ind : negativeExamples) { + if(reasoner.hasType(description, ind)) { + additionalInstances++; + } + } + + int coveredInstances = 0; + for(Individual ind : positiveExamples) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + + double recall = coveredInstances/(double)positiveExamples.size(); + + if(recall < 1 - noise) { + return -1; + } + + double precision = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); + + return getFMeasure(recall, precision); + } + // instead of using the standard operation, we use optimisation // and approximation here public double getFMeasureOrTooWeakApprox(Description description, double noise) { @@ -438,6 +470,12 @@ precision = 0; } +// System.out.println("description: " + description); +// System.out.println("recall: " + recall); +// System.out.println("precision: " + precision); +// System.out.println("F-measure: " + getFMeasure(recall, precision)); +// System.out.println("exact: " + getAccuracyOrTooWeakExact(description, noise)); + return getFMeasure(recall, precision); } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -103,6 +103,10 @@ private TreeAndRoleSetComparator mComp = new TreeAndRoleSetComparator(); public ELDown2(ReasonerComponent rs) { + this(rs, true); + } + + public ELDown2(ReasonerComponent rs, boolean instanceBasedDisjoints) { this.rs = rs; subsumptionHierarchy = rs.getClassHierarchy(); opHierarchy = rs.getObjectPropertyHierarchy(); @@ -114,7 +118,7 @@ opRanges.put(op, rs.getRange(op)); } - utility = new Utility(rs, opDomains); + utility = new Utility(rs, opDomains, instanceBasedDisjoints); } /* (non-Javadoc) @@ -182,6 +186,9 @@ // call ncc (see paper) Set<NamedClass> candidates = utility.getClassCandidates(index, v.getLabel()); +// System.out.println("index: " + index + " label: " + v.getLabel()); +// System.out.println("candidates: " + candidates); + for(NamedClass nc : candidates) { // clone operation ELDescriptionTree clonedTree = tree.clone(); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -58,7 +58,6 @@ // specifies whether to do real disjoint tests or check that // two named classes do not have common instances - // TODO: turn this into a parameter private boolean instanceBasedDisjoints = true; // cache for reasoner queries @@ -71,11 +70,12 @@ throw new Error("not implemented yet"); } - public Utility(ReasonerComponent rs, Map<ObjectProperty,Description> opDomains) { + public Utility(ReasonerComponent rs, Map<ObjectProperty,Description> opDomains, boolean instanceBasedDisjoints) { this.reasoner = rs; sh = rs.getClassHierarchy(); // we cache object property domains this.opDomains = opDomains; + this.instanceBasedDisjoints = instanceBasedDisjoints; } /** @@ -134,6 +134,7 @@ // for 2 of them we can stop further traversal in the subsumption // hierarchy for(Description d : sh.getSubClasses(upperClass)) { +// System.out.println("d: " + d); // owl:Nothing is never a candidate (not in EL) if(!(d instanceof Nothing)) { NamedClass candidate = (NamedClass) d; @@ -151,6 +152,7 @@ // candidate went successfully through all checks candidates.add(candidate); } else { +// System.out.println("k32: " + candidate + " index " + index + " cond1 " + isDisjoint(new Negation(candidate),index) + " cond2 " + checkSuperClasses(existingClasses,candidate)); // descend subsumption hierarchy to find candidates candidates.addAll(getClassCandidatesRecursive(index, existingClasses, candidate)); } Modified: trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -119,8 +119,10 @@ String[] algorithmPostfix = new String[4]; algorithmPostfix[0] = "_refexamples"; algorithmPostfix[1] = "_refexamples_fast"; - algorithmPostfix[2] = "_gp"; - algorithmPostfix[3] = "_hybrid"; + algorithmPostfix[2] = "_el"; + algorithmPostfix[3] = "_el_disjunctive"; +// algorithmPostfix[4] = "_gp"; +// algorithmPostfix[5] = "_hybrid"; int startAlgorithmNr = 0; // only max. 4 folds for straight problem Modified: trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -41,6 +41,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.Thing; import org.dllearner.kb.OWLFile; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; @@ -313,6 +314,21 @@ } + @Test + public void test5() { + ReasonerComponent rs = TestOntologies.getTestOntology(TestOntology.TRAINS_OWL); + RefinementOperator operator = new ELDown2(rs); + Set<Description> refinements = operator.refine(Thing.instance); + for(Description refinement : refinements) { + System.out.println(refinement); + } + +// Set<Description> subClasses = rs.getSubClasses(Thing.instance); +// for(Description cl : subClasses) { +// System.out.println(cl); +// } + } + // not part of the regular test suite, since Galen 2 is required // @Test public void asTest() throws ComponentInitException, MalformedURLException { Modified: trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -32,6 +32,7 @@ import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.OWLAPIReasoner; /** * Some ontologies to simplify unit tests. @@ -41,7 +42,7 @@ */ public final class TestOntologies { - public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL }; + public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL, TRAINS_OWL }; public static ReasonerComponent getTestOntology(TestOntology ont) { String kbString = ""; @@ -119,7 +120,9 @@ owlFile = "examples/krk/KRK_ZERO_ONE.owl"; } else if(ont.equals(TestOntology.DBPEDIA_OWL)) { owlFile = "/home/jl/promotion/ontologien/dbpedia.owl"; - } + } else if(ont.equals(TestOntology.TRAINS_OWL)) { + owlFile = "examples/cross-benchmark/trains/trains.owl"; + } try { ComponentManager cm = ComponentManager.getInstance(); @@ -139,7 +142,8 @@ } } - ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, source); + ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, source); +// ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, source); source.init(); rc.init(); return rc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |