Construction and Application of Agricultural Talent Training Model Based on AHP-KNN Algorithm

. At present, the gap of agricultural talents in China is continuously widening, and most enterprises lack agricultural core talents, which has caused great impact on the social economy. To solve this problem, an improved AHP-KNN algorithm is proposed by combining the analytic hierarchy process (AHP) and the optimized K-nearest neighbor algorithm, and an agricultural talent training model is proposed based on this algorithm. The results show that the classi ﬁ cation accuracy and classi ﬁ cation time of the improved AHP-KNN algorithm are 96.2% and 27.5 seconds, respectively, both of which are superior to the comparison algorithm. The result shows that the classi ﬁ cation accuracy of agricultural talents can be improved by using this algorithm. Therefore, the model can be used to classify agricultural talents with the same characteristics into one class, carry out targeted training, and train all-round agricultural talents e ﬃ ciently and quickly, so as to improve the serious shortage of agricultural talents at present.


Introduction
Agriculture is an important pillar of the national economy, and the training of agricultural talents is crucial for the sustainable development of agriculture [1].However, in the current rapidly developing social context, there are many problems with the traditional agricultural talent cultivation model, which limits the development of the agricultural field and the effectiveness of agricultural talent cultivation.For example, there is a disconnect between education and industry; a mismatch between knowledge and skills; a lack of comprehensive quality training, practical opportunities, and industrial cooperation; and a lack of interdisciplinary training [2].In order to promote the modernization and sustainable development of agriculture, we need to innovate agricultural talent training models to meet the needs and challenges of the agricultural industry.Therefore, it has become an urgent task to build a scientific and effective agricultural talent training model [3].K-nearest neighbor (KNN) algorithm is a simple and effective machine learning algorithm, which is based on the classification method of instances.By calculating the distance between the new sample and the existing sample, the KNN algorithm classifies the new sample into the same category as its nearest neighbor [4].The KNN algorithm is simple and intuitive, is nonparametric and insensitive to outliers, and has some disadvantages such as high computational complexity and the need to determine the K value.Analytic hierarchy process (AHP) is a quantitative method used in decision analysis.It decomposes the complexity of a problem into a series of hierarchical structures and determines the best decision scheme by comparing criteria and choices [5].Analytic hierarchy process (AHP) has the advantages of structure, quantification, flexibility, and comprehensiveness, but it also has disadvantages such as too much subjectivity, data uncertainty, and complexity.Therefore, the effect of applying KNN algorithm and AHP algorithm alone to the agricultural talent training model is not ideal.Therefore, this study combines AHP algorithm and KNN algorithm to build a comprehensive agricultural talent training model.This comprehensive application method is still less explored in agricultural talent training research and provides a new idea and method for research in this field.Through this model, researchers can conduct a comprehensive evaluation and analysis of agricultural personnel training and provide scientific decision support for relevant decisions.This research is not only innovative and theoretical contribution but also has practical application value.By constructing AHP-KNN model, it can provide scientific talent selection and training programs for agricultural talent training institutions, agricultural enterprises, and farmers and improve the effect and quality of agricultural talent training.

