Air pollution from urban activities poses significant health risks, underscoring the need for effective monitoring of the air quality index (AQI). This paper presents a novel approach for AQI prediction by integrating a Takagi-Sugeno fuzzy inference system (TS-FIS) with machine learning (ML). Traditional ML techniques often encounter difficulties in converting regression datasets into classification formats, particularly when conventional labelling methods are inadequate. The TS-FIS model, developed using MATLAB, integrates both pollutant and meteorological data, simplifies input grouping and rule management, and converts regression data into classification levels such as healthy, moderate, and unhealthy using IF-THEN rules. The regression outputs are validated with metrics including RMSE (0.48), MSE (0.23), MAE (0.45), and MAPE (1.77). A random forest classifier (RFC) trained on the TS-FIS outputs achieves maximum 99.85% accuracy, with F1 score, precision, and recall, surpassing traditional methods, which achieve maximum 99.63% accuracy. The study also includes a comparative analysis of ML-based FIS models for AQI prediction with different parameters and membership functions, alongside a traditional ML model for AQI classification using RFC. The key novelty of this work lies in the fine-tuning of membership functions and parameters, which significantly enhances the performance of the ML-based FIS model, demonstrating its superiority. These results underscore the model's potential for practical applications in environmental monitoring and management.