## 4 Research and Project Aimed at Developing Modules of a Classification and Expert System
### Final Classification After Treatment Module
#### 4.3.2 The Process of Data Preparation and Model Training  
In this section, we provide a detailed account of the data preparation process, the steps taken to train the classification model, and the evaluation methodology used in the study of FSGS patient classification. The classification framework, as outlined in Section 4.3.1, relied on a robust dataset generated to reflect the seven outcome categories defined in Table 5.  
The dataset was prepared to encompass a comprehensive representation of FSGS outcomes, ensuring equal distribution across all seven categories. To ensure the model's robustness and to address potential class imbalances, data augmentation techniques were employed. These techniques aimed to generate new synthetic data points based on the distribution of the original dataset, thereby improving the model's generalization capabilities. Synthetic data generation was performed in Python v24.0, adhering to the clinical thresh  
Figure 6: Schematic representation of the MIMO classification system. olds and characteristics specified in Table 5. For each class, 200 data records were generated, resulting in a total dataset of 1400 instances. Each instance consisted of 13 clinical features, including key markers such as proteinuria, serum albumin, and serum creatinine levels. The process began with data preprocessing, where missing values in the feature columns (excluding the target variable) were handled using median imputation. This was performed with the SimpleImputer, ensuring that no feature contained null values. The target variable was then encoded using _LabelEncoder_, which converted the categorical labels into numeric form suitable for model training. Next, the features were standardized using _StandardScaler_ to normalize the data, ensuring that all features had a mean of zero and a standard deviation of one, which aids the convergence of many machine learning algorithms. Each model was evaluated using 5-fold cross-validation to estimate its performance on the training set. The _cross val score_ function calculated the accuracy for each fold, and the mean accuracy score was stored for comparison. Once the cross-validation was complete, each classifier was trained on the entire training set using the fit method, and predictions were made on the test set. To assess the performance of each model, a classification report was generated, providing precision, recall, and F1-score for each class, as well as the weighted averages of these metrics. In addition, confusion matrices were calculated and visualized to display the true positives, false positives, true negatives, and false negatives for each model, giving further insight into the models' behavior and areas where they may struggle. Finally, to facilitate model comparison, precision, recall, and F1-score for each class were visualized in bar charts, allowing for a clear side-by-side comparison of model performance across the different classes. This detailed approach helped identify the strengths and weaknesses of each model and provided insights into the data and features that contributed most to accurate predictions. Table 6 details the settings for each model used during development.