Literature Review
With the increase of data hierarchical requirements in various fields, hierarchical analysis is applied in various fields.Zheng et al. proposed a hierarchical analysis method based on correlation process for better evaluation of transmission line tripping.The method uses clustering algorithm to obtain the characteristic factors and establish an objective evaluation matrix.The empirical analysis of the model shows that the consistency between the estimated results of the model and the actual values is 76%, which is very practical [6].Yadav proposed a decision model based on hybrid hierarchical analysis for optimal selection of dental conforming materials, and the dental composites were selected with this model, and the results showed that the model selected dental composites with better performance than other models [7].Yildiz et al. proposed an evaluation model based on fuzzy analytic hierarchy process to address the issue of difficult evaluation of public expectations in water plants and used this model to evaluate public expectations.The results indicate that the evaluation results are relatively close to actual public expectations, and this model can be used to evaluate public expectations and develop water plant governance strategies based on this [8].As a basic classification algorithm, KNN algorithm is also widely used in various fields.Liang et al. proposed a multilabel classification model with KNN algorithm to improve the efficiency of inspection and maintenance of nonsolidly grounded distribution networks.The empirical analysis of this model showed that the model proposed in the study has better feasibility and advantages [9].Ning et al. proposed a classifier model based on KNN algorithm to identify lysine formylation sites in response to the problem of insufficient calculation methods for predicting lysine formylation.Empirical analysis shows that the specificity and sensitivity of the model are 79.9% and 81.4%, respectively, indicating that the model can be used to predict lysine formylation [10].Wolff et al. proposed an approximate nearest neighbor clustering method based on position sensitive hashing to better reduce the computational resources of single cell Hi-C technology.Comparative experiments have shown that this method can effectively reduce computational resources compared to competitive algorithms [11].
With the development of technology, various fields are paying more and more attention to talent training, and there are various methods applied to talent training.Wen [12] proposed a talent training model based on BIM 5D technology and related information technology to address the prob-lem of insufficient personnel for assembly-type intelligent buildings and applied the model to actual talent training.Yushchik [13] proposed a fishery talent training model based on digital literacy to address the impact of digitalization on fishery practitioners and applied it to practical fishery enterprises.This model is practical for cultivating fishery talents.Fishery personnel trained using this model can successfully use Li and Cui's virtual reality-based sports talent training system to improve athletes' athletic abilities.Using this system to provide scientific training assistance for athletes can improve their various sports abilities.The system was empirically analyzed and found that the model is beneficial to improve the athletic ability of athletic personnel and can help train athletic personnel [14].Jones et al. proposed a hemostatic talent training model to address the shortage of hemostatic talents in the school system and applied this model to cultivate hemostatic talents.This mode can correctly respond to hemostatic events and teach hemostatic methods to others, with high practicality [15].
The above research indicates that analytic hierarchy process and KNN algorithm have been widely applied in various fields, and there are also many methods applied in talent cultivation.However, there are few studies that combine analytic hierarchy process (AHP) and KNN algorithm to apply to talent cultivation models.Therefore, the paper applies the AHP-KNN algorithm to the agricultural talent training model to improve new ideas for the training of agricultural talents.

Construction of Agricultural Talent Training
Model Based on AHP-KNN Algorithm

