Java Reference
In-Depth Information
Table 9-19
Association-related interfaces (continued)
Methods
Description
getConfidence(): double
Returns the confidence for the given association rule as the
total number of transactions with antecedent and conse-
quent divided by the number of transactions with the ante-
cedent as a percentage. The percentage is a number between
0 and 100, denoted as (0,100] where 100 is included.
getLift(): double
Returns the lift for the given association rule defined as the
number of transactions with the confidence of the rule
divided by the number of transactions with the consequent.
getLength(): int
Returns the number of items in the rule, which includes
both antecedent and consequent itemsets.
association.RuleFilter
Methods
Description
set/getItems(Object[] itemArray,
RuleComponentOption
componentOption, boolean included)
Used to set/get the items to be included in the specified com-
ponent of the rules to be selected.
set/getMaxNumberOfRules
(int maxRules)
Used to set/get the maximum number of rules for the result.
set/getOrderingCondition
(RuleProperty[] orderByArray,
SortOrder[] sortOrderArray)
Used to set/get the ordering condition for the rules after
they are filtered.
set/getRange(RuleProperty type,
double minValue, double maxValue)
Used to set/get the range of the specified rule property. Rule
property can be antecedent, consequent or both.
set/getThreshold
(RuleProperty property,
ComparisonOperator compOp,
double thresholdValue)
Used to set/get the threshold value with a comparison opera-
tor. Rule property can be antecedent, consequent or both.
ComparisonOperator enumerates various operators, such as
=, <, >, <=, >=, ! = etc .
set/getOrderingCondition
(RuleProperty[] orderByArray,
SortOrder[] sortOrderArray)
Used to set/get the ordering condition for the rules after
they are filtered.
Listing 9-16 shows the building of an association model that finds
the products that are sold together based on customer purchase data.
Lines 27 to 35 show the creation of a physical dataset object using a
transactional format table. Lines 37 to 41 show the creation of associ-
ation settings that specify the minimum support, confidence, maxi-
mum length, and maximum number of rules. Lines 49 to 61 show the
execution of the build task, which is similar to other models. Lines 67
Search WWH ::




Custom Search