public class PairDecisionMonotonicUnion extends MonotonicUnion
NONNEGATIVE_CONFIRMATION, POSITIVE_CONFIRMATION
DEFAULT_MEASURE, EPSILON, EPSILON_PRIM, EPSILON_STAR
Constructor | Description |
---|---|
PairDecisionMonotonicUnion(int type,
int decisionCriterionNumber,
Field basicClass,
MemoryContainer memoryContainer) |
Constructs union of given type, using decision criterion with given number, given basic decision class and
given reference to memory container for which this union is defined.
|
Modifier and Type | Method | Description |
---|---|---|
Field |
calculateAdjacentDecisionClass(int direction) |
Calculates decision class adjacent to this union's basic class.
|
static PairField |
calculateLeftOppositeUnionBasicClass(Field basicClass,
int type) |
|
static PairField |
calculateRightOppositeUnionBasicClass(Field basicClass,
int type) |
|
java.lang.Object |
clone() |
Clones this monotonic union
|
java.util.HashSet<java.lang.Integer> |
getBNDRegionExamples(byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to boundary (BND) region of this entity,
calculated for the most restrictive variable consistency parameter value (IRSA / DRSA) and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getBNDRegionExamples(double variableConsistencyParameterValue,
byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to boundary (BND) region of this entity,
calculated for given variable consistency parameter value (VC-IRSA / VC-DRSA) and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getNEGRegionExamples(byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to negative (NEG) region of this union,
calculated for the most restrictive VC-DRSA parameter value (classical DRSA) and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getNEGRegionExamples(double VCDRSAParameterValue,
byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to negative (NEG) region of this union,
calculated for given VC-DRSA parameter value and for given mask for attributes, according to used VC-DRSA. |
int[] |
getNeutralExamples() |
Gets numbers of examples neutral to this entity (i.e., neither belonging to this entity, nor not belonging to this entity).
Because of efficiency, reference to the field of this class, not its copy, is returned. |
java.util.HashSet<java.lang.Integer> |
getNeutralExamplesSet() |
Gets hash set with numbers of all examples neutral to this entity (i.e., neither belonging to this entity, nor not belonging to this entity).
|
java.util.HashSet<java.lang.Integer> |
getPOSRegionExamples(byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to positive (POS) region of this entity,
calculated for the most restrictive variable consistency parameter value (IRSA / DRSA) and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getPOSRegionExamples(double variableConsistencyParameterValue,
byte[] attributesMask) |
Gets hash set with (
Integer ) numbers of examples belonging to positive (POS) region of this entity,
calculated for given variable consistency parameter value (VC-IRSA / VC-DRSA) and for given mask for attributes. |
int[] |
getUpperApproximation(double VCDRSAParameterValue,
Union oppositeUnionForShiftedBasicClass,
byte[] attributesMask) |
Gets numbers of examples belonging to upper approximation of this union.
|
void |
reset() |
Resets all results of calculations stored in this union 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.
|
void |
setBoundary(int[] boundary,
double boundaryVCParameterValue,
byte[] boundaryAttributesMask,
int boundaryPairFieldDominanceCheckMethod,
int boundaryMeasure) |
Sets boundary of this union and all parameters describing conditions under which this boundary has been calculated
|
void |
setLowerApproximation(int[] lowerApproximation,
double lowerApproximationVCParameterValue,
byte[] lowerApproximationAttributesMask,
int lowerApproximationPairFieldDominanceCheckMethod,
int lowerApproximationMeasure) |
Sets lower approximation of this union and all parameters describing conditions under which this approximation has been calculated
|
static void |
setMeasure(int measure) |
Sets measure used to calculate approximations and boundary of this monotonic union.
|
void |
setUpperApproximation(int[] upperApproximation,
double upperApproximationVCParameterValue,
byte[] upperApproximationAttributesMask,
int upperApproximationPairFieldDominanceCheckMethod,
int upperApproximationMeasure) |
Sets upper approximation of this union and all parameters describing conditions under which this approximation has been calculated
|
containsExample, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getBasicClass, getBNDRegionExamples, getBNDRegionExamples, getBoundary, getBoundary, getBoundary, getBoundary, getCharacteristicDecisionClass, getExamples, getExamplesSet, getInconsistentExamplesForExtendedLowerApproximation, getInconsistentExamplesForExtendedLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getMemoryContainer, getNEGRegionExamples, getNEGRegionExamples, getPOSRegionExamples, getPOSRegionExamples, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, setBoundary, setLowerApproximation, setUpperApproximation, size
getMeasure, getTheMostRestrictiveVariableConsistencyParameterValue, resetMeasure, variableConsistencyParameterValueIsTheMostRestrictiveOne
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exampleBelongsToThisUnion, getBasicClassForAdjacentOppositeUnion, getDecisionAttributeNumber, getDecisionCriterionNumber, getDescription, getType, getUpperApproximation, getUpperApproximation, getUpperApproximation, setBoundary, setLowerApproximation, setUpperApproximation
public PairDecisionMonotonicUnion(int type, int decisionCriterionNumber, Field basicClass, MemoryContainer memoryContainer)
type
- see Union(int, int, Field, MemoryContainer)
decisionCriterionNumber
- see Union(int, int, Field, MemoryContainer)
basicClass
- see Union(int, int, Field, MemoryContainer)
memoryContainer
- see Union(int, int, Field, MemoryContainer)
java.lang.NullPointerException
- see Union(int, int, Field, MemoryContainer)
InvalidValueException
- see Union(int, int, Field, MemoryContainer)
java.lang.IndexOutOfBoundsException
- see Union(int, int, Field, MemoryContainer)
InvalidTypeException
- see Union(int, int, Field, MemoryContainer)
ValueNotFoundException
- see Union(int, int, Field, MemoryContainer)
public static void setMeasure(int measure)
MonotonicUnion.EPSILON
or MonotonicUnion.EPSILON_PRIM
. Note that MonotonicUnion.EPSILON_STAR
measure is not defined.measure
- measure used to calculate approximations and boundary of this monotonic unionInvalidValueException
- when given measure is none of MonotonicUnion.EPSILON
and MonotonicUnion.EPSILON_PRIM
public java.util.HashSet<java.lang.Integer> getNEGRegionExamples(byte[] attributesMask)
Integer
) numbers of examples belonging to negative (NEG) region of this union,
calculated for the most restrictive VC-DRSA parameter value (classical DRSA) and for given mask for attributes.
Returns examples belonging to POS region of the opposite union
(e.g. for union "at least 3" opposite union is "at most 2").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 condition attributes are important.
All other values are not taken into account and may be any.getNEGRegionExamples
in class Union
attributesMask
- mask for attributes allowing negative region calculations for a subset
of active and condition 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 union,
calculated for given mask for attributesInvalidValueException
- when length of the mask for attributes is different than quantity of attributes in memory containerpublic static PairField calculateLeftOppositeUnionBasicClass(Field basicClass, int type)
public static PairField calculateRightOppositeUnionBasicClass(Field basicClass, int type)
public java.util.HashSet<java.lang.Integer> getNEGRegionExamples(double VCDRSAParameterValue, byte[] attributesMask)
Integer
) numbers of examples belonging to negative (NEG) region of this union,
calculated for given VC-DRSA parameter value and for given mask for attributes, according to used VC-DRSA.
Because POS regions may overlap, NEG region consists of those examples belonging to
POS region of the opposite union of decision classes (e.g. for union "at least 3" opposite union is "at most 2"),
which are not in POS region of considered union at the same time.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 condition attributes are important.
All other values are not taken into account and may be any.getNEGRegionExamples
in class Union
VCDRSAParameterValue
- VC-DRSA parameter value for which NEG region should be calculated (according to used VC-DRSA)attributesMask
- mask for attributes allowing negative region calculations for a subset
of active and condition 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 union,
calculated for given value of VC-DRSA parameter and for given mask for attributesInvalidValueException
- when VC-DRSA parameter value is outside [0, 1] range
or when length of the mask for attributes is different than quantity of attributes in memory containerpublic java.util.HashSet<java.lang.Integer> getPOSRegionExamples(double variableConsistencyParameterValue, byte[] attributesMask)
Integer
) numbers of examples belonging to positive (POS) region of this entity,
calculated for given variable consistency parameter value (VC-IRSA / VC-DRSA) and for given mask for attributes.
Returned set is a sum of two sets.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 condition attributes are important.
All other values are not taken into account and may be any.getPOSRegionExamples
in class ApproximatedEntity
variableConsistencyParameterValue
- variable consistency parameter value for which POS region should be calculated (VC-IRSA / VC-DRSA)attributesMask
- Mask for attributes allowing positive region calculations for a subset
of active and condition 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 positive region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating positive region.Integer
) numbers of examples belonging to positive (POS) region of this entity,
calculated for given variable consistency parameter value and for given mask for attributesInvalidValueException
- when given variable consistency parameter value is outside [0, 1] range
or when length of the mask for attributes is different than quantity of attributes in memory containerpublic java.util.HashSet<java.lang.Integer> getPOSRegionExamples(byte[] attributesMask)
Integer
) numbers of examples belonging to positive (POS) region of this entity,
calculated for the most restrictive variable consistency parameter value (IRSA / DRSA) and for given mask for attributes.
This method returns examples belonging to lower approximation of this entity,
calculated for the most restrictive variable consistency parameter value and for given mask for attributes.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 condition attributes are important.
All other values are not taken into account and may be any.getPOSRegionExamples
in class ApproximatedEntity
attributesMask
- Mask for attributes allowing positive region calculations for a subset
of active and condition 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 positive region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating positive region.Integer
) numbers of examples belonging to positive (POS) region of this entity,
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> getBNDRegionExamples(byte[] attributesMask)
Integer
) numbers of examples belonging to boundary (BND) region of this entity,
calculated for the most restrictive variable consistency parameter value (IRSA / DRSA) and for given mask for attributes.
In case of IRSA and DRSA, this method returns examples belonging to boundary
of this entity, defined for given mask for attributes.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 condition attributes are important.
All other values are not taken into account and may be any.getBNDRegionExamples
in class ApproximatedEntity
attributesMask
- Mask for attributes allowing boundary region calculations for a subset
of active and condition 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 boundary region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating boundary region.Integer
) numbers of examples belonging to boundary (BND) region of this entity,
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> getBNDRegionExamples(double variableConsistencyParameterValue, byte[] attributesMask)
Integer
) numbers of examples belonging to boundary (BND) region of this entity,
calculated for given variable consistency parameter value (VC-IRSA / VC-DRSA) and for given mask for attributes.
Returns the complement of POS + NEG regions of considered entity.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 condition attributes are important.
All other values are not taken into account and may be any.getBNDRegionExamples
in class ApproximatedEntity
variableConsistencyParameterValue
- variable consistency parameter value for which BND region should be calculated (VC-IRSA / VC-DRSA)attributesMask
- Mask for attributes allowing boundary region calculations for a subset
of active and condition 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 boundary region. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating boundary region.Integer
) numbers of examples belonging to boundary (BND) region of this entity,
calculated for given variable consistency parameter value and for given mask for attributesInvalidValueException
- when variable consistency 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.reset
in class MonotonicUnion
public void setLowerApproximation(int[] lowerApproximation, double lowerApproximationVCParameterValue, byte[] lowerApproximationAttributesMask, int lowerApproximationPairFieldDominanceCheckMethod, int lowerApproximationMeasure)
setLowerApproximation
in class MonotonicUnion
lowerApproximation
- array with numbers of objects from memory container which belong to lower approximation of this unionlowerApproximationVCParameterValue
- VC-DRSA parameter value for which given lower approximation has been calculated (VC-DRSA)lowerApproximationAttributesMask
- mask for attributes allowing lower approximation 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 has not been taken into account
at all when calculating lower approximation. If attributesMask(i) is different than zero,
than corresponding attribute has been taken into account when calculating lower approximation.lowerApproximationPairFieldDominanceCheckMethod
- dominance check method for attributes of type PairField
,
which has been used to calculate given lower approximation. Should be either PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
or PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
.lowerApproximationMeasure
- measure used to calculate lower approximation of this monotonic union. Should be either
MonotonicUnion.EPSILON
or MonotonicUnion.EPSILON_PRIM
.InvalidValueException
- when lower approximation measure is none of MonotonicUnion.EPSILON
and MonotonicUnion.EPSILON_PRIM
,
when VC-DRSA parameter value is outside [0, 1] range,
when length of the mask for attributes is different than quantity of attributes in memory container
or when lowerApproximationPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
public void setUpperApproximation(int[] upperApproximation, double upperApproximationVCParameterValue, byte[] upperApproximationAttributesMask, int upperApproximationPairFieldDominanceCheckMethod, int upperApproximationMeasure)
setUpperApproximation
in class MonotonicUnion
upperApproximation
- array with numbers of objects from memory container which belong to upper approximation of this unionupperApproximationVCParameterValue
- VC-DRSA parameter value for which given upper approximation has been calculated (VC-DRSA)upperApproximationAttributesMask
- mask for attributes allowing upper approximation 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 has not been taken into account
at all when calculating upper approximation. If attributesMask(i) is different than zero,
than corresponding attribute has been taken into account when calculating upper approximation.upperApproximationPairFieldDominanceCheckMethod
- dominance check method for attributes of type PairField
,
which has been used to calculate given upper approximation. Should be either PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
or PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
.upperApproximationMeasure
- measure used to calculate upper approximation of this monotonic union. Should be either
MonotonicUnion.EPSILON
or MonotonicUnion.EPSILON_PRIM
.InvalidValueException
- when upper approximation measure is none of MonotonicUnion.EPSILON
and MonotonicUnion.EPSILON_PRIM
,
when VC-DRSA parameter value is outside [0, 1] range,
when length of the mask for attributes is different than quantity of attributes in memory container
or when upperApproximationPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
public void setBoundary(int[] boundary, double boundaryVCParameterValue, byte[] boundaryAttributesMask, int boundaryPairFieldDominanceCheckMethod, int boundaryMeasure)
setBoundary
in class MonotonicUnion
boundary
- array with numbers of objects from memory container which belong to boundary of this unionboundaryVCParameterValue
- VC-DRSA parameter value for which given boundary has been calculated (VC-DRSA)boundaryAttributesMask
- mask for attributes allowing boundary 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 has not been taken into account
at all when calculating boundary. If attributesMask(i) is different than zero,
than corresponding attribute has been taken into account when calculating boundary.boundaryPairFieldDominanceCheckMethod
- dominance check method for attributes of type PairField
,
which has been used to calculate given boundary. Should be either PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
or PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
.boundaryMeasure
- measure used to calculate boundary of this monotonic union. Should be either
MonotonicUnion.EPSILON
or MonotonicUnion.EPSILON_PRIM
.InvalidValueException
- when boundary measure is none of MonotonicUnion.EPSILON
and MonotonicUnion.EPSILON_PRIM
,
when VC-DRSA parameter value is outside [0, 1] range,
when length of the mask for attributes is different than quantity of attributes in memory container
or when boundaryPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
public java.util.HashSet<java.lang.Integer> getNeutralExamplesSet()
null
should be returned!getNeutralExamplesSet
in class ApproximatedEntity
public int[] getNeutralExamples()
null
should be returned!getNeutralExamples
in class ApproximatedEntity
public Field calculateAdjacentDecisionClass(int direction)
direction
- when 1, then calculated class is better (more preferred) than this union's basic classInvalidValueException
- when direction is not -1 nor 1
or when there is no adjacent decision class in given direction
(which will not happen if this union type is ASCENDING
and direction
is -1
or if this union is DESCENDING
and direction is 1
)public int[] getUpperApproximation(double VCDRSAParameterValue, Union oppositeUnionForShiftedBasicClass, byte[] attributesMask)
Union
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 condition attributes are important.
All other values are not taken into account and may be any.getUpperApproximation(double, byte[])
method is that when lower approximation
(for the same VC-DRSA parameter value, for used VC-DRSA calculation method and for the same mask for attributes)
for given opposite union with basic class different about one
was calculated first (and thus automatically stored in the opposite union), this method is much faster.getUpperApproximation
in class Union
VCDRSAParameterValue
- VC-DRSA parameter value for which upper approximation should be calculated (VC-DRSA)oppositeUnionForShiftedBasicClass
- reference to opposite union, defined for the same memory container
and the same decision criterion number and created for basic class different about 1.
For example if this union is ASCENDING
and its basicClass
is equal to 3,
then opposite union must be DESCENDING
with basicClass
equal to 2.
And if this union is DESCENDING
with basicClass
equal to 6,
then opposite union must be ASCENDING
with basicClass
equal to 7.
Opposite union reference is used only to get lower approximation of given union,
for given value of VC-DRSA parameter and for given mask for attributes.
Upper approximation of this union is then calculated as the difference between all examples
from memory container and lower approximation of the opposite union with basic class different about one.attributesMask
- mask for attributes allowing upper approximation calculations for a subset
of active and condition 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 upper approximation. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating upper approximation.public java.lang.Object clone()
clone
in class MonotonicUnion