Application of AHP-KNN Algorithm in Agricultural
Talent Training.With the development of modern agriculture, the demand for agricultural talents in major enterprises has increased greatly, but it is more difficult to identify and train agricultural talents [16].The current requirements of enterprises for agricultural talents are shown in Figure 1.
As shown in Figure 1, the agricultural talents needed by enterprises should have the foundation of digital agriculture.With the advent of the digital era, more and more agricultural production processes are applying digital technology, and agricultural talents with this technology can supervise the production process and make suggestions.Secondly, in modern agriculture, family farms have become the main mode of operation.As agricultural talents, they are essential for the management of family farms, so they must have excellent knowledge of enterprise management and strategic management.After the further development of family farms, they will certainly go the way of marketization and scale, so there are also requirements for the ability of chain management of agricultural talents.Thirdly, with the rapid improvement of the country's comprehensive grain production capacity, the promotion of agricultural technology, prevention and control of animal and plant diseases, and standardized agricultural production are gradually increasing in agricultural development.Therefore, agricultural talents need to have a foundation in modern agricultural technology in order to solve these problems in practice and ensure the safe circulation of agricultural products [17].In addition, with the implementation of agricultural trade promotion measures, the export value of agricultural products has been on a growing trend.All agricultural talents also need to possess international trade and marketing capabilities to help improve the management of agricultural product marketing systems and increase the export trade value of agricultural products.These two abilities not only require good communication skills, but also good professional qualities.Finally, modern agriculture requires scientific management concepts as management tools.Agricultural talents are also essential for the management and enterprise management capabilities of rural professional cooperatives.This requires good basic knowledge of cooperative and enterprise management, as well as excellent business acumen and innovative knowledge, to properly handle problems in the management process.The quality of agricultural talents is determined through a large number of literature researches on agricultural talents and a questionnaire survey on the management personnel of relevant agricultural enterprises.Then, according to the recognition of the quality of the identified agricultural talents by the agricultural production enterprises, the specific characteristics of the proposed agricultural talents and the recognition evaluation results are shown in Table 1.
After a lot of literature research, a detailed analysis of the qualities that agricultural talents have has been conducted, and see Table 1 for details.
From Table 1, the level of identification among agricultural production enterprises with the various quality charac-teristics possessed by agricultural talents is not consistent.Among them, the recognition of the basic features of digital agriculture is the highest, and the recognition of agricultural security management ability is the lowest.Two features with a recognition level of less than 75% in Table 1 were removed, leaving 10 features with serial numbers E1-E10.The recognition degree of each of the ten features is different, so their   3 Journal of Applied Mathematics weight in the algorithmic model of agricultural talent training is also different, and the study uses the AHP algorithm to quantify the weight of different features.The AHP algorithm is used to determine the weight of different features by comparing the importance of any two features and judging that the product of the elements in the stacked positions of the matrix is always 1.The specific comparison criteria used in the study are as follows: A scale of 1 indicates that two elements are equally important; a scale of 3, 5, 7, and 9 indicates that the former is slightly, obviously, strongly, and extremely important than the latter; a scale of inverse indicates that the positions of the two elements have been reversed.Using this method to evaluate the ten characteristic elements in the agricultural talent cultivation model, the evaluation matrix obtained is shown in Table 2. A1-A10 of horizontal axis and vertical axis in Table 2, respectively, represent ten different feature elements.The data in the table are obtained by comparing the feature degree between the two features.See the following details for specific comparison criteria.
After obtaining the judgment matrix as shown in Table 2, if the weights of different eigenvalues are to be obtained, further operations on the judgment matrix are required.Firstly, the column vectors are normalized, and the calculation formula is shown in In Equation ( 1), i represents one of the ten features of the horizontal axis; j represents one of the ten features of the vertical axis, and A ij denotes the weight value between features i and j.Then, the row vectors are normalized, and the formula is shown in In formula (2), sum i represents the sum of the row vectors after normalization, and finally, the expression of the weight value of Q i for each feature is obtained by normalizing it as shown in The weight values of different features of agricultural talents can be obtained by Equation (3).KNN algorithm is a commonly used classification algorithm, which is widely used in many classification situations because of its simple algorithm and high classification accuracy [18].The AHP-KNN algorithm obtained by combining KNN and AHP is mainly used to calculate the distance between unknown samples and agricultural talent sample data with known labels.The impact of adding different feature weights on agricultural talent cultivation models is quantified, and the impact of different feature values on agricultural talent clas-sification is quantified.Then, the KNN classification algorithm is used to classify the samples and find the category of the given sample.The specific steps of AHP-KNN algorithm are shown in Figure 2.
As shown in Figure 2, in the process of this algorithm, the data set must first be preprocessed and then divided into a training set and a test set.Then, the judgment matrix between the target layer and the criterion layer is initialized, hierarchical ordering is performed, and then, it is judged whether it passes the consistency test.If it fails, the judgment matrix is adjusted, and we return to the previous step.If it passes, the judgment matrix of the criterion layer and the schema layer is initialized, and hierarchical simple ordering is performed.Then, it is also judged to see if it passes the consistency test.If it fails, the evaluation matrix is adjusted and returned to the previous step.If it passes, the overall hierarchical ranking is performed, and the weight of each influencing factor in the scheme layer is obtained.Then, different K values are set to traverse the test set, the Euclidean distance between the test sample and the training set is calculated, the KNN algorithm is executed, and finally, the classification of each sample in the test set is obtained, and the algorithm is finished.By calculating the weights of the features of agricultural talents and classifying them by KNN algorithm, agricultural talents are divided into four categories: excellent, good, pass, and fail.The sample set of agricultural talents is set to Y, and the weight value of different characteristics is set to Q i .Y i ′ represents any sample in set Y; then, the distance between sample X and set Y is related to the weight value of the feature and the distance between sample X and Y i ′.The specific expression is shown in Equation ( 4) is the weight value of different features, and Y ′ denotes any sample in the set Y.Then, according to the input K values, the training samples with K known labels that are closest to the unknown samples are selected, and the category with the largest number of labeled unknown samples is selected to obtain the category of unknown samples.Each agricultural talent can be targeted by classifying the agricultural talent samples, so as to cultivate agricultural talents with excellent rank and then make up for the shortage of agricultural talents in our enterprises.

Improved KNN Algorithm Based on K Value Selection
Strategy.The KNN classification algorithm mainly consists of three elements: K value, distance metric, and classification rule, and its classification principle is mainly to classify the samples to be tested by the category and classification rule of the K samples closest to the samples to be tested [19].In the KNN algorithm, the selection of K value is very important; if the K value is too small, the classification model will become complex, and the overall accuracy of the classification model will be reduced; if the K value is too large, it will lead to the participation of samples that are not too similar to the sample to be tested and reduce the accuracy of the classification [20].In the traditional KNN classification algorithm, the sample under test is classified by comparing the number of each type of each of the K neighboring samples of the sample under test, and the sample under test is classified into the class with the highest number of K neighboring samples.However, the traditional  As shown in Figure 3(a), the number of both triangles and circles in the near samples of the data set is 2, which makes it impossible to determine whether the samples to be tested are classified as triangles or circles.In addition, the traditional KNN classification algorithm usually has an odd number of K values, which is less prone to classification errors in the binary classification problem, but prone to classification errors in the multiclassification problem.As shown in Figure 3(b), the K value is 5, and the five selected neighboring samples are 2 triangles, 2 circles, and 1 pentagon.At this point, the number of triangles and circles is tied for first place, and the classification of the samples to be tested cannot yet be accurately judged.In order to better solve the above problems, an improved algorithm based on the proliferation coefficient viscosity value selection strategy was proposed.The value of K can be used as an even number.When the number of samples in K adjacent samples is equal, the average distance from the tested sample is used as the classification indicator to classify the tested sample as a class with the average distance from the tested sample.In Figures 3(a) and 3(b), the number of triangular samples and circular samples is the same, but the average distance of the triangle from the sample to be tested is short, so the sample to be tested is classified as the triangular sample; in Figures 3(c) and 3(d), the number of triangular samples and circular samples is the same, and the average distance of both from the sample to be tested is the same, so the sample to be tested is classified as the type that is the closest sample to the sample to be tested.Therefore, in Figures 3(c) and 3(d), the sample to be tested should be classified as the sample of the circle class that is closer to it.The principle flowchart of the optimal classification algorithm based on the K value selection strategy is shown in Figure 4.
In Figure 4, the process of the optimized KNN algorithm is divided into nine steps.The first step is to collect and prepare the data from the database and extract the features of the data.The second step is to use the data in the dataset as the training dataset and construct the sample set X, and the range of the set X is shown in In Equation ( 5), x i denotes the first i sample, while R n denotes the n dimensional space.The next step is the initial setting of the value of K.The fourth step is to find the K samples closest to the sample x to be measured in the set X by using the Euclidean distance formula, which is denoted as N k x .At this point, the Euclidean distance between the samples x i and x j is shown in In Equation ( 6), x i l is the first attribute of l for the first i sample.At this point, the category label of x i is set to y i , and the range of y i is made as shown in In Equation (7), k denotes the number of categories in the training sample set, while c i denotes the label of the ith category.The fifth step is to determine the formula for the category y of the sample x to be tested according to the classification rules as shown in In Equation (8), I shows the feature function.The sixth step of the optimization KNN algorithm is to judge whether the obtained y is unique or not.If the value of y is unique, the classification effect is judged.If the classification effect is good, a conclusion is drawn.If the classification effect is not good, the K value is reset in the third step until the classification effect is good.If it is found that the value of y is not unique, it means that there are two types of samples with the same number of samples among K close samples.Then, the average distance between the two types of samples with the same number needs to be calculated.
In Equation ( 9), c a and c b denote the two types of samples with the same number of samples, and m denotes the number of samples in both types.After finding the average distance of the two types of samples, the average distances of the two types of samples d y 1 and d y 2 are compared.If they are equal, then Equation ( 10) can be obtained.10) is determined by Equation (11) indicates that c j is the class.x i belongs to the K proximity samples that are closest to the sample to be tested, x.If d y 1 and d y 2 are not equal, then Equation ( 12) is obtained.
Equation (12) indicates that the sample to be tested is classified as the sample class with small distance, and at this 6

