MonotonicDecisionClassContainer
, StandardDecisionClassContainer
public abstract class DecisionClassContainer extends ApproximatedEntityContainer
Constructor | Description |
---|---|
DecisionClassContainer(MemoryContainer memoryContainer) |
Constructor for
DecisionClassContainer class.Stores given reference to memory container, calculates decision attribute's number, calculates all decision attribute's values and creates all decision classes stored within this container. The algorithm of determining decision attribute's number (index) is as follows: 1) if there is more than one active decision attribute without preference type assigned, then InvalidValueException is thrown,2) if there is exactly one active decision attribute without preference type assigned, then it is chosen, 3) if there is no active decision attribute without preference type assigned, then: 3a) if there is more than one active decision attribute with preference type assigned, then InvalidValueException is thrown,3b) if there is exactly one active decision attribute with preference type assigned, then it is chosen, 3c) if there is no active decision attribute with preference type assigned, then InvalidValueException is thrown.Found active decision attribute becomes the one for which this decision class container is defined. All other exceptions that may be thrown by this method come from protected validateMemoryContainer()
and validateDecisionAttributeNumber methods, which are called here. |
DecisionClassContainer(MemoryContainer memoryContainer,
int decisionAttributeNumber) |
Constructor for
DecisionClassContainer class.Stores given reference to memory container and decision attribute's number, calculates all decision attribute's values and creates all decision classes stored within this container. All exceptions that may be thrown by this method come from protected validate() method,
which is called here. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
Clones this decision class container
|
int |
getDecisionAttributeNumber() |
Gets number of considered decision attribute in memory container
|
Field[] |
getDecisionAttributeValues() |
Gets ascendingly ordered array of all decision attribute's values, which can be found in memory container.
|
DecisionClass |
getDecisionClass(Field value) |
Gets decision class that is based on the value passed as the parameter or
null if there is no such decision class |
DecisionClass[] |
getDecisionClasses() |
Gets array containing all decision classes which can be defined for memory container.
|
double |
getQualityOfApproximation(byte[] attributesMask) |
Gets quality of approximation of all decision classes which can be defined for memory container (decision table).
Uses given mask for attributes or considers all attributes if mask is null . |
double |
getQualityOfApproximation(double VCIRSAParameterValue,
byte[] attributesMask) |
Gets quality of approximation of all decision classes which can be defined for memory container.
|
void |
reset() |
Forces re-calculation of basic classes and re-creation or reset of all decision classes
(re-creation if decision attribute's values changed, reset when decision attribute's values remained unchanged).
|
java.lang.String |
toString() |
Creates a string with information about approximation quality and approximation
accuracy in the classes stored in the container.
|
getMemoryContainer, getQualityOfApproximation, getQualityOfApproximation
public DecisionClassContainer(MemoryContainer memoryContainer, int decisionAttributeNumber)
DecisionClassContainer
class.validate()
method,
which is called here.memoryContainer
- reference to memory container for which this decision class container is defineddecisionAttributeNumber
- number of decision attribute for which this decision class container is definedpublic DecisionClassContainer(MemoryContainer memoryContainer)
DecisionClassContainer
class.InvalidValueException
is thrown,InvalidValueException
is thrown,InvalidValueException
is thrown.validateMemoryContainer()
and validateDecisionAttributeNumber
methods, which are called here.memoryContainer
- reference to memory container for which this decision class container is definedInvalidValueException
- when number of active decision attribute cannot be determinedpublic void reset()
validate()
method and throws
appropriate exception if any irregularity has been found.validate()
method,
which is called here.public double getQualityOfApproximation(byte[] attributesMask)
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.getQualityOfApproximation(double, byte[])
method and passes the most restrictive VC-IRSA parameter value.getQualityOfApproximation
in class ApproximatedEntityContainer
attributesMask
- Mask for attributes allowing quality of approximation calculations for a subset
of active and condition attributes.
It is checked if length of the mask is equal to the number of attributes in memory container.
If attributesMask(i) is equal to zero, than corresponding attribute is not taken into account
at all when calculating quality of approximation. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating quality of approximation.InvalidValueException
- when length of the mask for attributes is different than number of attributes
in memory containerpublic double getQualityOfApproximation(double VCIRSAParameterValue, byte[] attributesMask)
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.getQualityOfApproximation
in class ApproximatedEntityContainer
VCIRSAParameterValue
- VC-IRSA parameter value for which boundaries of all decision classes should be calculated (VC-IRSA)attributesMask
- Mask for attributes allowing quality of approximation calculations for a subset
of active and condition attributes.
It is checked if length of the mask is equal to the number of attributes in memory container.
If attributesMask(i) is equal to zero, than corresponding attribute is not taken into account
at all when calculating quality of approximation. If attributesMask(i) is different than zero,
than corresponding attribute is taken into account when calculating quality of approximation.InvalidValueException
- when VC-IRSA parameter value is outside [0, 1] range
or when length of the mask for attributes is different than number of attributes in memory containerpublic int getDecisionAttributeNumber()
public Field[] getDecisionAttributeValues()
public DecisionClass[] getDecisionClasses()
public DecisionClass getDecisionClass(Field value)
null
if there is no such decision classvalue
- base value of required decision classpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class ApproximatedEntityContainer