StandardJmafUnion
public class StandardUnion extends Union
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_VC_DRSA_CALCULATION_METHOD |
Default VC-DRSA calculation method (default approach).
|
static int |
NEW_VC_DRSA_CALCULATION_METHOD |
Possible value of
VCDRSACalculationMethod field,
used when new approach to VC-DRSA should be used |
static int |
OLD_VC_DRSA_CALCULATION_METHOD |
Possible value of
VCDRSACalculationMethod field,
used when old approach to VC-DRSA should be used |
NONNEGATIVE_CONFIRMATION, POSITIVE_CONFIRMATION
Constructor | Description |
---|---|
StandardUnion(int type,
int decisionCriterionNumber,
Field basicClass,
MemoryContainer memoryContainer) |
Constructor for
StandardUnion class. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
Clones this standard union
|
java.util.HashSet<java.lang.Integer> |
getBNDRegionExamples(double consistencyLevelThreshold,
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> |
getInconsistentExamplesForExtendedLowerApproximation(double consistencyLevelThreshold,
byte[] attributesMask) |
Gets hash set of (
Integer ) numbers of negative examples which are inconsistent with (among) examples from
extended lower approximation of this entity, calculated for given variable consistency parameter value (variable consistency approach)
and for given mask for attributes. |
java.util.HashSet<java.lang.Integer> |
getNEGRegionExamples(double consistencyLevelThreshold,
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. |
java.util.HashSet<java.lang.Integer> |
getPOSRegionExamples(double consistencyLevelThreshold,
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. |
double |
getTheMostRestrictiveVariableConsistencyParameterValue() |
Gets the most restrictive value of used variable consistency parameter
|
static int |
getVCDRSACalculationMethod() |
Gets current VC-DRSA calculation method.
|
static void |
resetVCDRSACalculationMethod() |
Restores default VC-DRSA calculation method
|
void |
setBoundary(int[] boundary,
double boundaryVCParameterValue,
byte[] boundaryAttributesMask,
int boundaryPairFieldDominanceCheckMethod,
int boundaryVCDRSACalculationMethod) |
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 lowerApproximationVCDRSACalculationMethod) |
Sets lower approximation of this union and all parameters describing conditions under which this approximation has been calculated
|
void |
setUpperApproximation(int[] upperApproximation,
double upperApproximationVCParameterValue,
byte[] upperApproximationAttributesMask,
int upperApproximationPairFieldDominanceCheckMethod,
int upperApproximationVCDRSACalculationMethod) |
Sets upper approximation of this union and all parameters describing conditions under which this approximation has been calculated
|
static void |
setVCDRSACalculationMethod(int VCDRSACalculationMethod) |
Sets VC-DRSA calculation method.
|
boolean |
variableConsistencyParameterValueIsTheMostRestrictiveOne(double consistencyLevelThreshold) |
Tells if given variable consistency parameter value is the most restrictive one.
|
containsExample, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getAccuracyOfApproximation, getBasicClass, getBNDRegionExamples, getBNDRegionExamples, getBNDRegionExamples, getBoundary, getBoundary, getBoundary, getBoundary, getCharacteristicDecisionClass, getExamples, getExamplesSet, getInconsistentExamplesForExtendedLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getLowerApproximation, getMemoryContainer, getNEGRegionExamples, getNEGRegionExamples, getNeutralExamples, getNeutralExamplesSet, getPOSRegionExamples, getPOSRegionExamples, getPOSRegionExamples, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getQualityOfApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, setBoundary, setLowerApproximation, setUpperApproximation, size
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exampleBelongsToThisUnion, getBasicClassForAdjacentOppositeUnion, getDecisionAttributeNumber, getDecisionCriterionNumber, getDescription, getNEGRegionExamples, getType, getUpperApproximation, getUpperApproximation, getUpperApproximation, getUpperApproximation, reset, setBoundary, setLowerApproximation, setUpperApproximation
public static final int NEW_VC_DRSA_CALCULATION_METHOD
VCDRSACalculationMethod
field,
used when new approach to VC-DRSA should be usedpublic static final int OLD_VC_DRSA_CALCULATION_METHOD
VCDRSACalculationMethod
field,
used when old approach to VC-DRSA should be usedpublic static final int DEFAULT_VC_DRSA_CALCULATION_METHOD
NEW_VC_DRSA_CALCULATION_METHOD
value.public StandardUnion(int type, int decisionCriterionNumber, Field basicClass, MemoryContainer memoryContainer)
StandardUnion
class.
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.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 setVCDRSACalculationMethod(int VCDRSACalculationMethod)
NEW_VC_DRSA_CALCULATION_METHOD
or OLD_VC_DRSA_CALCULATION_METHOD
.
SIC! By modifying class variable this method affects all subsequent VC-approximations calculations
performed by StandardUnion
instances.
To restore default VC-DRSA calculation method at any time, call resetVCDRSACalculationMethod
method.VCDRSACalculationMethod
- new VC-DRSA calculation methodInvalidValueException
- when VCDRSACalculationMethod
is not
NEW_VC_DRSA_CALCULATION_METHOD
nor OLD_VC_DRSA_CALCULATION_METHOD
public static void resetVCDRSACalculationMethod()
public static int getVCDRSACalculationMethod()
NEW_VC_DRSA_CALCULATION_METHOD
or OLD_VC_DRSA_CALCULATION_METHOD
.public java.util.HashSet<java.lang.Integer> getInconsistentExamplesForExtendedLowerApproximation(double consistencyLevelThreshold, byte[] attributesMask)
Integer
) numbers of negative examples which are inconsistent with (among) examples from
extended lower approximation of this entity, calculated for given variable consistency parameter value (variable consistency approach)
and for given mask for attributes.
For example in case of upward union of decision classes, inconsistent examples are those, which dominate
examples from extended lower approximation but do not belong to the considered union.
In case of downward union of decision classes, inconsistent examples are those, which are dominated by
examples from extended lower approximation but do not belong to the considered union.
For single decision class, inconsistent examples are those, which are indiscernible with examples from the extended lower approximation
but they do not belong to the considered single 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 condition attributes are important.
All other values are not taken into account and may be any.getInconsistentExamplesForExtendedLowerApproximation
in class ApproximatedEntity
consistencyLevelThreshold
- variable consistency parameter value for which extended lower approximation should be calculated (VC-IRSA / VC-DRSA)attributesMask
- Mask for attributes allowing extended lower 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 lower approximation. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating extended lower approximation.Integer
) numbers of negative examples which are inconsistent with (among) examples from
extended lower approximation 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 container
or when consistency level threshold is less than 1 and old VC-DRSA should be used for calculations of extended lower approximations
(StandardUnion.getVCDRSACalculationMethod() == StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
)public java.util.HashSet<java.lang.Integer> getPOSRegionExamples(double consistencyLevelThreshold, 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
consistencyLevelThreshold
- 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 container
or when consistency level threshold is less than 1 and old VC-DRSA should be used for calculations of extended lower approximations
(StandardUnion.getVCDRSACalculationMethod() == StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
)public java.util.HashSet<java.lang.Integer> getNEGRegionExamples(double consistencyLevelThreshold, 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
consistencyLevelThreshold
- 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 container
or when consistency level threshold is less than 1 and old VC-DRSA should be used for calculations of extended lower approximations
(StandardUnion.getVCDRSACalculationMethod() == StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
)public java.util.HashSet<java.lang.Integer> getBNDRegionExamples(double consistencyLevelThreshold, 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
consistencyLevelThreshold
- 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 container
or when consistency level threshold is less than 1 and old VC-DRSA should be used for calculations of extended lower approximations
(StandardUnion.getVCDRSACalculationMethod() == StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
)public boolean variableConsistencyParameterValueIsTheMostRestrictiveOne(double consistencyLevelThreshold)
1.0
.variableConsistencyParameterValueIsTheMostRestrictiveOne
in class ApproximatedEntity
consistencyLevelThreshold
- variable consistency parameter value to be checkedtrue
if given consistency level threshold has the most restrictive value 1.0
, false otherwisepublic double getTheMostRestrictiveVariableConsistencyParameterValue()
getTheMostRestrictiveVariableConsistencyParameterValue
in class ApproximatedEntity
public void setLowerApproximation(int[] lowerApproximation, double lowerApproximationVCParameterValue, byte[] lowerApproximationAttributesMask, int lowerApproximationPairFieldDominanceCheckMethod, int lowerApproximationVCDRSACalculationMethod)
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
.lowerApproximationVCDRSACalculationMethod
- lower approximation VC-DRSA calculation method. Should be either StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
or StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
.InvalidValueException
- 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,
when lowerApproximationPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
or when lowerApproximationVCDRSACalculationMethod
is neither StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
nor
StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
public void setUpperApproximation(int[] upperApproximation, double upperApproximationVCParameterValue, byte[] upperApproximationAttributesMask, int upperApproximationPairFieldDominanceCheckMethod, int upperApproximationVCDRSACalculationMethod)
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
.upperApproximationVCDRSACalculationMethod
- upper approximation VC-DRSA calculation method. Should be either StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
or StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
.InvalidValueException
- 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,
when upperApproximationPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
or when upperApproximationVCDRSACalculationMethod
is neither StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
nor
StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
public void setBoundary(int[] boundary, double boundaryVCParameterValue, byte[] boundaryAttributesMask, int boundaryPairFieldDominanceCheckMethod, int boundaryVCDRSACalculationMethod)
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
.boundaryVCDRSACalculationMethod
- boundary VC-DRSA calculation method. Should be either StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
or StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD
.InvalidValueException
- 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,
when boundaryPairFieldDominanceCheckMethod
is neither
PairField.STRICT_ORDINAL_DOMINANCE_CHECK_METHOD
nor PairField.CLASSIC_ORDINAL_DOMINANCE_CHECK_METHOD
or when boundaryVCDRSACalculationMethod
is neither StandardUnion.NEW_VC_DRSA_CALCULATION_METHOD
nor
StandardUnion.OLD_VC_DRSA_CALCULATION_METHOD