org.dllearner.core
Class AbstractLearningProblem

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractLearningProblem
All Implemented Interfaces:
Component, LearningProblem
Direct Known Subclasses:
ClassLearningProblem, FuzzyPosNegLP, PosNegLP, PosOnlyLP

public abstract class AbstractLearningProblem
extends AbstractComponent
implements LearningProblem

Base class for all learning problems. See also the wiki page for DL-Learner-Architecture. Currently, we assume that all learning problems have the goal of learning class descriptions. However, this may be extended to other scenarios if desired.

Author:
Jens Lehmann

Constructor Summary
AbstractLearningProblem(AbstractReasonerComponent reasoner)
          Constructs a learning problem using a reasoning service for querying the background knowledge.
 
Method Summary
 void changeReasonerComponent(AbstractReasonerComponent reasoner)
          Method to exchange the reasoner underlying the learning problem.
abstract  Score computeScore(Description description)
          Computes the Score of a given class description with respect to this learning problem.
abstract  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).
abstract  double getAccuracy(Description description)
          This method returns a value, which indicates how accurate a class description solves a learning problem.
abstract  double getAccuracyOrTooWeak(Description description, double noise)
          This method computes the accuracy as 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.
 
Methods inherited from class org.dllearner.core.AbstractComponent
createConfigOptions, getConfigurator, getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dllearner.core.Component
init
 

Constructor Detail

AbstractLearningProblem

public AbstractLearningProblem(AbstractReasonerComponent reasoner)
Constructs a learning problem using a reasoning service for querying the background knowledge. It can be used for evaluating solution candidates.

Parameters:
reasoner - The reasoning service used as background knowledge.
Method Detail

changeReasonerComponent

public void changeReasonerComponent(AbstractReasonerComponent reasoner)
Method to exchange the reasoner underlying the learning problem. Implementations, which do not only use the provided reasoning service class variable, must make sure that a call to this method indeed changes the reasoning service.

Parameters:
reasoner - New reasoning service.

computeScore

public abstract Score computeScore(Description description)
Computes the Score of a given class description with respect to this learning problem. This can (but does not need to) be used by learning algorithms to measure how good the description fits the learning problem. Score objects are used to store e.g. covered examples, accuracy etc., so often it is more efficient to only create score objects for promising class descriptions.

Parameters:
description - A class description (as solution candidate for this learning problem).
Returns:
A Score object.

evaluate

public abstract 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).

Parameters:
description - Description to evaluate.
Returns:

getAccuracy

public abstract double getAccuracy(Description description)
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.

Returns:
A value between 0 and 1 indicating the quality (of a class description).

getAccuracyOrTooWeak

public abstract double getAccuracyOrTooWeak(Description description,
                                            double noise)
This method computes the accuracy as 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.

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


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