Today, Mexico ranks second worldwide in total lemon production; however, the yield per hectare is only ranked eighth, which makes evident a low productive potential in the country. This work provides an impact analysis of certain physical and climatic variables on the yield of Persian lemon (Citrus latifolia) harvest; its objective is to determine which variables are controllable to guarantee a higher crop yield in different uncontrollable climatic conditions. For this, we developed a yield prediction system. The system consists of three sequential Extreme Gradient Boosting (XGBoost) algorithms fed with historical information, which allow for prediction of Persian lemon crop in its three stages: flowering, budding, and fruiting, having as input variables planting density, number of trees in production, pruning and cleaning, and pest control, in addition to uncontrollable weather elements such as rain and wind. The variables with the greatest impact on crop yield are pruning, cleaning, and pest control. The algorithms have a performance of 0.87, 0.93, and 0.97, respectively, for each stage. The analysis provides the farmer with a tool that allows him to make data‐driven decisions based on the manipulation of good agricultural practices considering the current weather conditions, thus promoting a higher harvest yield and thus a higher profit margin.