From: <Jen...@us...> - 2008-06-03 14:29:32
|
Revision: 934 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=934&view=rev Author: JensLehmann Date: 2008-06-03 07:29:22 -0700 (Tue, 03 Jun 2008) Log Message: ----------- intermediate commit (evaluation script) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/ReasoningService.java trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/scripts/CrossValidation.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/php-examples/LearningSimple.php Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-06-03 14:29:22 UTC (rev 934) @@ -30,6 +30,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasoningMethodUnsupportedException; import org.dllearner.core.ReasoningService; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; @@ -111,6 +112,7 @@ private boolean useCardinalityRestrictions = CommonConfigOptions.useCardinalityRestrictionsDefault; private boolean useNegation = CommonConfigOptions.useNegationDefault; private boolean useBooleanDatatypes = CommonConfigOptions.useBooleanDatatypesDefault; + private boolean useDoubleDatatypes = CommonConfigOptions.useDoubleDatatypesDefault; private double noisePercentage = 0.0; private NamedClass startClass = null; private boolean usePropernessChecks = false; @@ -178,6 +180,7 @@ options.add(CommonConfigOptions.useCardinalityRestrictions()); options.add(CommonConfigOptions.useNegation()); options.add(CommonConfigOptions.useBooleanDatatypes()); + options.add(CommonConfigOptions.useDoubleDatatypes()); options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); options.add(CommonConfigOptions.minExecutionTimeInSeconds()); options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); @@ -244,6 +247,8 @@ noisePercentage = (Double) entry.getValue(); } else if(name.equals("useBooleanDatatypes")) { useBooleanDatatypes = (Boolean) entry.getValue(); + } else if(name.equals("useDoubleDatatypes")) { + useDoubleDatatypes = (Boolean) entry.getValue(); } else if(name.equals("usePropernessChecks")) { usePropernessChecks = (Boolean) entry.getValue(); } else if(name.equals("maxPosOnlyExpansion")) { @@ -321,7 +326,9 @@ if(improveSubsumptionHierarchy) rs.getSubsumptionHierarchy().improveSubsumptionHierarchy(); rs.prepareRoleHierarchy(usedRoles); - rs.prepareDatatypePropertyHierarchy(); + // prepare datatype hierarchy only if necessary + if(rs.hasDatatypeSupport()) + rs.prepareDatatypePropertyHierarchy(); // create a refinement operator and pass all configuration // variables to it @@ -334,6 +341,7 @@ useCardinalityRestrictions, useNegation, useBooleanDatatypes, + useDoubleDatatypes, startClass ); Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-06-03 14:29:22 UTC (rev 934) @@ -45,6 +45,8 @@ */ public abstract class ReasonerComponent extends Component implements Reasoner { + public abstract boolean hasDatatypeSupport(); + public boolean subsumes(Description superConcept, Description subConcept) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); Modified: trunk/src/dl-learner/org/dllearner/core/ReasoningService.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-06-03 14:29:22 UTC (rev 934) @@ -80,7 +80,7 @@ // private SortedSet<Concept> retrievalsSet = new TreeSet<Concept>(new ConceptComparator()); - private Reasoner reasoner; + private ReasonerComponent reasoner; /** * Constructs a reasoning service object. Note that you must not @@ -459,6 +459,10 @@ return result; } + public boolean hasDatatypeSupport() { + return reasoner.hasDatatypeSupport(); + } + public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembers(DatatypeProperty datatypeProperty) { try { return reasoner.getDoubleDatatypeMembers(datatypeProperty); Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-06-03 14:29:22 UTC (rev 934) @@ -29,6 +29,8 @@ */ public final class CommonConfigOptions { + // some default values + //public static boolean applyAllFilterDefault = true; //public static boolean applyExistsFilterDefault = true; //public static boolean useTooWeakListDefault = true; @@ -40,14 +42,13 @@ public static boolean useCardinalityRestrictionsDefault = true; public static boolean useNegationDefault = true; public static boolean useBooleanDatatypesDefault = true; + public static boolean useDoubleDatatypesDefault = true; public static int maxExecutionTimeInSecondsDefault = 0; public static int minExecutionTimeInSecondsDefault = 0; public static int guaranteeXgoodDescriptionsDefault = 1; public static String logLevelDefault = "DEBUG"; //public static double noisePercentageDefault = 0.0; - - public static StringConfigOption getVerbosityOption() { StringConfigOption verbosityOption = new StringConfigOption("verbosity", "control verbosity of output for this component", "warning"); String[] allowedValues = new String[] {"quiet", "error", "warning", "notice", "info", "debug"}; @@ -110,6 +111,10 @@ return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useBooleanDatatypesDefault); } + public static BooleanConfigOption useDoubleDatatypes() { + return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useDoubleDatatypesDefault); + } + public static IntegerConfigOption maxExecutionTimeInSeconds() { return new IntegerConfigOption("maxExecutionTimeInSeconds", "algorithm will stop after specified seconds",maxExecutionTimeInSecondsDefault); } Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-06-03 14:29:22 UTC (rev 934) @@ -795,4 +795,9 @@ return null; } + @Override + public boolean hasDatatypeSupport() { + return false; + } + } Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-06-03 14:29:22 UTC (rev 934) @@ -630,5 +630,11 @@ public void setReasonerType(String type){ reasonerType=type; } + + + @Override + public boolean hasDatatypeSupport() { + return true; + } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-06-03 14:29:22 UTC (rev 934) @@ -193,4 +193,9 @@ public void releaseKB() { rc.releaseKB(); } + + @Override + public boolean hasDatatypeSupport() { + return true; + } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-06-03 14:29:22 UTC (rev 934) @@ -904,4 +904,9 @@ reasonerType=type; } + @Override + public boolean hasDatatypeSupport() { + return true; + } + } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-06-03 14:29:22 UTC (rev 934) @@ -167,11 +167,11 @@ // private Map<NamedClass,Map<NamedClass,Boolean>> notABMeaningful = new TreeMap<NamedClass,Map<NamedClass,Boolean>>(); public RhoDRDown(ReasoningService reasoningService) { - this(reasoningService, true, true, true, true, true, true, true, null); + this(reasoningService, true, true, true, true, true, true, true, true, null); } public RhoDRDown(ReasoningService reasoningService, boolean applyAllFilter, boolean applyExistsFilter, boolean useAllConstructor, - boolean useExistsConstructor,boolean useCardinalityRestrictions,boolean useNegation, boolean useBooleanDatatypes, NamedClass startClass) { + boolean useExistsConstructor,boolean useCardinalityRestrictions,boolean useNegation, boolean useBooleanDatatypes, boolean useDoubleDatatypes, NamedClass startClass) { this.rs = reasoningService; this.applyAllFilter = applyAllFilter; this.applyExistsFilter = applyExistsFilter; @@ -180,6 +180,7 @@ this.useCardinalityRestrictions = useCardinalityRestrictions; this.useNegation = useNegation; this.useBooleanDatatypes = useBooleanDatatypes; + this.useDoubleDatatypes = useDoubleDatatypes; subHierarchy = rs.getSubsumptionHierarchy(); Modified: trunk/src/dl-learner/org/dllearner/scripts/CrossValidation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CrossValidation.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/scripts/CrossValidation.java 2008-06-03 14:29:22 UTC (rev 934) @@ -57,6 +57,11 @@ private static Logger logger = Logger.getRootLogger(); + // statistical values + private Stat runtime = new Stat(); + private Stat accuracy = new Stat(); + private Stat length = new Stat(); + public static void main(String[] args) { File file = new File(args[0]); @@ -90,7 +95,11 @@ } public CrossValidation(File file, int folds, boolean leaveOneOut) { + this(file, folds, leaveOneOut, null); + } + public CrossValidation(File file, int folds, boolean leaveOneOut, LearningAlgorithm la) { + DecimalFormat df = new DecimalFormat(); ComponentManager cm = ComponentManager.getInstance(); @@ -178,11 +187,6 @@ System.exit(0); } - // statistical values - Stat runtime = new Stat(); - Stat accuracy = new Stat(); - Stat length = new Stat(); - // run the algorithm for(int currFold=0; currFold<folds; currFold++) { // we always perform a full initialisation to make sure that @@ -204,7 +208,8 @@ // es fehlt init zwischendurch - LearningAlgorithm la = start.getLearningAlgorithm(); + if(la == null) + la = start.getLearningAlgorithm(); // init again, because examples have changed try { la.init(); @@ -315,4 +320,16 @@ return str; } + public Stat getAccuracy() { + return accuracy; + } + + public Stat getLength() { + return length; + } + + public Stat getRuntime() { + return runtime; + } + } Modified: trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2008-06-03 14:29:22 UTC (rev 934) @@ -25,21 +25,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.SortedSet; import org.dllearner.algorithms.gp.GP; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; -import org.dllearner.core.Score; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.PosNegDefinitionLP; -import org.dllearner.parser.ConfParser; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; @@ -69,6 +64,7 @@ // experimental setup: + // 5 fold cross validation // algorithms: refinement, GP, hybrid GP (YinYang) // settings GP: // - average over 10 runs @@ -95,18 +91,18 @@ // - uncle (FORTE) // - more? - String exampleBaseDir = "examples/"; + String exampleBaseDir = "examples/cross-benchmark/"; String gnuplotBaseDir = "log/gnuplot/"; String statBaseDir = "log/stat/"; - File[] confFiles = new File[7]; - confFiles[0] = new File(exampleBaseDir + "trains", "trains_owl.conf"); - confFiles[1] = new File(exampleBaseDir + "arch", "arch_owl.conf"); - confFiles[2] = new File(exampleBaseDir + "moral_reasoner", "moral_43examples_owl.conf"); - confFiles[3] = new File(exampleBaseDir + "moral_reasoner", "moral_43examples_complex_owl.conf"); - confFiles[4] = new File(exampleBaseDir + "poker", "pair_owl.conf"); - confFiles[5] = new File(exampleBaseDir + "poker", "straight_owl.conf"); - confFiles[6] = new File(exampleBaseDir + "forte", "forte_uncle_owl.conf"); + File[] confFiles = new File[1]; +// confFiles[0] = new File(exampleBaseDir + "trains", "trains_owl"); + confFiles[0] = new File(exampleBaseDir + "arch", "arch"); +// confFiles[2] = new File(exampleBaseDir + "moral_reasoner", "moral_43examples_owl"); +// confFiles[3] = new File(exampleBaseDir + "moral_reasoner", "moral_43examples_complex_owl"); +// confFiles[4] = new File(exampleBaseDir + "poker", "pair_owl"); +// confFiles[5] = new File(exampleBaseDir + "poker", "straight_owl"); +// confFiles[6] = new File(exampleBaseDir + "forte", "forte_uncle_owl"); String[] examples = new String[7]; examples[0] = "trains"; @@ -118,192 +114,31 @@ examples[6] = "uncle (FORTE data set)"; int startExampleNr = 0; - String[] algorithms = new String[3]; - algorithms[0] = "refinement"; - algorithms[1] = "gp"; - algorithms[2] = "hybrid"; - - int[] algorithmRuns = {1,10,10}; + // for any example, we create conf files for each configuration to be tested + String[] algorithmPostfix = new String[4]; + algorithmPostfix[0] = "_refexamples"; + algorithmPostfix[1] = "_refexamples_fast"; + algorithmPostfix[2] = "_gp"; + algorithmPostfix[3] = "_hybrid"; int startAlgorithmNr = 0; - // Config.GP.maxConceptLength = 30; - // Config.writeDIGProtocol = true; - // Config.digProtocolFile = new File(statBaseDir, "dig.log"); - - // do not plot anything - // File[][][] gnuplotFiles = new File[examples.length][algorithms.length][3]; - // for(int i=0; i<examples.length; i++) { - // for(int j=0; j<algorithms.length; j++) { - // gnuplotFiles[i][j][0] = new File(gnuplotBaseDir, examples[i] + "_classification_" + algorithms[j] + ".data"); - // gnuplotFiles[i][j][1] = new File(gnuplotBaseDir, examples[i] + "_length_" + algorithms[j] + ".data"); - // gnuplotFiles[i][j][2] = new File(gnuplotBaseDir, examples[i] + "_runtime_" + algorithms[j] + ".data"); - // } - //} - File statFile = new File(statBaseDir, "statistics.txt"); - File statDetailsFile = new File(statBaseDir, "statistics_details.txt"); String statString = "**automatically generated statistics**\n\n"; - String statDetailsString = statString; - ComponentManager cm = ComponentManager.getInstance(); - - // just set default options -// ConfigurationManager confMgr = new ConfigurationManager(); -// confMgr.applyOptions(); - for(int exampleNr=startExampleNr; exampleNr < examples.length; exampleNr++) { - // parse current conf file - ConfParser learner = ConfParser.parseFile(confFiles[exampleNr]); - - String baseDir = confFiles[exampleNr].getParent(); - - // read which files were imported (internal KB is ignored) and initialise reasoner - Map<URL, OntologyFormat> imports = getImports(learner.getFunctionCalls(), confFiles[exampleNr]); - //Map<URL, Class<? extends KnowledgeSource>> imports = Start.getImportedFiles(learner, baseDir); - - // detect specified positive and negative examples - SortedSet<String> positiveExamples = learner.getPositiveExamples(); - SortedSet<String> negativeExamples = learner.getNegativeExamples(); - int nrOfExamples = positiveExamples.size() + negativeExamples.size(); - - statString += "example: " + examples[exampleNr] + "\n\n"; - - for(int algorithmNr=startAlgorithmNr; algorithmNr < algorithms.length; algorithmNr++) { + for(int algorithmNr=startAlgorithmNr; algorithmNr < algorithmPostfix.length; algorithmNr++) { // reset algorithm number (next example starts with first algorithm) startAlgorithmNr = 0; + File confFile = new File(confFiles[exampleNr] + algorithmPostfix[algorithmNr] + ".conf"); + + CrossValidation cv = new CrossValidation(confFile, 5, false); Stat classification = new Stat(); Stat length = new Stat(); Stat runtime = new Stat(); - for(int runNr=0; runNr < algorithmRuns[algorithmNr]; runNr++) { - - // create reasoner (this has to be done in this inner loop to - // ensure that none of the algorithm benefits from e.g. caching - // of previous reasoning requests - // Reasoner reasoner = Main.createReasoner(new KB(), imports); - // TODO: needs fixing - KnowledgeSource ks = cm.knowledgeSource(OWLFile.class); - ReasonerComponent reasoner = cm.reasoner(DIGReasoner.class, ks); - ReasoningService rs = new ReasoningService(reasoner); - - // System.out.println(positiveExamples); - // System.out.println(negativeExamples); - // System.exit(0); - - // create learning problem - // LearningProblem learningProblem = new LearningProblem(rs, positiveExamples, negativeExamples); - LearningProblem learningProblem = cm.learningProblem(PosNegDefinitionLP.class, rs); - - // prepare reasoner for using subsumption and role hierarchy - // TODO: currently, it is a small unfairness that each algorithm - // uses the same reasoning object (e.g. the second algorithm may - // have a small advantage if the reasoner cached reasoning requests - // of the first algorithm) -// Helper.autoDetectConceptsAndRoles(rs); -// try { -// reasoner.prepareSubsumptionHierarchy(); -// reasoner.prepareRoleHierarchy(); -// // improving the subsumption hierarchy makes only sense -// // for the refinement based algorithm -// if(algorithmNr==0) -// reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); -// } catch (ReasoningMethodUnsupportedException e) { -// e.printStackTrace(); -// } - - LearningAlgorithm learningAlgorithm = null; - if(algorithmNr==0) { - // Config.algorithm = Algorithm.REFINEMENT; - // Config.Refinement.heuristic = Config.Refinement.Heuristic.FLEXIBLE; -// Config.Refinement.horizontalExpansionFactor = 0.6; -// Config.Refinement.quiet = true; - // Config.percentPerLengthUnit = 0.05; - // learningAlgorithm = new ROLearner(learningProblem); - // learningAlgorithm = cm.learningAlgorithm(ROLearner.class, learningProblem); - } else if(algorithmNr==1) { - // Config.algorithm = Algorithm.GP; -// Config.GP.algorithmType = GP.AlgorithmType.GENERATIONAL; -//// Config.GP.selectionType = GP.SelectionType.RANK_SELECTION; -// Config.GP.generations = 50; -// Config.GP.useFixedNumberOfGenerations = true; -// Config.GP.numberOfIndividuals = 201; - // if(exampleNr == 3 || exampleNr == 4) - // Config.GP.numberOfIndividuals = 51; -// Config.GP.refinementProbability = 0; -// Config.GP.mutationProbability = 0.02; -// Config.GP.crossoverProbability = 0.8; -// Config.GP.hillClimbingProbability = 0; - // Config.percentPerLengthUnit = 0.005; - // give GP a chance to find the long solution of the - // uncle problem - // if(exampleNr==3 || exampleNr==5 || exampleNr == 6) - // Config.percentPerLengthUnit = 0.002; - // learningAlgorithm = new GP(learningProblem); - try { - learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); - } catch (LearningProblemUnsupportedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } else if(algorithmNr==2) { - // Config.algorithm = Algorithm.HYBRID_GP; -// Config.GP.algorithmType = GP.AlgorithmType.GENERATIONAL; -// Config.GP.selectionType = GP.SelectionType.RANK_SELECTION; -// Config.GP.generations = 50; -// Config.GP.useFixedNumberOfGenerations = true; -// Config.GP.numberOfIndividuals = 201; - //if(exampleNr == 3 || exampleNr == 4) - // Config.GP.numberOfIndividuals = 51; -// Config.GP.refinementProbability = 0.65; -// Config.GP.mutationProbability = 0.02; -// Config.GP.crossoverProbability = 0.2; -// Config.GP.hillClimbingProbability = 0; - // Config.percentPerLengthUnit = 0.005; - // if(exampleNr == 3 || exampleNr==5 || exampleNr==6) -// Config.percentPerLengthUnit = 0.002; - // learningAlgorithm = new GP(learningProblem); - try { - learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); - } catch (LearningProblemUnsupportedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - // rs.resetStatistics(); - - long algorithmStartTime = System.nanoTime(); - learningAlgorithm.start(); - long algorithmTime = System.nanoTime() - algorithmStartTime; - // long algorithmTimeSeconds = algorithmTime / 1000000000; - - int conceptLength = learningAlgorithm.getBestSolution().getLength(); - Score bestScore = learningAlgorithm.getSolutionScore(); - int misClassifications = bestScore.getCoveredNegatives().size() - + bestScore.getNotCoveredPositives().size(); - double classificationRatePercent = 100 * ((nrOfExamples - misClassifications) / (double) nrOfExamples); - - classification.addNumber(classificationRatePercent); - length.addNumber(conceptLength); - runtime.addNumber(algorithmTime); - - // free knowledge base to avoid memory leaks - ((DIGReasoner) reasoner).releaseKB(); - - statDetailsString += "example: " + examples[exampleNr] + "\n"; - statDetailsString += "algorithm: " + algorithms[algorithmNr] + "\n"; - statDetailsString += "learned concept: " + learningAlgorithm.getBestSolution() + "\n"; - statDetailsString += "classification: " + classificationRatePercent + "%\n"; - statDetailsString += "concept length: " + conceptLength + "\n"; - statDetailsString += "runtime: " + Helper.prettyPrintNanoSeconds(algorithmTime) + "\n\n"; - - Files.createFile(statDetailsFile, statDetailsString); - - } // end run loop - - statString += "algorithm: " + algorithms[algorithmNr] + " (runs: " + algorithmRuns[algorithmNr] + ")\n"; + statString += "conf file: " + confFile + "\n"; statString += "classification: " + classification.getMean() + "% (standard deviation: " + classification.getStandardDeviation() + "%)\n"; statString += "concept length: " + length.getMean() + " (standard deviation: " + length.getStandardDeviation() + ")\n"; statString += "runtime: " + Helper.prettyPrintNanoSeconds(Math.round(runtime.getMean())) + " (standard deviation: " + Helper.prettyPrintNanoSeconds(Math.round(runtime.getStandardDeviation())) + ")\n\n"; @@ -316,6 +151,7 @@ } + @SuppressWarnings({"unused"}) private static Map<URL, OntologyFormat> getImports(Map<String,List<List<String>>> functionCalls, File confFile) { Map<URL, OntologyFormat> importedFiles = new HashMap<URL, OntologyFormat>(); @@ -358,9 +194,6 @@ return importedFiles; } - // erzeugt Statistiken für MLDM-Paper zur Verarbeitung mit GnuPlot - // Vorsicht: Laufzeit von mehreren Stunden - /** * Has been used to create the statistics for the MLDM 2007 paper. * Warning: this method runs for several hours Modified: trunk/src/php-examples/LearningSimple.php =================================================================== --- trunk/src/php-examples/LearningSimple.php 2008-06-02 12:36:06 UTC (rev 933) +++ trunk/src/php-examples/LearningSimple.php 2008-06-03 14:29:22 UTC (rev 934) @@ -30,7 +30,7 @@ // load WSDL files (has to be done due to a Java web service bug) ini_set("soap.wsdl_cache_enabled","0"); $wsdluri="http://localhost:8181/services?wsdl"; -// Utilities::loadWSDLfiles($wsdluri); +Utilities::loadWSDLfiles($wsdluri); // specifiy ontology $ontology = 'file:'.realpath("../../examples/family/father.owl"); @@ -42,7 +42,7 @@ // load owl file in DIG reasoner (you need a running DIG reasoner) $id = $client->generateID(); $ksID = $client->addKnowledgeSource($id, "owlfile", $ontology); -$rID = $client->setReasoner($id, "dig"); +$rID = $client->setReasoner($id, "owlapi"); // create a learning problem $posExamples = array('http://example.com/father#stefan', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |