Insect pests damage a large amount of agricultural produce every year. This damage can be mitigated to a large extent if it is predicted in advance. Machine Learning (ML) models can be a game-changer in terms of pest management policy planning due to their high prediction accuracy. To forecast the occurrence of the cucurbit fruit fly (Zeugodacus cucurbitae), a polyphagous pest in the vegetable ecosystem, different machine learning algorithms such as multiple linear regression, artificial neural networks, support vector machines, decision tree, random forests, and XGBoost were compared. During the years 2013-2019, adults of cucurbit fruit flies were trapped using bottle traps (ethanol, insecticide (Spinosad / Malathion / DDVP) and culture (6:1:2) covered in wooden blocks) at a rate of 25-30 traps per hectare at weekly intervals. The meteorological observatory recorded several weather data such as daily maximum temperature (oC), daily lowest temperature (oC), average daily temperature (oC), average day relative humidity at 7.00 am and 2.00 pm, bright sun shine hour, evaporation, rainfall, and wind velocity. XGBoost has the highest R2, 0.89, out of the six machine learning models tested, followed by the decision tree model (R2= 0.87). As a result, the best fit model for forecasting this cucurbit fruit fly under the vegetable environment might be these two machine learning methods.