Machine learning techniques are increasingly used to predict and analyse indoor air quality (IAQ). In this study, a device developed by the LARIS laboratory was used for the monitoring of CO2, temperature, humidity, PM1, PM2.5 and PM10 in four different zones of a library. The data collected were used to train and compare two machine learning models, Long Short-Term Memory (LSTM) and Random Forest (RF), for the forecasting of the IAQ parameters using three different input windows (1h, 6h and 12h) to predict the next 10-minute step. The best performing model was used to develop an anomaly detection method using season-hour thresholds and IAQ limits. Finally, the measurements from the four different zones were used to investigate the possibility of predicting the global occupancy of the library using three models: RF, Extra Trees, and Gradient Boosting. Results show that the LSTM model performs slightly better than RF in predicting the six IAQ parameters, and that an input window of 1h is sufficient for accurate forecasting, as feeding the model with longer input windows has only a very small effect on the performance. The season-hour threshold method shows promising results for anomaly detection and for reducing false alarms. Finally, predicting the global occupancy of the library is a complex task and would require more sensors. The novelty of this study lies in the use of forecasting and a season-hour threshold method for anomaly detection, offering a new approach to reduce false alarms. Furthermore, the study includes occupancy prediction with multi-zone monitoring.