Background: The availability of urban forest is under serious threat, especially in developing countries where urbanization is taking place rapidly. Meanwhile, there are many classifier algorithms available to monitor the extent of the urban forest. However, we need to assess the performance of each classifier to understand its complexity and accuracy. Methods: This study proposes a novel procedure using R language with RStudio software to assess four different classifiers based on different numbers of training datasets to classify the urban forest within the campus environment. The normalized difference vegetation indices (NDVI) were then employed to compare the accuracy of each classifier. Results: This study found that the Extreme Gradient Boosting (XGBoost) classifier outperformed the other three classifiers, with an RMSE value of 1.56. While the Artificial Neural Network (ANN), Random Forest (RF), and Support Vector Machine (SVM) were in second, third, and fourth place with RMSE values of 4.33, 6.81, and 7.45 respectively. Conclusions: The XGBoost algorithm is the most suitable for urban forest classification with limited data training. This study is easy to reproduce since the code is available and open to the public.