PreferenceStructureExploiterWFNFSVirtualAllRulesDRSApublic class WFNFS extends java.lang.Object implements PreferenceStructureExploiter
| Modifier and Type | Field | Description |
|---|---|---|
static boolean |
throwExceptionWhenAllPossibleComprehensivePreferenceGradesAreNotStoredInRulesContainer |
Deprecated.
Tells if
NullPointerException should be thrown when rules' container from preference structure
passed as parameter in generateRanking(PreferenceStructure) method does not contain the list
of all possible values of decision attribute (RulesContainer.getClasses() method returns null). |
| Constructor | Description |
|---|---|
WFNFS(java.util.Hashtable<java.lang.Double,java.lang.Double> atLeastWeights,
java.util.Hashtable<java.lang.Double,java.lang.Double> atMostWeights,
int typeOfRules) |
Deprecated.
Constructor for
WFNFS class. |
| Modifier and Type | Method | Description |
|---|---|---|
Ranking |
generateRanking(PreferenceStructure preferenceStructure) |
Deprecated.
Generates ranking of objects for given preference structure.
|
boolean |
isCheckConfidence() |
Deprecated.
Tells whether confidence of covering rules is taken into account when calculating net flow score for an example
|
void |
setCheckConfidence(boolean checkConfidence) |
Deprecated.
Sets flag indicating whether confidence of covering rules should be taken into account
when calculating net flow score for an example
|
public static boolean throwExceptionWhenAllPossibleComprehensivePreferenceGradesAreNotStoredInRulesContainer
NullPointerException should be thrown when rules' container from preference structure
passed as parameter in generateRanking(PreferenceStructure) method does not contain the list
of all possible values of decision attribute (RulesContainer.getClasses() method returns null).
Values of decision attribute are treated as grades of comprehensive preference relation.
Initialized with true.public WFNFS(java.util.Hashtable<java.lang.Double,java.lang.Double> atLeastWeights,
java.util.Hashtable<java.lang.Double,java.lang.Double> atMostWeights,
int typeOfRules)
WFNFS class.
If atLeastWeights == null, it means that only at most rules should be used.
If atMostWeights == null, it means that only at least rules should be used.
If both hash tables of weights are null, then exception is thrown.
If only rules of one type (at least or at most) are considered, then rules' container
from preference structure given in generateRanking method may not contain rules of the other type.atLeastWeights - hash table with >= weights for different degrees of the intensity of comprehensive preference
of first example from pair of examples over second one. Double key denotes degree
of the intensity of comprehensive preference, while Double value is the weight associated with considered degree.atMostWeights - hash table with <= weights for different degrees of the intensity of comprehensive preference
of first example from pair of examples over second one. Double key denotes degree
of the intensity of comprehensive preference, while Double value is the weight associated with considered degree.typeOfRules - type of considered rules from rules container.
Can be Rule.CERTAIN or Rule.POSSIBLE.java.lang.NullPointerException - when both at least and at most weights are nullInvalidValueException - when hash table with at least or at most weights is not null but empty
or when type of considered rules is none of Rule.CERTAIN and Rule.POSSIBLEpublic Ranking generateRanking(PreferenceStructure preferenceStructure)
typeOfRules field set in constructor.
Assumes that each such rule has one SingleCondition decision (conclusion), with
FloatField reference value (grade of comprehensive preference relation).
Assumes that PCT stored in preference structure has at least all possible pairs of different objects.
Pairs of type (x, x) are not mandatory since they are not used by WFNFS exploitation procedure.
Assumes that preference structure's PCT has special description attribute (with index PCTDetector.getIndexOfPairOfExamplesNumbers()),
of type PairField and with inner type CardinalField. Values of that attribute are
numbers of objects (from information table) which constitute given PCT row.
If at least (at most) weights passed to class constructor were null,
then uses only "at most" ("at least") rules.preferenceStructure.getRulesContainer().getClasses() method returns null),
then checks value of throwExceptionWhenAllPossibleComprehensivePreferenceGradesAreNotStoredInRulesContainer flag.
If it is true, then throws NullPointerException.
Otherwise calculates possible grades of comprehensive preference relation directly from rules.
To achieve this goal, performs following operations:checkConfidence flag.
If false, then for each grade of comprehensive preference relation
it is checked only if there exist at least one rule that covers given example.
If true, then for each grade of comprehensive preference relation
all rules that cover given example are taken into account in order to calculate
maximal confidence value among these rules.generateRanking in interface PreferenceStructureExploiterpreferenceStructure - preference structure to be exploitedjava.lang.NullPointerException - when preference structure or its rules' container is nullValueNotFoundException - when at least rules should be used and rules' container stored in preference
structure does not contain certain / possible at least rules,
when at most rules should be used and rules' container stored in preference
structure does not contain certain / possible at most rules
or when there is no weight stored in this class for some at least / at most comprehensive preference degreeInvalidValueException - when list with certain / possible at least / at most rules stored in preference structure's rules container is empty
and that rules should be usedjava.lang.NullPointerException - when throwExceptionWhenAllPossibleComprehensivePreferenceGradesAreNotStoredInRulesContainer
flag is true and rules' container does not contain the list of all possible grades of comprehensive preferencepublic boolean isCheckConfidence()
true if confidence of covering rules is taken into account
when calculating net flow score for an example, false otherwisepublic void setCheckConfidence(boolean checkConfidence)
checkConfidence - value indicating whether confidence of covering rules should be taken into account
when calculating net flow score for an example