Thermal comfort and indoor air quality are essential factors that directly influence occupants’ health and activity efficiency. Ensuring optimal thermal conditions also supports energy-efficient buildings by preventing energy waste. Machine learning models have been extensively applied to classify thermal comfort and air quality, with supervised learning algorithms such as support vector machine (SVM) and K-nearest neighbor (KNN) showing high accuracy. However, no prior study has compared or combined these two models for simultaneous prediction of thermal comfort and air quality, especially in diverse geographical settings. This study aims to develop and compare SVM and KNN to determine the most accurate model for enhancing thermal comfort and air quality in highland and lowland Islamic boarding schools. Using a quantitative approach, we collected datasets from schools in Wonosobo (highland) and Pontianak (lowland). The results show that KNN outperforms SVM in accuracy, precision, and F1-score. Additionally, a hybrid model integrating both algorithms further improves accuracy, achieving 91%. These findings highlight the effectiveness of machine learning in optimizing environmental conditions in educational settings.