# Prediction of Students' Adaptability Using Explainable AI in Educational Machine Learning Models
## 4 Results and Discussion
### Result Analysis with XAI Techniques
#### 4.3.5 Counterfactual Explanation  
Figure 9 details a Counterfactual analysis for Instance 3, where a model's original prediction of a student's adaptability level as 'Moderate' (coded as 2) is altered to 'Low' (coded as 1). This analysis is pivotal in understanding the sensitivity of the predictive model to changes in feature values. The original feature vector [1 3 2 1 0 1 1 0 1 1 1 1 1] encapsulates the student's profile, with each element corresponding to various features such as Gender, Age, Education Level, etc., as outlined in the research methodology. The Counterfactual vector [1. 3. 2. 1. 0. 1. 1. 0. 1. 1. 0.49932724 1. 1.] presents the minimal adjustment required to flip the prediction outcome. Notably, the alteration occurs at the eleventh feature, which we can infer relates to 'Class Duration' given the 'Feature differences' array indicating a change of [0.5]. This modification in 'Class Duration' decreases its value by 0.5. Considering our encoding scheme, where 'Class Duration' might be defined within a range (e.g., '0' for Low, '1' for Moderate, '2' for High), a decrease suggests a shift towards a shorter class duration. The model's understanding that a reduced 'Class Duration' indicates a 'Low' adaptability level may stem from a pattern observed in the data, where shorter class durations are linked to low adaptability. The implications of this finding are significant for educational practices. It suggests that ensuring adequate class time may be critical for student adaptability, echoing educational theories that emphasize the role of engagement time in skill development and learning adaptability. Policymakers may need to consider this relationship when designing curriculum schedules, advocating for sufficient instructional time to foster an adaptable learning mindset. Also, this Counterfactual result raises important questions for future research. Why might a slight reduction in 'Class Duration' correlate with a lower adaptability prediction? Does this relationship hold across various subjects and learning contexts? Such questions highlight the need for a deeper examination of the educational factors that contribute to student adaptability and the development of interventions that can effectively support students' learning journeys. The comparison between the original and Counterfactual feature values for Instance 3 is shown in Figure 10. This comparison offers valuable insight into how the model predicts  
Figure 9: Counterfactual analysis illustrating adaptability prediction shift. student adaptability levels. The bar chart highlights the differences between the original features that led to a 'Moderate' adaptability prediction and the Counterfactual features that would result in a 'Low' adaptability prediction. The original feature values are denoted in blue, while the Counterfactual values that could potentially alter the model's outcome are shown in orange. Notably, most features remain unchanged between the original and Counterfactual scenarios, except for 'Class Duration', which shows a decrement of 0.5 in the Counterfactual case. This decrease suggests that a reduction in 'Class Duration' is influential in shifting the adaptability prediction from 'Moderate' to 'Low'. The result also emphasizes the significant role that 'Class Duration' plays in the adaptability model, where a slight reduction in duration is the single change needed to alter the prediction. This finding has important implications for educational strategies, suggesting that maintaining or increasing class duration could be a critical factor in supporting higher adaptability levels among students. Educators and administrators may use these insights to reassess the structure of the school day and the allocation of time to different subjects. The chart encourages a data-driven approach to curriculum planning, ensuring that students have sufficient time for in-depth exploration and learning, which is crucial for developing adaptability skills.