## 2 Materials and Methods
### Research Methods
#### 2.4.2 LightGBM Model Construction  
The LightGBM model training is divided into five steps, namely data collection, feature engineering, model training, cross validation and accuracy evaluation [32]. The data collection is mainly the experimental data of nine nutrient factors, namely pH value, organic matter, total N, available K, available P, exchangeable Ca, exchangeable Mg, available B and available Zn in the soil of the tobacco growing area. The data were preprocessed, and the model database was established after screening and eliminating the abnormal values.  
Feature engineering is an important part of the LightGBM model (Figure 2) construction. It is mainly used to classify sample data through feature values that can reflect the nature of classification. In addition, model training and cross validation mainly optimize the model through continuous learning and training. After that, the accuracy of the sample set and the test set was evaluated, and the results were output.  
The comprehensive analysis of nine nutrient factors, namely pH value, organic matter, total N, available K, available P, exchangeable Ca, exchangeable Mg, available B and available Zn, in 1038 sample points in Baise, Hechi and Hezhou City of Guangxi Zhuang Province was carried out. The data were preprocessed with principal component and cluster analysis and were used as the training data of the model. The 290 samples in the study area are the test data. Since the original data were divided into five grades according  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Measurement Index** & **Determination Method** \\ \hline pH value & pH meter electrode method [23] \\ Organic matter & Potassium dichromate titration [24] \\ Total N & Kjeldahl method [25] \\ Available K, P & Combined extraction colorimetric method [26] \\ Exchangeable Ca, Mg & Ammonium acetate exchange atomic \\  & absorption spectrophotometry [27] \\ Available B & Boiling water extraction methylimine-H \\  & colorimetric method [28] \\ Available Zn & DTPA extraction atomic absorption \\  & spectrophotometry [29] \\ \hline \hline \end{tabular}
\end{table}
Table 1: Determination indexes and methods of soil nutrients.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Evaluation Index**} & \multicolumn{5}{c}{**Grade**} \\ \cline{2-5}  & **Very Low** & **Low** & **Moderate** & **High** & **Very High** \\ \hline pH value & \textless{}4.5 & 4.5–5.5 & 5.5–7.0 & 7.0–7.5 & 7.5\textless{}\textless{}\textgreater{} \\ Organic matter (g/kg) & \textless{}10 & 10–20 & 20–30 & 30–40 & \textgreater{}40 \\ Total N (mg/kg) & \textless{}500 & 500–1000 & 1000–2000 & 2000–2500 & \textgreater{}2500 \\ Available K (mg/kg) & \textless{}80 & 80–150 & 150–220 & 220–350 & \textgreater{}350 \\ Available P (mg/kg) & \textless{}10 & 10–15 & 15–30 & 30–40 & \textgreater{}40 \\ Available B (mg/kg) & 0.3\textless{} & 0.3–0.5 & 0.5–1.0 & 1.0–3.0 & \textgreater{}3.0 \\ Available Zn (mg/kg) & 0.3\textless{} & 0.3–0.5 & 0.5–1.0 & 1.0–3.0 & \textgreater{}3.0 \\ Exchangeable Ca (cmol/kg) & \textless{}2 & 2–4 & 4–6 & 6–10 & \textgreater{}10 \\ Exchangeable Mg (cmol/kg) & \textless{}0.4 & 0.4–0.8 & 0.8–1.6 & 1.6–3.2 & \textgreater{}3.2 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Evaluation criteria of abundance and deficiency for nutrients in tobacco planting soil.  
to the nutrient status of tobacco planting soil based on the class average method in cluster analysis during preprocessing, the class labels of the confusion matrix are also displayed as five grades during model training [33].