# Rough Set Theory and Soft Computing Methods for Building Explainable and Interpretable AI/ML Models
## 4 Methodology
### Classification
#### 4.2.2 MLSpecialReduct
Low-variance attributes are assumed to have minimal impact on distinguishing data points. By filtering out these features, MLVarianceThreshold reduces dimensionality (Algorithm 11), accelerates computation, and improves model performance, especially for algorithms sensitive to irrelevant or redundant inputs. ```
0: DataFrame \(df\), variance threshold threshold
0: DataFrame \(df\) with low-variance features removed
1:\( variances\leftarrow\) df.var()
2:\(selected\_features\leftarrow\) [\(col\) for \(col\) in \(df.columns\) if \( variances[col]>threshold\)]
3:\(df\gets df[selected\_features]\)
4:return\(df\)
```
**Algorithm 11** MLVarianceThreshold

#### 4.2.4 MLFuzzyRoughSet

The **MLFuzzyRoughSet** method extends traditional Rough Set Theory by integrating fuzzy logic to manage uncertainty and imprecision in data. It approximates decision classes with fuzzy lower and upper sets, facilitating attribute reduction while maintaining classification power. This approach (Algorithm 12) excels with continuous or noisy datasets, enhancing robustness for machine learning tasks. The fuzzy lower approximation, a key component, computes membership degrees to refine class boundaries under uncertainty. ```
0: Decision system \(DS\), decision column \(d\), attribute subset \(C\)
0: Fuzzy lower approximation for \(C\)
1:\(fuzzy\_rels\leftarrow\) compute_fuzzy_relations(\(DS,C\))
2:\(d\_values\leftarrow\) set(\(DS[d]\))
3:\(lower\_approx\leftarrow\{\}\)
4:for\(d\_value\) in \(d\_values\)do
5:\(class\_rows\leftarrow\) [\(i\) for \(i\) in \(DS.index\) if \(DS[d][i]=d\_value\)]
6:for\(x\) in \(DS.index\)do
7:\(membership\leftarrow\min([fuzzy\_rels[x,y]\) for \(y\) in \(class\_rows\)])
8:\(lower\_approx[x,d\_value]\leftarrow\) membership
9:endfor
10:endfor
11:return\(lower\_approx\)
```

**Algorithm 12** MLFuzzyRoughSet

### Scalability Considerations

The computational characteristics (Table 3) of our methods reveal key trade-offs:

* **MLReduct**'s exhaustive search (\(O(2^{n})\) complexity) limits it to small-to-medium feature spaces (\(n\leq 20\)), but guarantees optimal reducts. * **MLSpecialReduct**'s heuristic approach (\(O(n^{2})\)) scales better while maintaining accuracy. * For high-dimensional data, we recommend the following: 1. Pre-filtering with fast methods (e.g., MLVarianceThreshold); 2. Hybrid approaches combining RST with sampling techniques. ## 5 Experimentation and Validation

### Used Dataset

#### 5.1.1 Dataset Description

The dataset used in this study was a private dataset meticulously collected through extensive research and data acquisition efforts over a significant period. It was specifically designed for analyzing the impact of various medical indicators on cardiovascular health. This dataset contains a comprehensive set of features related to heart function and disease diagnosis, making it highly valuable for machine learning applications in medical research. Unlike publicly available datasets, our dataset is the result of extensive research efforts aimed at capturing the complexities of heart diseases. It was collected over a long period, covering a diverse range of patients with varying degrees of cardiovascular conditions. This dataset provides a unique opportunity to develop robust models for detecting heart disease patterns and predicting risk factors with high accuracy. #### 5.1.2 Dataset Attributes

The dataset consists of 14 attributes, which are described below:

* **Age**: Age of the patient (years). * **Sex**: Gender of the patient (1 = male, 0 = female). * 1 = Typical Angina;
- 2 = Atypical Angina;
- 3 = Non-Anginal Pain;
- 4 = Asymptomatic. * **Trestbps (Resting Blood Pressure)**: Resting blood pressure (mm Hg). * **Chol (Serum Cholesterol)**: Serum cholesterol level (mg/dL). * **FBS (Fasting Blood Sugar)**: Fasting blood sugar level (>120 mg/dL: 1 = True, 0 = False). * 0 = Normal;
- 1 = ST-T wave abnormality;
- 2 = Left ventricular hypertrophy. * **Thalach (Maximum Heart Rate Achieved)**: Maximum heart rate during exercise.