org.dllearner.learningproblems
Class ScoreTwoValued

java.lang.Object
  extended by org.dllearner.core.Score
      extended by org.dllearner.learningproblems.ScorePosNeg
          extended by org.dllearner.learningproblems.ScoreTwoValued

public class ScoreTwoValued
extends ScorePosNeg

Calculates accuracy and score (with respect to some length penalty) of a class description. TODO: In fact, a score value influencing a learning algorithm should not be calculated here, but rather in a separate heuristic as there are many methods to calculate such a value. This class should only be used for computing example coverage, accuracy etc.

Author:
Jens Lehmann

Constructor Summary
ScoreTwoValued(int conceptLength, double percentPerLengthUnit, Set<Individual> posAsPos, Set<Individual> posAsNeg, Set<Individual> negAsPos, Set<Individual> negAsNeg)
           
ScoreTwoValued(Set<Individual> posAsPos, Set<Individual> posAsNeg, Set<Individual> negAsPos, Set<Individual> negAsNeg)
           
 
Method Summary
 double getAccuracy()
          This method returns a value, which indicates how accurate a class description solves a learning problem.
 Set<Individual> getCoveredNegatives()
           
 Set<Individual> getCoveredPositives()
           
 ScorePosNeg getModifiedLengthScore(int newLength)
          The score of a concept depends on how good it classifies the examples of a learning problem and the length of the concept itself.
 Set<Individual> getNotCoveredNegatives()
           
 Set<Individual> getNotCoveredPositives()
           
 double getScoreValue()
          score = accuracy - 1 - length * length penalty
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScoreTwoValued

public ScoreTwoValued(Set<Individual> posAsPos,
                      Set<Individual> posAsNeg,
                      Set<Individual> negAsPos,
                      Set<Individual> negAsNeg)

ScoreTwoValued

public ScoreTwoValued(int conceptLength,
                      double percentPerLengthUnit,
                      Set<Individual> posAsPos,
                      Set<Individual> posAsNeg,
                      Set<Individual> negAsPos,
                      Set<Individual> negAsNeg)
Method Detail

getAccuracy

public double getAccuracy()
Description copied from class: Score
This method returns a value, which indicates how accurate a class description solves a learning problem.

Specified by:
getAccuracy in class Score
Returns:
A value between 0 and 1 indicating the quality (of a class description).
See Also:
LearningProblem.getAccuracy(Description)

getScoreValue

public double getScoreValue()
score = accuracy - 1 - length * length penalty

Specified by:
getScoreValue in class ScorePosNeg

toString

public String toString()
Overrides:
toString in class Object

getCoveredNegatives

public Set<Individual> getCoveredNegatives()
Specified by:
getCoveredNegatives in class ScorePosNeg

getCoveredPositives

public Set<Individual> getCoveredPositives()
Specified by:
getCoveredPositives in class ScorePosNeg

getNotCoveredPositives

public Set<Individual> getNotCoveredPositives()
Specified by:
getNotCoveredPositives in class ScorePosNeg

getNotCoveredNegatives

public Set<Individual> getNotCoveredNegatives()
Specified by:
getNotCoveredNegatives in class ScorePosNeg

getModifiedLengthScore

public ScorePosNeg getModifiedLengthScore(int newLength)
Description copied from class: ScorePosNeg
The score of a concept depends on how good it classifies the examples of a learning problem and the length of the concept itself. If a given concept is known to have equal classification properties than the concept this score object is based on, then this method can be used to calculate its score value by using the length of this concept as parameter.

Specified by:
getModifiedLengthScore in class ScorePosNeg
Parameters:
newLength - Length of the concept.
Returns:
Score.


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