At present, the evaluation mechanism of higher education is still relatively old, with too much emphasis on theoretical assessment and insufficient assessment on practical application. Because the assessment mechanism is too single, it limits academic freedom and innovation. The inflexible educational mechanism will also lead to the shift of the focus of personnel training. Therefore, we must improve the evaluation mechanism of higher education. In this paper, the posterior probability is selected as an important part of the cost function. The cost function is combined with the Gini coefficient, which is the feature division index of random forests It is to achieve the purpose of considering the sample misclassification cost when the random forests weak classifier selects features. Squaring can increase the cost of misclassifying the actual class as a sample. It can also realize the evaluation of educational resources, and verify the experimental results by comparing the performance of a single model. The results prove that this model is more suitable for evaluating the education and training of agricultural talents. It can also measure the application value of resources to maximize the use effect of educational resources.