The occupancy datasets are useful for planning important buildings' related tasks such as optimal design, space utilization, energy management, maintenance, etc. Researchers are currently working on two key issues in building management systems. First, feasible and economical deployment of indoor and outdoor weather and energy monitoring sensors for data acquisition. Second, the development and implementation of cost-effective data-driven models with regular monitoring to ensure satisfactory performance for occupancy prediction. In this context, we present an occupancy forecasting model for different types of rooms in an academic building. A comprehensive dataset comprising indoor and outdoor environmental variables such as energy consumption, Heating, Ventilation, and Air Conditioning (HVAC) operational details and information on Wi-Fi-connected devices of a campus building, is used for occupants' count prediction. A Light Gradient Boost Machine (LGBM) is applied for the selection of suitable features. After the feature selection, Machine Learning (ML) models such as Extreme Gradient Boosting (XgBoost), Adaptive Boosting (AdaBoost), Long Short-Term Memory (LSTM) and Categorical Boosting (CatBoost) are employed to predict occupants' count in each room. The models' performances are evaluated using Root Mean Square Error (RMSE), Mean Square Error (MSE), Mean Absolute Error (MAE), and Normalized Root Mean Square Error (NRMSE). The proposed LGBM-XgBoost model outperforms other approaches for each type of space. Moreover, to highlight the importance of LGBM as a feature selection technique, the XgBoost model is also trained with all features. Results indicate that by selecting the appropriate features through LGBM, the RMSE and MAE for lecture rooms 1 and 2 are improved by 61.67%, 36.17% and 67.05%, 63.67%, respectively. Similarly, for office rooms 1 and 2 RMSE and MAE are improved by 33.37%, 71.5% and 59.7%, 51.45%, respectively.