org.dllearner.learningproblems.fuzzydll
Class FuzzyPosNegLPStandard

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractLearningProblem
          extended by org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLP
              extended by org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLPStandard
All Implemented Interfaces:
Component, LearningProblem

public class FuzzyPosNegLPStandard
extends FuzzyPosNegLP

The aim of this learning problem is to learn a concept definition such that the positive examples and the negative examples do not follow. It is 2-valued, because we only distinguish between covered and non-covered examples. (A 3-valued problem distinguishes between covered examples, examples covered by the negation of the concept, and all other examples.) The 2-valued learning problem is often more useful for Description Logics due to (the Open World Assumption and) the fact that negative knowledge, e.g. that a person does not have a child, is or cannot be expressed.

Author:
Jens Lehmann

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLP
FuzzyPosNegLP.UseMultiInstanceChecks
 
Constructor Summary
FuzzyPosNegLPStandard(AbstractReasonerComponent reasoningService)
           
FuzzyPosNegLPStandard(AbstractReasonerComponent reasoningService, SortedSet<Individual> positiveExamples, SortedSet<Individual> negativeExamples)
           
 
Method Summary
 ScorePosNeg computeScore(Description concept)
          Computes score of a given concept using the reasoner.
 int coveredNegativeExamplesOrTooWeak(Description concept)
          This method computes (using the reasoner) whether a concept is too weak.
static Collection<ConfigOption<?>> createConfigOptions()
           
 EvaluatedDescription evaluate(Description description)
          Evaluates the description by computing the score and returning an evaluated description of the correct type (ClassLearningProblem returns EvaluatedDescriptionClass instead of generic EvaluatedDescription).
 double getAccuracy(Description description)
          This method returns a value, which indicates how accurate a class description solves a learning problem.
 double getAccuracyOrTooWeak(Description description, double noise)
          This method computes the accuracy as AbstractLearningProblem.getAccuracy(Description), but returns -1 instead of the accuracy if 1.) the accuracy of the description is below the given threshold and 2.) the accuracy of all more special w.r.t. subsumption descriptions is below the given threshold.
 double getAccuracyOrTooWeakApprox(Description description, double noise)
           
 double getAccuracyOrTooWeakExact(Description description, double noise)
           
 FuzzyPosNegLPStandardConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
 double getFMeasureOrTooWeakApprox(Description description, double noise)
          Deprecated. 
 double getFMeasureOrTooWeakExact(Description description, double noise)
           
static String getName()
           
 double getPredAccuracyOrTooWeakExact(Description description, double noise)
           
 void init()
          Method to be called after the component has been configured.
 
Methods inherited from class org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLP
applyConfigEntry, getNegativeExamples, getPercentPerLengthUnit, getPositiveExamples, setNegativeExamples, setPositiveExamples
 
Methods inherited from class org.dllearner.core.AbstractLearningProblem
changeReasonerComponent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuzzyPosNegLPStandard

public FuzzyPosNegLPStandard(AbstractReasonerComponent reasoningService)

FuzzyPosNegLPStandard

public FuzzyPosNegLPStandard(AbstractReasonerComponent reasoningService,
                             SortedSet<Individual> positiveExamples,
                             SortedSet<Individual> negativeExamples)
Method Detail

getConfigurator

public FuzzyPosNegLPStandardConfigurator getConfigurator()
Description copied from class: AbstractComponent
For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}. The configurator provides set and get methods for the configuration options of a component.

Specified by:
getConfigurator in class AbstractComponent
Returns:
An object allowing to configure this component.

init

public void init()
Description copied from interface: Component
Method to be called after the component has been configured. Implementation of components can overwrite this method to perform setup and initialisation tasks for this component.

Specified by:
init in interface Component
Overrides:
init in class FuzzyPosNegLP

getName

public static String getName()

createConfigOptions

public static Collection<ConfigOption<?>> createConfigOptions()

coveredNegativeExamplesOrTooWeak

public int coveredNegativeExamplesOrTooWeak(Description concept)
This method computes (using the reasoner) whether a concept is too weak. If it is not weak, it returns the number of covered negative examples. It can use retrieval or instance checks for classification.

Specified by:
coveredNegativeExamplesOrTooWeak in class FuzzyPosNegLP
Parameters:
concept - The concept to test.
Returns:
-1 if concept is too weak and the number of covered negative examples otherwise.
See Also:
TODO: Performance could be slightly improved by counting the number of covers instead of using sets and counting their size.

computeScore

public ScorePosNeg computeScore(Description concept)
Computes score of a given concept using the reasoner. Either retrieval or instance check are used. For the latter, this method treats UseMultiInstanceChecks.TWO_CHECKS as if it were UseMultiInstanceChecks.ONE_CHECKS (it does not make much sense to implement TWO_CHECKS in this function, because we have to test all examples to create a score object anyway). NOTE: The options above are no longer supported, because of interface changes (the options are more or less only relevant in combination with DIG).

Specified by:
computeScore in class AbstractLearningProblem
Parameters:
concept - The concept to test.
Returns:
Corresponding Score object.
See Also:
PosNegLP.UseMultiInstanceChecks

getAccuracy

public double getAccuracy(Description description)
Description copied from class: AbstractLearningProblem
This method returns a value, which indicates how accurate a class description solves a learning problem. There can be different ways to compute accuracy depending on the type of learning problem and other factors. However, all implementations are required to return a value between 0 and 1, where 1 stands for the highest possible accuracy and 0 for the lowest possible accuracy.

Specified by:
getAccuracy in class AbstractLearningProblem
Returns:
A value between 0 and 1 indicating the quality (of a class description).

getAccuracyOrTooWeak

public double getAccuracyOrTooWeak(Description description,
                                   double noise)
Description copied from class: AbstractLearningProblem
This method computes the accuracy as AbstractLearningProblem.getAccuracy(Description), but returns -1 instead of the accuracy if 1.) the accuracy of the description is below the given threshold and 2.) the accuracy of all more special w.r.t. subsumption descriptions is below the given threshold. This is used for efficiency reasons, i.e. -1 can be returned instantly if it is clear that the description and all its refinements are not sufficiently accurate.

Specified by:
getAccuracyOrTooWeak in class AbstractLearningProblem
Returns:
A value between 0 and 1 indicating the quality (of a class description) or -1 as described above.

getAccuracyOrTooWeakApprox

public double getAccuracyOrTooWeakApprox(Description description,
                                         double noise)

getAccuracyOrTooWeakExact

public double getAccuracyOrTooWeakExact(Description description,
                                        double noise)

getPredAccuracyOrTooWeakExact

public double getPredAccuracyOrTooWeakExact(Description description,
                                            double noise)

getFMeasureOrTooWeakExact

public double getFMeasureOrTooWeakExact(Description description,
                                        double noise)

getFMeasureOrTooWeakApprox

@Deprecated
public double getFMeasureOrTooWeakApprox(Description description,
                                                    double noise)
Deprecated. 


evaluate

public EvaluatedDescription evaluate(Description description)
Description copied from class: AbstractLearningProblem
Evaluates the description by computing the score and returning an evaluated description of the correct type (ClassLearningProblem returns EvaluatedDescriptionClass instead of generic EvaluatedDescription).

Specified by:
evaluate in class AbstractLearningProblem
Parameters:
description - Description to evaluate.
Returns:


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann