Pistachio production is an economically important crop that grows in arid environments. To predict yield and sustainably manage the use of natural resources such as soil and water, we modelled the effect of soil properties by classification and regression tree, k-nearest neighbors, support vector machines and developed a new hybrid model of support vector machines and the firefly meta-heuristic algorithm. We sampled soils from 124 pistachio orchards in Iran and analyzed them for a range of parameters. Available phosphorus and potassium, exchangeable sodium percentage, soil salinity, gypsum, calcium carbonate and gravel were selected as predictors in the subsequent model based on correlation coefficients, sensitivity analysis and ANOVA hypothesis testing. For modeling, the optimized values for the Kernel function parameters in the hybrid model of ζ, ε and γ were 8.76, 0.001 and 0.99, respectively, while the ideal numerical combinations for p and k parameters in the k-nearest neighbors model were 0.3 and 5, respectively. We checked the difference between the models using paired t-tests which showed that improvements were significant. According to the results, k-nearest neighbors, classification and regression tree and support vector machines algorithms could explain 83, 84 and 88% of the variation of pistachio yield, respectively, but improved to 94% in the hybrid model because it was more able to efficiently capture non-linear relationships. Soil available phosphorus was the most important determinant of pistachio yield, with soil salinity, exchangeable sodium percentage, potassium, gypsum, calcium carbonate and gravel ranked in order of decreasing importance. These outputs can help planners and farmers to better manage soil properties to increase pistachio yield and sustainable production.