From: <ji...@us...> - 2011-05-11 12:44:17
|
Revision: 2790 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2790&view=rev Author: jialva Date: 2011-05-11 12:44:11 +0000 (Wed, 11 May 2011) Log Message: ----------- New update of fuzzyDL-Learner Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java 2011-05-11 10:20:23 UTC (rev 2789) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java 2011-05-11 12:44:11 UTC (rev 2790) @@ -57,6 +57,7 @@ protected boolean useRetrievalForClassification = false; protected UseMultiInstanceChecks useMultiInstanceChecks = UseMultiInstanceChecks.TWOCHECKS; protected double percentPerLengthUnit = 0.05; + protected double totalTruth = 0; /** * If instance checks are used for testing concepts (e.g. no retrieval), then @@ -117,8 +118,12 @@ public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { String name = entry.getOptionName(); // added by Josue - if (name.equals("fuzzyExamples")) + if (name.equals("fuzzyExamples")){ fuzzyExamples = CommonConfigMappings.getFuzzyIndividualSet((Set<FuzzyExample>) entry.getValue()); + for (FuzzyIndividual fuzzyExample : fuzzyExamples) { + totalTruth += fuzzyExample.getBeliefDegree(); + } + } // TODO delete positiveExamples & negativeExamples else if (name.equals("positiveExamples")) positiveExamples = CommonConfigMappings Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-11 10:20:23 UTC (rev 2789) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-11 12:44:11 UTC (rev 2790) @@ -509,7 +509,7 @@ */ public double getPredAccuracyOrTooWeakExact(Description description, double noise) { - System.out.println(errorIndex++); + // System.out.println(errorIndex++); double crispAccuracy = crispAccuracy(description, noise); // if I erase next line, fuzzy reasoning fails @@ -532,10 +532,10 @@ // TODO // TODO // TODO \xC1\xC1\xC1sacar de aqu\x92 y metenerlo en la clase fuzzyExample/fuzzyIndividual o .. - double totalTruth = 0; - for (FuzzyIndividual fuzzyExample : fuzzyExamples) { - totalTruth += fuzzyExample.getBeliefDegree(); - } +// double totalTruth = 0; +// for (FuzzyIndividual fuzzyExample : fuzzyExamples) { +// totalTruth += fuzzyExample.getBeliefDegree(); +// } // TODO // TODO // TODO Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-05-11 10:20:23 UTC (rev 2789) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-05-11 12:44:11 UTC (rev 2790) @@ -66,9 +66,9 @@ fuzzyFileParser = new FuzzyOwl2toFuzzyDL(ontologyFile, FUZZYOWL2FUZZYDLPARSEROUTPUT); fuzzyFileParser.translateOwl2Ontology(); - System.err.println("WARNING: you're using a particular fuzzy ontology"); - parser = new Parser(new FileInputStream(CHANGING_JUST_HIERARCHI_PROBLEM)); -// parser = new Parser(new FileInputStream(FUZZYOWL2FUZZYDLPARSEROUTPUT)); +// System.err.println("WARNING: you're using a particular fuzzy ontology"); +// parser = new Parser(new FileInputStream(CHANGING_JUST_HIERARCHI_PROBLEM)); + parser = new Parser(new FileInputStream(FUZZYOWL2FUZZYDLPARSEROUTPUT)); parser.Start(); return parser.getKB(); Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-11 10:20:23 UTC (rev 2789) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-11 12:44:11 UTC (rev 2790) @@ -51,9 +51,9 @@ "http://www.example.com/fuzzyTrains.owl#west6", "http://www.example.com/fuzzyTrains.owl#west7" }; - + public Description learn() throws LearningProblemUnsupportedException, IOException, ComponentInitException { - + // // positive and negative examples // @@ -80,7 +80,7 @@ ComponentManager cm = ComponentManager.getInstance(); OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(new URL("file:///Users/josue/Documents/PhD/AKSW/ontologies/fuzzyTrains/noFuzzyTrains_v1.3.owl")); + ks.getConfigurator().setUrl(new URL("file:///Users/josue/Documents/PhD/AKSW/ontologies/fuzzyTrains/fuzzyTrains_v1.3.owl")); ks.init(); //ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); @@ -113,8 +113,13 @@ } public static void main(String args[]) throws LearningProblemUnsupportedException, IOException, ComponentInitException { + long start = System.currentTimeMillis(); + FuzzyDLLTest_Trains test = new FuzzyDLLTest_Trains(); test.learn(); + + System.err.println("running time (s) = " + (System.currentTimeMillis() - start)/1000); + } } \ No newline at end of file Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-11 10:20:23 UTC (rev 2789) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-11 12:44:11 UTC (rev 2790) @@ -118,8 +118,12 @@ } public static void main(String args[]) throws LearningProblemUnsupportedException, IOException, ComponentInitException { + long start = System.currentTimeMillis(); + FuzzyDLLTest_noFuzzyTrains test = new FuzzyDLLTest_noFuzzyTrains(); test.learn(); + + System.err.println("running time (s) = " + (System.currentTimeMillis() - start)/1000); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |