# C-MWCAR: Classification Based on Multiple Weighted Class Association Rules
## 3 Materials and Methods
### Implementation of the Proposed C-MWCAR
#### 3.2.4 Multiple Weighted CARs-Based Classifier (MWCC)  
When classifying a new instance, most existing CARs-based classifiers usually label it with the consequent (i.e., the class-derived item) of the first CAR in the obtained final CAR set that matches the instance. If there are no matching CARs, it will be assigned a default class [7]. However, the above procedure has two shortcomings when facing actual problems. We find that although the discretized feature values of some new instances cannot match any CARs, they are very similar to some CARs. On this occasion, classifying those instances with the default class will unavoidably lose some useful information, leading to reduced classification performance [8]. Moreover, sometimes one instance can match several CARs; however, these CARs are conflicting CARs. In other words, the class labels of those matching CARs are different from each other. Thus, we will be unable to classify the instance since we do not know which CAR we should use. Here, it takes the diagnosis of hypertension as an example to illustrate the shortcomings. Hypertension is a quite complex physiological status where physiological indexes often change continuously, which makes hypertensive patients usually show much different physiological indexes. Even the same patient's physiological indexes recorded at different times may also be different. Therefore, given a new subject, it is likely that the subject's physiological indexes cannot match any of the CARs obtained already but are similar to some of them. Moreover, hypertensive patients may not show any symptoms at times, which may result in a patient's physiological indexes matching several CARs having conflicting class labels. To tackle these problems, we designed a novel associative classifier named MWCC. Concretely, MWCC first selects a set of CARs that are most similar to the given instance based on the similarities between the CARs and the instance. We then compute the weighted classification abilities of the selected CARs. Finally, we classify the instance by considering the obtained similarities and the weighted classification abilities simultaneously. In this way, the problem of no matching CARs and conflicting CARs can be effectively solved. To measure the similarity between a CAR and an instance, we design a metric named similarity which is defined as follows:  
\[Sim(CAR,\ Instance)=\frac{\sum_{i=1}^{i=N}\frac{(Max_{i}-Min_{i})^{2}-(CAR_{i}  
which means that the computed similarity represents the average similarity of each item. For each instance, we select the \(K\) most similar CARs from different classes, respectively, for the final classification procedure.  
The classification ability of each CAR may differ from each other; hence, we should not treat them equally. Intuitively, if the support of an item changes dramatically from one class to another, the item may have much stronger ability to classify the instances containing this item, and hence should be assigned a higher weight. Given an item, its weight regarding a given class A is marked as \(W(item,A)\), which is defined as follows:  
\[W(item,A)=freq(item,A)\times\prod\
olimits_{i=1}^{i=N-1}(1-freq(item,B_{i})) \tag{8}\]  
where \(freq(item,A)\) denotes how frequently the item appears in CARs whose class label is \(A\), \(N\) indicates that the dataset contains \(N\) classes in total, and \(B_{i}\) represents the \(i_{th}\) class except for class A. Obviously, the computed weight tends to be high if the item appears frequently in class \(A\) but infrequently in other classes. Based on the weight of an item defined above, the weight of a CAR regarding class \(A\) can be defined as follows:  
\[W(CAR,A)=\frac{\sum\
olimits_{i=1}^{i=N}W(item_{i},A)}{N} \tag{9}\]  
where \(N\) denotes the number of items of the given CARs, while \(item_{i}\) represents the \(i_{th}\) item of the \(CAR\).