Calculate K neighbors
Calculate the average distance between the selected sample and the sample to be tested

Determine sample point category
Equal distance?

Get the best classification results
The sample to be tested is classified as the minimum distance

Modify K value
The latest sample class in the selected sample  7 Journal of Applied Mathematics time, to determine whether the classification effect reaches a high level, if it does, the result is output, if not, go back to the third step to reset the K value to continue the cycle.By optimizing the KNN algorithm with better classification performance, and then applying it to the AHP-KNN algorithm model, it can help improve the classification accuracy of this algorithm model, which is beneficial to the targeted training of agricultural talents.

Improved AHP-KNN Algorithm Performance Comparison Analysis
To test the performance of the improved AHP-KNN algorithm based on K value selection strategy in this study, two simulation comparisons were conducted on PyCharm software for AHP-KNN and KNN.The experiment compared the classification accuracy, error rate, and classification time of three algorithms under different K values and compared the performance of the three algorithms by comparing the results of these three indicators.The error rate curves at different K values are shown in Figure 5.
Figure 5 shows the error rate curves at different K values, where Figure 5(a) shows the error rate curves at different K values in the first comparison experiment.From Figure 5(a), the error rate curve of the optimized AHP-KNN algorithm is significantly lower than the other two error rate curves, and the optimized AHP-KNN algorithm has the lowest error rate at K value of 6.The optimized AHP-KNN algorithm has the lowest error rate at K value of 6, at which time the error rate is 1.7%; both the AHP-KNN algorithm and the KNN algorithm also have the lowest error rate at K value of 6, with the lowest error rates of 4.2% and 4.9% for the two algorithms, respectively.Figure 5(b) shows the error rate curves of the three algorithms at different K values in the second comparison experiment.From Figure 5(b), the error rate curves of the optimized AHP-KNN algorithm are also significantly lower than the other two error rate curves, and all three algorithms have the lowest error rate at K value of 6, with the optimized AHP-KNN algorithm having the lowest error rate of 1.6%.From the above results, it can be obtained that among the three algorithms, the lowest error rate of the optimized AHP-KNN algorithm is lower than the other two algorithms, and this result indicates that the optimized AHP-KNN algorithm outperforms the AHP-KNN algorithm and the KNN algorithm in terms of the error rate dimension.The classification recognition rate results of the three algorithms with different K values are shown in Figure 6.
Figure 6 shows the images of the classification accuracy of the three algorithms at different K values, where Figure 6(a) shows the images of the classification accuracy at different K values in the first comparison experiment.From Figure 6(a), the classification recognition rate images of the optimized AHP-KNN algorithm are significantly higher than those of the other two algorithms.The optimized AHP-KNN algorithm has the highest classification recognition rate at K value of 6, at which time its classification recognition rate is 98.1%; the AHP-KNN algorithm also has the highest classification recognition rate at K value of 6, 96.2%.The KNN algorithm has the highest classification recognition rate at K value of 5, 93.8%. Figure 6(b) shows the classification recognition rate images at different K values in the second comparison experiment.From Figure 6(b), the classification recognition rate images of the optimized AHP-KNN algorithm are significantly higher than the other two algorithms, and the highest rate of it is also higher than the others.The above results indicate that among the three algorithms, the optimized AHP-KNN has a better highest classification recognition rate.The classification times of the three algorithms at different K values are shown in Table 3.
From Table 3, it can be obtained that in the two comparison experiments, the classification time of KNN among the three algorithms is much higher than the other two algorithms.Its classification time is around 400 seconds, while the overall difference between the classification time of optimized AHP-KNN and AHP-KNN is not much.The overall  To better improve the classification performance of the algorithms, the study will analyze the effect of the ratio of training samples on the classification performance of the algorithms, and the study sets the value of K to 6.The three algorithms are applied to two comparison experiments on data sets with different training sample ratios, and the error results are plotted as shown in Figure 7.
Figure 7 shows the scatter plots of the error results of the three algorithms in different training sample ratios.Figure 7(a) shows the scatter plots of the error results of the three algorithms in different training sample ratios in the first comparison experiment.From Figure 7(a), all three algorithms have the lowest error rate at the training sample ratio of 0.8, and the optimized AHP-KNN has the lowest error rate of 0.8%, which is much lower than the 4.2% of the AHP-KNN and the 7.8% of the KNN.possible to classify agricultural talents more accurately and accurately.Thus, it can better target the cultivation of agricultural talents and make up for the serious shortage of agricultural talents in China.

Conclusion
With the rapid development of modern technology, the demand for core talents in agricultural enterprises has greatly increased, but most agricultural practitioners do not have the required skills of agricultural talents.To improve the professional quality of agricultural professionals, this study proposes an agricultural talent training model based on AHP-KNN.It uses the optimized AHP-KNN to accurately classify agricultural professionals and then trains them according to the classification results of different types, achieving their transformation into agricultural talents.In the performance comparison experiment, it is found that the classification accuracy of the optimized AHP-KNN algorithm, AHP-KNN algorithm, and KNN algorithm is 98.1%, 96.2%, and 93.8%, respectively.The classification time of the three algorithms is 27.5 s, 30.8 s, and 400 s, respectively, which is better than the other two comparative algorithms.
In addition, this study also found that when the K value is 6, the error rates of the improved AHP-KNN algorithm, AHP-KNN algorithm, and KNN algorithm are 0.8%, 4.2%, and 7.8%, respectively.The above results show that the proposed classification algorithm has better classification performance and can improve the training efficiency of agricultural talents on this basis.Although the classification algorithm proposed in this study has good performance, the selection of agricultural talent characteristics during the experimental process is too objective and one-sided.Therefore, the future research direction is to propose a classification algorithm that can target more comprehensive agricultural talent characteristics.

Figure 1 :
Figure 1: Requirements of enterprises for agricultural talents.

Figure 5 :
Figure 5: Error rate curves of three algorithms under different K values.

Figure 7 (
b) shows the scatter plots of the error results of the three algorithms for different training sample ratios in the second comparison experiment.From Figure7(b), when the training sample ratio is 0.8, the error rate of the three algorithms is the lowest.The optimized AHP-KNN has the lowest error rate, which is significantly lower than the other two comparison algorithms.Combining the comparison results of error rate, classification recognition rate, and classification time, the optimized AHP-KNN has better classification performance.By using this algorithm to classify agricultural talents, it is

Figure 6 :
Figure 6: Classification recognition rate of three algorithms under different K values.

Table 1 :
Quality features of agricultural talents.

Table 2 :
Characteristic judgment matrix obtained by AHP algorithm.KNN algorithm is prone to classification errors due to the fact that the class with the highest number of K neighbor occurrences is tied for first.

Table 3 :
Classification time of three algorithms under different K values.