org.dllearner.learningproblems
Class PosOnlyLP

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

public class PosOnlyLP
extends AbstractLearningProblem

A learning problem, where we learn from positive examples only.

Author:
Jens Lehmann

Constructor Summary
PosOnlyLP()
           
PosOnlyLP(AbstractReasonerComponent reasoningService)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
 ScorePosOnly computeScore(Description description)
          Computes the Score of a given class description with respect to this learning problem.
static Collection<ConfigOption<?>> createConfigOptions()
           
 EvaluatedDescriptionPosOnly 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.
 PosOnlyLPConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
static String getName()
           
 SortedSet<Individual> getPositiveExamples()
           
 void init()
          Method to be called after the component has been configured.
 
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

PosOnlyLP

public PosOnlyLP()

PosOnlyLP

public PosOnlyLP(AbstractReasonerComponent reasoningService)
Method Detail

getConfigurator

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

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.

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()

createConfigOptions

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

getName

public static String getName()

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.


getPositiveExamples

public SortedSet<Individual> getPositiveExamples()

computeScore

public ScorePosOnly computeScore(Description description)
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:
description - A class description (as solution candidate for this learning problem).
Returns:
the pseudoNegatives

evaluate

public EvaluatedDescriptionPosOnly 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:

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.


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