**5. Conclusions**

The proposed approach uses leaf spectral data in the visible and near-infrared regions, and switches between reflectance and its first-derivative data to predict the amount of macro- and micronutrients measured in the laboratory. This method was able to return high predictions (R2) for nutrients like N (0.912), Mg (0.832), Cu (0.861), Mn (0.898), and Zn (0.855), and, to a lesser extent, P (0.771), K (0.763), and S (0.727). These accuracies were obtained with the RF, ANN, and kNN algorithms, among which RF performed the best. Another discovery was that reflectance data is more suitable to model macronutrients, while the first-derivative of the reflectance data is better related to micronutrients. Another contribution also made by this study is the identification (by the Relief-F value) of the wavelengths most responsible for the prediction results. Each nutrient was better correlated to one or more spectral wavelengths. Because of it, future research should evaluate simpler models or spectral vegetation indices capable of modeling the nutrient content by focusing on these wavelengths. Although the presented method was used for evaluating the nutritional conditions of Valencia-orange leaves, it can be replicated for different plants and cultivars, with the possibility of even better performances being achievable. Furthermore, as an advantage of this approach, this framework may be implemented in hyperspectral data obtained with sensors embedded in UAV-based systems.

**Author Contributions:** Conceptualization, L.P.O., A.P.M.R., J.M.J., and J.E.C.; methodology, L.P.O., A.P.M.R., É.A.S.M., and J.E.C. formal analysis, L.P.O. and M.M.F.P.; resources, J.E.C., N.N.I., F.F.d.A. and J.M.J.; data curation, L.P.O., M.M.F.P., A.P.M.R., É.A.S.M., J.E.C., and J.M.J.; writing—original draft preparation, L.P.O.; writing—review and editing, A.P.M.R, É.A.S.M., N.N.I., F.F.d.A., N.E., F.I., V.L., L.A.d.C.J., J.L., L.M., W.N.G. and J.M.J.; supervision, A.P.M.R., J.E.C., N.N.I. and J.M.J; project administration, A.P.M.R., J.E.C and J.M.J.; funding acquisition, L.P.O., and J.E.C. All authors have read and agreed to the published version of the manuscript.

**Funding:** This study was financed in part by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior—Brasil (CAPES)—Finance Code 001 and supported by the Universidade Federal de Mato Grosso do Sul (UFMS). É.A.S. Moriya is supported by FUNDUNESP/Print (p: 3030/2019). V. Liesenberg is supported by FAPESC (2017TR1762) and CNPq (313887/2018-7). N.N. Imai is supported by CNPq (310128/2018-8). J. Marcato Junior is supported by CNPq (433783/2018-4, 303559/2019-5) and Fundect (59/300.066/2015).

**Acknowledgments:** The authors acknowledge Universidade Federal de Mato Grosso do Sul (UFMS) for supporting the research, and Fazenda Brasilia, located in Areia Branca, Ubirajara—SP (Brazil), for contributing to the experimental site.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.
