# C-MWCAR: Classification Based on Multiple Weighted Class Association Rules
## 3 Materials and Methods
### Formalization of Basic Associative Classifier  
In this section, the basic concepts of associative classifiers are formalized. For CARs-based classifiers, the dataset is usually organized as a relational table. Let \(D=\{d_{1}\),..., \(d_{i}\),..., \(d_{N}\}\) be the dataset, which contains \(N\) instances and each of them is described by \(k-1\) features. Let \(Y=\{y_{1}\),...,\(y_{i}\),..., \(y_{M}\}\) be a finite set of class labels which contains \(M\) known classes. Each instance in \(D\) has been labeled with one class of \(Y\). To simplify the narration, we treat the class label as a special feature; thus, each instance has \(k\) features. These \(k\) features can be discrete or continuous, but they should be adjusted into uniform formats before mining CARs. For a discrete feature, its possible values are directly mapped to consecutive numbers. For a continuous feature, its value range is first discretized into several intervals which are then mapped to consecutive numbers. For example, assume that an instance is characterized by three features (i.e., feature \(A\) and \(B\), and class \(C\)) and that \(A\) and \(B\) are discretized into four and three intervals, respectively, while \(C\) contains two class labels. In this case, the intervals of \(A\) and \(B\) and the class labels of \(C\) can be orderly mapped to numbers 1 to 4, 1 to 3, and 1 to 2, respectively. Based on the discretization and mappings, an instance can be represented as a set of <_feature_, _value_> pairs, where the _feature_ refers to the feature's name like A, B, or C, while the _value_ refers to the corresponding number. In particular, each pair is called an _item_. Let \(I=\{item_{1}\),..., \(item_{i}\),..., \(item_{L}\}\) be the set of items derived from the \(N\) instances in \(D\), which contains \(L\) items. Next, we define _itemSet_ as a subset of \(I\) where no items derived from the same feature exists. Note that the items in each itemSet follow the same feature order. In particular, an _itemSet_ containing \(k\) items is called a \(k\)-_itemSet_. Furthermore, if a \(k\)-itemSet (\(k\geq 2\)) has one class-derived item, we call it a candidate class association rule (CCAR), which is expressed as follows:  
\[ruleItems\to y \tag{1}\]  
where \(y\), i.e., rule consequent, represents the class-derived item, while _ruleItems_, i.e., rule antecedent, denotes the rest items of the \(k\)-_itemSet_. A CCAR with _support_ (_sup_) \(s\) means that \(s\)% of the instances in \(D\) contain the _ruleItems_ and are labeled with \(y\). A CCAR has _confidence (conf)_\(c\) means that \(c\)% of instances in \(D\) that contain the _ruleItems_ are labeled with \(y\). Let _Rcount_ and _Count_ represent the number of instances in \(D\) that contain the _ruleItems_, and the number of instances in \(D\) that contain the _ruleItems_ and are labeled with \(y\), respectively. Thus, the _sup_ and _conf_ of a given CCAR can be computed as follows:  
\[sup=(CCount/|D|\ )\times 100\%, \tag{2}\]  
\[conf=(CCount/RCount)\times 100\%, \tag{3}\]  
where \(|D|\) is the number of the instances in \(D\). A CCAR whose _sup_ is bigger than a user-specified support (_userSup_) is called a frequent candidate class association rule (FCCAR), otherwise called an infrequent candidate class association rule (ICCAR). Moreover, an FCCAR whose _conf_ is bigger than a user-specified confidence (_userConf_) is called a class association rule (CAR). To facilitate the understanding, a simple example to indicate the relationship among the CCAR, FCCAR, and CAR is provided. Given a CCAR with the form of:  
\[\{\langle A,\ 1\rangle,\ \langle B,\ 3\rangle\}\rightarrow\langle C,\ 5\rangle, \tag{4}\]  
where \(A\) and \(B\) are attributes, and \(C\) is the class label. Actually, the \(\{\langle A,\ 1\rangle,\ \langle B,\ 3\rangle\}\) and \(\langle C,\ 5\rangle\) are the _ruleItems_ and \(y\) in Equation (1), respectively. Assume that the _Rcount_ and the _Count_ of the {\(<\)\(A\), \(1>,<\)\(B\), \(3>\)} are 3 and 2, respectively, and the number of instances in \(D\)is 10.