MonotonicDecisionClass
, StandardDecisionClass
public abstract class DecisionClass extends ApproximatedEntity
NONNEGATIVE_CONFIRMATION, POSITIVE_CONFIRMATION
Constructor | Description |
---|---|
DecisionClass(int decisionAttributeNumber,
Field basicClass,
MemoryContainer memoryContainer) |
Constructs decision class, using decision attribute with given number, given basic decision class and
given reference to memory container for which this decision class is defined.
|
DecisionClass(int decisionAttributeNumber,
Field basicClass,
MemoryContainer memoryContainer,
boolean oppositeSet) |
Constructs decision class, using decision attribute with given number, given basic decision class and
given reference to memory container for which this decision class is defined.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
Clones this decision class
|
boolean |
exampleBelongsToThisClass(int exampleNumber) |
Checks if example with given number belongs to this class.
|
int |
getDecisionAttributeNumber() |
Gets the number of decision attribute for which this decision class is defined
|
java.lang.String |
getDescription() |
Gets description of this decision class, showing its basic class.
|
java.util.HashSet<java.lang.Integer> |
getNEGRegionExamples(byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to negative (NEG) region of this class,
calculated for the most restrictive VC-IRSA parameter value (classical IRSA) and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getNEGRegionExamples(double VCIRSAParameterValue,
byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to negative (NEG) region of this class,
calculated for given VC-IRSA parameter value and for given mask for attributes, according to used VC-IRSA. |
boolean |
isOppositeSet() |
Tells whether the entity to approximate is the opposite of the class identified by
basicClass . |
void |
reset() |
Resets all results of calculations stored in this class and causes that each first call to any 'get'
method retrieving any approximation, boundary, quality of approximation or accuracy of approximation
will be connected with additional (re)calculations.
|
containsExample, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getBasicClass, getBNDRegionExamples, getBNDRegionExamples, getBNDRegionExamples, getBNDRegionExamples, getBoundary, getBoundary, getBoundary, getBoundary, getCharacteristicDecisionClass, getExamples, getExamplesSet, getInconsistentExamplesForExtendedLowerApproximation, getInconsistentExamplesForExtendedLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getMemoryContainer, getNEGRegionExamples, getNEGRegionExamples, getNeutralExamples, getNeutralExamplesSet, getPOSRegionExamples, getPOSRegionExamples, getPOSRegionExamples, getPOSRegionExamples, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getTheMostRestrictiveVariableConsistencyParameterValue, getUpperApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, setBoundary, setLowerApproximation, setUpperApproximation, size, variableConsistencyParameterValueIsTheMostRestrictiveOne
public DecisionClass(int decisionAttributeNumber, Field basicClass, MemoryContainer memoryContainer)
decisionAttributeNumber
- number of decision attribute for which this decision class is defined.
It is checked if attribute with given number is really decision and active one,
if it has preference type assigned and if its default value is similar to basicClass
.basicClass
- value of considered decision attribute.
Given basic class is duplicated and reference to
the copy is stored in this decision class.memoryContainer
- reference to memory container for which this decision class is definedjava.lang.NullPointerException
- see validate()
InvalidValueException
- see validate()
java.lang.IndexOutOfBoundsException
- see validate()
InvalidTypeException
- see validate()
ValueNotFoundException
- see validate()
public DecisionClass(int decisionAttributeNumber, Field basicClass, MemoryContainer memoryContainer, boolean oppositeSet)
decisionAttributeNumber
- number of decision attribute for which this decision class is defined.
It is checked if attribute with given number is really decision and active one,
if it has preference type assigned and if its default value is similar to basicClass
.basicClass
- value of considered decision attribute.
Given basic class is duplicated and reference to
the copy is stored in this decision class.memoryContainer
- reference to memory container for which this decision class is definedoppositeSet
- flag indicating whether the entity to approximate is the opposite of the class identified by basicClass
java.lang.NullPointerException
- see validate()
InvalidValueException
- see validate()
java.lang.IndexOutOfBoundsException
- see validate()
InvalidTypeException
- see validate()
ValueNotFoundException
- see validate()
public int getDecisionAttributeNumber()
getDecisionAttributeNumber
in class ApproximatedEntity
public boolean exampleBelongsToThisClass(int exampleNumber)
MemoryContainer
for which the decision class is defined.exampleNumber
- number of example which should be checkedtrue
if example with given number belongs to this class, false
otherwisepublic java.util.HashSet<java.lang.Integer> getNEGRegionExamples(byte[] attributesMask)
Integer
) numbers of examples belonging to negative (NEG) region of this class,
calculated for the most restrictive VC-IRSA parameter value (classical IRSA) and for given mask for attributes.
Returns examples belonging to POS region of the complement of this decision class.null
.
If attributesMask(i) = 0 then corresponding attribute should be ignored.
Any non-zero value means that corresponding attribute should be considered.
In fact only mask values corresponding to active and conditional attributes are important.
All other values are not taken into account and may be any.getNEGRegionExamples
in class ApproximatedEntity
attributesMask
- mask for attributes allowing negative region calculations for a subset
of active and conditional attributes.
It is checked if length of the mask is equal to the quantity of attributes in memory container.
If attributesMask(i) is equal to zero, than corresponding attribute is not taken into account
at all when calculating negative region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating negative region.Integer
) numbers of examples belonging to negative (NEG) region of this class,
calculated for given mask for attributesInvalidValueException
- when length of the mask for attributes is different than quantity of attributes in memory containerpublic java.util.HashSet<java.lang.Integer> getNEGRegionExamples(double VCIRSAParameterValue, byte[] attributesMask)
Integer
) numbers of examples belonging to negative (NEG) region of this class,
calculated for given VC-IRSA parameter value and for given mask for attributes, according to used VC-IRSA.
Since POS regions of different decision classes may overlap,
NEG region of the considered decision class Cl is a set difference between POS region of the complement of Cl
and POS region of Cl.
null
.
If attributesMask(i) = 0 then corresponding attribute should be ignored.
Any non-zero value means that corresponding attribute should be considered.
In fact only mask values corresponding to active and conditional attributes are important.
All other values are not taken into account and may be any.getNEGRegionExamples
in class ApproximatedEntity
VCIRSAParameterValue
- VC-IRSA parameter value for which NEG region should be calculated (according to used VC-IRSA)attributesMask
- mask for attributes allowing negative region calculations for a subset
of active and conditional attributes.
It is checked if length of the mask is equal to the quantity of attributes in memory container.
If attributesMask(i) is equal to zero, than corresponding attribute is not taken into account
at all when calculating negative region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating negative region.Integer
) numbers of examples belonging to negative (NEG) region of this class,
calculated for given value of VC-IRSA parameter and for given mask for attributesInvalidValueException
- when VC-IRSA parameter value is outside [0, 1] range
or when length of the mask for attributes is different than quantity of attributes in memory containerpublic void reset()
validate
method and throws
appropriate exception if any irregularity has been found.validate
method,
which is called here.java.lang.NullPointerException
- when memory container is null
InvalidValueException
- when memory container contains no attributes or no examples,
when attribute with given number is not active or not decision,
when basic class is incorrect - it does not appear in any example from memory container (decision class would be empty)
or when this decision class contains all examples from memory containerjava.lang.IndexOutOfBoundsException
- when decision attribute number is too small or too big
for given memory containerInvalidTypeException
- when types of decision attribute and basic class are differentValueNotFoundException
- when no active condition attribute of type SimpleField
,
PairField
or SimilarityField
has been found in memory containerpublic boolean isOppositeSet()
basicClass
.true
if the entity to approximate is the opposite of the class identified by basicClass
,
false
otherwisepublic java.lang.String getDescription()
= 3
".getDescription
in class ApproximatedEntity
public java.lang.Object clone()
clone
in class ApproximatedEntity