org.dllearner.learningproblems
Class PosNegLPStrict

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractLearningProblem
          extended by org.dllearner.learningproblems.PosNegLP
              extended by org.dllearner.learningproblems.PosNegLPStrict
All Implemented Interfaces:
Component, LearningProblem

public class PosNegLPStrict
extends PosNegLP

Author:
Jens Lehmann

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dllearner.learningproblems.PosNegLP
PosNegLP.UseMultiInstanceChecks
 
Constructor Summary
PosNegLPStrict(AbstractReasonerComponent reasoningService)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
 ScorePosNeg computeScore(Description concept)
          Computes the Score of a given class description with respect to this learning problem.
 int coveredNegativeExamplesOrTooWeak(Description concept)
           
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 minAccuracy)
          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 getAccuracyPenalty()
           
 PosNegLPStrictConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
 double getErrorPenalty()
           
static String getName()
           
 SortedSet<Individual> getNeutralExamples()
           
 void init()
          Method to be called after the component has been configured.
 boolean isPenaliseNeutralExamples()
           
 
Methods inherited from class org.dllearner.learningproblems.PosNegLP
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

PosNegLPStrict

public PosNegLPStrict(AbstractReasonerComponent reasoningService)
Method Detail

getConfigurator

public PosNegLPStrictConfigurator 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.

getName

public static String getName()

createConfigOptions

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

applyConfigEntry

public <T> void applyConfigEntry(ConfigEntry<T> entry)
                      throws InvalidConfigOptionValueException
Description copied from class: AbstractComponent
Applies a configuration option to this component. Implementations of components should use option and value of the config entry to perform an action (usually setting an internal variable to an appropriate value). Since the availability of configurators, it is optional for components to implement this method. Instead of using this method to take an action based on a configuration value, components can also use the getters defined in the components configurator. Important note: Never call this method directly. All calls are done via the ComponentManager.

Overrides:
applyConfigEntry in class PosNegLP
Type Parameters:
T - Type of the config entry (Integer, String etc.).
Parameters:
entry - A configuration entry.
Throws:
InvalidConfigOptionValueException - This exception is thrown if the value of the config entry is not valid. For instance, a config option may only accept values, which are within intervals 0.1 to 0.3 or 0.5 to 0.8. If the value is outside of those intervals, an exception is thrown. Note that many of the common cases are already caught in the constructor of ConfigEntry (for instance for a DoubleConfigOption you can specify an interval for the value). This means that, as a component developer, you often do not need to implement further validity checks.
See Also:
AbstractComponent.getConfigurator()

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 PosNegLP

computeScore

public ScorePosNeg computeScore(Description concept)
Description copied from class: AbstractLearningProblem
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.

Specified by:
computeScore in class AbstractLearningProblem
Parameters:
concept - A class description (as solution candidate for this learning problem).
Returns:
A Score object.

coveredNegativeExamplesOrTooWeak

public int coveredNegativeExamplesOrTooWeak(Description concept)
Specified by:
coveredNegativeExamplesOrTooWeak in class PosNegLP

getNeutralExamples

public SortedSet<Individual> getNeutralExamples()

getAccuracyPenalty

public double getAccuracyPenalty()
Returns:
the accuracyPenalty

getErrorPenalty

public double getErrorPenalty()
Returns:
the errorPenalty

isPenaliseNeutralExamples

public boolean isPenaliseNeutralExamples()
Returns:
the penaliseNeutralExamples

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 minAccuracy)
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.

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