Agricultural product price prediction method and device based on ensemble learning, equipment and storage medium

Through the integrated learning method, feature screening and model building of agricultural product data is solved, and the limitations of agricultural product price prediction in the existing technology are achieved, and higher prediction accuracy and market adaptability are achieved.

CN119991184APending Publication Date: 2025-05-13WUHAN POLYTECHNIC UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411968809.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art has limitations in agricultural product price prediction, it is difficult to deal with complex nonlinear relationships and multivariate problems, and lacks adaptability to market dynamic changes, resulting in limited accuracy and reliability of prediction results.

Method used

Using an integrated learning-based method, by obtaining and organizing the historical and real-time data of agricultural products, building or selecting a suitable price prediction model, and filtering out the target agricultural product data to select key features that have a significant impact on price prediction.

Benefits of technology

It improves the accuracy and efficiency of agricultural product price prediction, can more accurately capture the deep laws and dynamic characteristics of price changes, adapt to market changes, and provide scientific basis to support the decision-making of agricultural producers, distributors and policy makers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991184A_ABST
    Figure CN119991184A_ABST
Patent Text Reader

Abstract

The invention discloses an agricultural product price prediction method and device based on integrated learning, equipment and a storage medium, and relates to the technical field of price prediction, and the method comprises the steps: obtaining target agricultural product data and a target agricultural product price prediction model; performing feature screening based on the target agricultural product data to obtain a target feature set; and obtaining a predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model. According to the invention, through the integrated learning and feature extraction technology, the method achieves the precise prediction of the price of the agricultural product, improves the accuracy and robustness of a prediction model, and provides more reliable price trend analysis and decision support for the participants of the agricultural product market.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of price prediction, and in particular to a method, device, equipment and storage medium for predicting agricultural product prices based on ensemble learning. Background Art

[0002] With the rapid development of the agricultural product market and the deepening of global economic integration, the fluctuation of agricultural product prices has a significant impact on agricultural producers, consumers and the entire supply chain. Accurately predicting agricultural product prices is of great significance for optimizing resource allocation, reducing market risks and improving economic benefits.

[0003] At present, agricultural product price forecasting mainly relies on traditional statistical methods and machine learning techniques. These methods include time series analysis, linear regression models, support vector machines, etc., which can predict agricultural product prices to a certain extent. However, these methods have limitations when dealing with complex nonlinear relationships and multivariate problems, and it is difficult to capture the deep laws and dynamic characteristics of price changes.

[0004] Traditional methods often have difficulty effectively dealing with noise and outliers in large-scale, high-dimensional agricultural product data, and are deficient in feature selection and model generalization. In addition, these methods usually lack adaptability to market dynamics and are difficult to update and adjust forecasting models in real time, resulting in limited accuracy and reliability of forecasting results. Therefore, how to accurately forecast agricultural product prices has become an urgent problem to be solved. Summary of the invention

[0005] The purpose of this application is to provide a method, device, equipment and storage medium for predicting agricultural product prices based on ensemble learning, aiming to solve the technical problem of how to accurately predict agricultural product prices.

[0006] To achieve the above objectives, this application proposes a method for predicting agricultural product prices based on ensemble learning, the method comprising:

[0007] Obtain target agricultural product data and target agricultural product price prediction model;

[0008] Perform feature screening based on the target agricultural product data to obtain a target feature set;

[0009] Based on the target feature set and the target agricultural product price prediction model, a predicted price of the target agricultural product is obtained.

[0010] In one embodiment, before the step of obtaining the target agricultural product data and the target agricultural product price prediction model, the step further includes:

[0011] Obtaining initial agricultural product data;

[0012] Perform missing value processing based on the initial agricultural product data to obtain reference agricultural product data;

[0013] The reference agricultural product data is subjected to time series and normalization processing to obtain target agricultural product data.

[0014] In one embodiment, feature screening is performed based on the target agricultural product data to obtain a target feature set, including:

[0015] According to the preset random forest model and the target agricultural product data, an initial feature set and initial feature weight values ​​corresponding to the initial feature set are obtained;

[0016] Based on the first preset algorithm and the initial feature set, an image feature set is obtained;

[0017] According to the preset random forest model and the image feature set, a reference feature weight value corresponding to the image feature set is obtained;

[0018] According to the initial feature weight value and the reference feature weight value, feature classification is performed on the initial feature set to obtain a reference feature set;

[0019] Feature screening is performed on the reference feature set to obtain a target feature set.

[0020] In one embodiment, performing feature screening on the reference feature set to obtain a target feature set includes:

[0021] Get the ridge regression model and regularization parameters;

[0022] According to the reference feature set, a reference feature matrix and a reference variable are obtained;

[0023] Based on the ridge regression model, the regularization parameter, the reference feature matrix and the reference variable, obtaining ridge regression estimation coefficients;

[0024] Performing cross validation based on the ridge regression estimation coefficient and the regularization parameter to obtain a reference feature subset performance;

[0025] Iterative deletion is performed based on the reference feature subset performance and the reference feature set to obtain a target feature set.

[0026] In one embodiment, before the step of obtaining the initial agricultural product data, the method further includes:

[0027] Acquire an initial agricultural product price prediction model and historical agricultural product data, wherein the initial agricultural product price prediction model comprises a base learner and a meta learner, wherein the base learner comprises a preset random forest model optimized by a genetic algorithm and a second preset algorithm;

[0028] Based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained.

[0029] In one embodiment, based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained, including:

[0030] Based on the historical agricultural product data, training data and test data are obtained, wherein the test data is obtained by calibration based on the historical agricultural product data;

[0031] Perform cross-validation based on the initial agricultural product price prediction model and the training data to obtain a reference prediction price;

[0032] Based on the test data and the reference predicted price, a loss value is obtained;

[0033] The initial agricultural product price prediction model is adjusted according to the loss value and the weight coefficient in the initial agricultural product price prediction model until the initial agricultural product price prediction model converges to obtain a target agricultural product price prediction model.

[0034] In one embodiment, after the step of obtaining the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model, the method further includes:

[0035] Based on the target agricultural product data, obtain the true value and the mean value;

[0036] Obtaining a coefficient of determination based on the true value, the mean, and the predicted price;

[0037] Based on the true value and the predicted price, a root mean square error value, a mean absolute error value, and a mean absolute percentage error value are obtained;

[0038] The evaluation of the price prediction result is completed based on the determination coefficient, the root mean square error value, the mean absolute error value and the mean absolute percentage error value.

[0039] In addition, to achieve the above purpose, the present application also proposes an agricultural product price prediction device based on ensemble learning, the device comprising:

[0040] An acquisition module, used to acquire target agricultural product data and a target agricultural product price prediction model;

[0041] An obtaining module is used to perform feature screening based on the target agricultural product data to obtain a target feature set;

[0042] The completion module is used to obtain the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model.

[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes an agricultural product price prediction device based on ensemble learning, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the agricultural product price prediction method based on ensemble learning as described above.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the agricultural product price prediction method based on ensemble learning as described above are implemented.

[0045] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the agricultural product price prediction method based on ensemble learning as described above.

[0046] One or more technical solutions proposed in this application have at least the following technical effects:

[0047] This application first collects and organizes historical and real-time data of relevant agricultural products, and constructs or selects a suitable price forecasting model to provide basic data and analysis tools for subsequent price forecasts. Then, by conducting in-depth analysis and feature extraction of the target agricultural product data, key features that have a significant impact on price forecasts are screened out, thereby improving the prediction accuracy and efficiency of the model. Finally, the future prices of agricultural products are predicted using the screened key feature set and price forecasting model to provide a scientific basis for decision-making. This application can more accurately predict agricultural product prices, provide strong decision-making support for agricultural producers, distributors, and policymakers, and thus improve the efficiency and stability of the entire agricultural product market. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 A flowchart of the first embodiment of the agricultural product price prediction method based on ensemble learning provided in this application;

[0051] Figure 2 This is a stacked ensemble learning flow chart of the initial agricultural product price prediction model of the embodiment of the present application;

[0052] Figure 3 This is a flow chart of the second embodiment of the agricultural product price prediction method based on ensemble learning of this application;

[0053] Figure 4 A schematic diagram of the screening process of the target feature set of the embodiment of the present application;

[0054] Figure 5 A brief flowchart of the agricultural product price prediction method based on ensemble learning according to an embodiment of the present application;

[0055] Figure 6 This is a schematic diagram of the module structure of the agricultural product price prediction device based on ensemble learning in an embodiment of the present application;

[0056] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the agricultural product price prediction method based on ensemble learning in the embodiment of the present application.

[0057] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0058] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0059] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0060] With the rapid development of the agricultural product market and the deepening of global economic integration, the fluctuation of agricultural product prices has a significant impact on agricultural producers, consumers and the entire supply chain. Accurately predicting agricultural product prices is of great significance for optimizing resource allocation, reducing market risks and improving economic benefits.

[0061] At present, agricultural product price forecasting mainly relies on traditional statistical methods and machine learning techniques. These methods include time series analysis, linear regression models, support vector machines, etc., which can predict agricultural product prices to a certain extent. However, these methods have limitations when dealing with complex nonlinear relationships and multivariate problems, and it is difficult to capture the deep laws and dynamic characteristics of price changes.

[0062] When faced with large-scale, high-dimensional agricultural product data, traditional methods often have difficulty effectively handling noise and outliers in the data, and are deficient in feature selection and model generalization capabilities. In addition, these methods usually lack adaptability to market dynamics and are difficult to update and adjust forecasting models in real time, resulting in limited accuracy and reliability of forecasting results.

[0063] The main solution of the embodiment of the present application is: the embodiment first provides basic data and analysis tools for subsequent price forecasts by collecting and collating historical and real-time data of relevant agricultural products, and constructing or selecting a suitable price forecasting model. Then, by conducting in-depth analysis and feature extraction of the target agricultural product data, the key features that have a significant impact on price forecasting are screened out, thereby improving the prediction accuracy and efficiency of the model. Finally, the future prices of agricultural products are predicted using the screened key feature set and price forecasting model to provide a scientific basis for decision-making. The present embodiment can more accurately predict agricultural product prices, provide powerful decision-making support for agricultural producers, distributors, and policy makers, thereby improving the efficiency and stability of the entire agricultural product market.

[0064] It should be noted that the execution subject of the embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a computer as an example to illustrate this embodiment and the following embodiments.

[0065] Based on this, the embodiment of the present application provides a method for predicting agricultural product prices based on ensemble learning. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the agricultural product price prediction method based on ensemble learning in this application.

[0066] In this embodiment, the agricultural product price prediction method based on ensemble learning includes steps S10 to S30:

[0067] Step S10, obtaining target agricultural product data and a target agricultural product price prediction model;

[0068] It should be noted that the target agricultural product data can be a series of historical and real-time data related to specific agricultural products, including but not limited to prices, supply and demand, climate conditions, market trends, etc. These data come from various sources, and may include national and provincial agricultural data, meteorological data, input and management policies and other influencing factors. The target agricultural product data is the basis for price forecasting. It needs to be obtained from various data sources through the data acquisition module, and data storage, preprocessing and other operations are performed to ensure the comprehensiveness, accuracy and quality of the data. For example, the prices of live pigs, sugar, cotton, common wheat, rapeseed oil, palm oil, soybean oil, corn, eggs, etc. in the past 15 years. The target agricultural product price prediction model can be a model based on historical data and related algorithms, established through machine learning and data mining technology, which is used to predict the future price of agricultural products. Such a model may include deep learning models such as long short-term memory neural network (LSTM), or models built based on other statistical and machine learning technologies. The target agricultural product price prediction model can efficiently reflect the impact of changes in implicit indicators on the forecast results, and provide intelligent technical support for multi-regional and cross-period agricultural outlook work.

[0069] It can be understood that by collecting historical and real-time data on specific agricultural products, including factors such as price, supply and demand, and climate, and building or selecting a suitable forecasting model, accurate data support and analysis tools are provided for subsequent price forecasts, ensuring the accuracy and effectiveness of forecasting analysis.

[0070] As an example, before the step of obtaining target agricultural product data and a target agricultural product price prediction model, it also includes: obtaining initial agricultural product data; performing missing value processing based on the initial agricultural product data to obtain reference agricultural product data; performing time series and normalization processing on the reference agricultural product data to obtain target agricultural product data.

[0071] Among them, the initial agricultural product data can be the original data set before any preprocessing. These data may come from different channels, such as market surveys, historical records, sensor data, etc., and may contain missing values, outliers, or inconsistent data formats. These data are the starting point for agricultural product price prediction, but due to various data quality issues, they cannot be directly used for model training and analysis. Reference agricultural product data refers to the data set after the initial agricultural product data is processed for missing values. Vacant value processing refers to identifying and filling missing values ​​in the data. This step can adopt a variety of methods, such as interpolation, deleting missing records, using the mean or median to fill, etc., in order to reduce noise and incompleteness in the data, thereby improving the quality of the data set. After the missing value processing, the data set becomes the reference agricultural product data, and then time series and normalization processing are required. Time series processing refers to arranging and organizing data in chronological order to reflect the changing trend of agricultural product prices over time. Normalization processing refers to scaling the data so that it falls into a small specific interval, such as [0,1]. This can eliminate the influence of different dimensions and magnitudes, making model training more stable and efficient. After completing the time series and normalization processing, the reference agricultural product data is transformed into target agricultural product data, which is ready to be used to build and train the price prediction model.

[0072] Specifically, the initial agricultural product data can be an unprocessed raw data set containing possible missing values ​​and inconsistencies; the reference agricultural product data can be the result of processing the initial data for missing values, aiming to fill or delete missing values ​​to improve data integrity; the target agricultural product data can be the data that has been further time-series arranged and normalized based on the reference data, making it suitable for model training and analysis, ensuring comparability between different features, and reflecting the changing trend of agricultural product prices over time. This continuous data processing process aims to extract accurate, clean, and standardized target agricultural product data from the raw data, providing high-quality input for subsequent price prediction models.

[0073] As an example, before the step of obtaining initial agricultural product data, it also includes: obtaining an initial agricultural product price prediction model and historical agricultural product data, the initial agricultural product price prediction model includes a base learner and a meta learner, the base learner includes a preset random forest model optimized by a genetic algorithm and a second preset algorithm; based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained.

[0074] Among them, the initial agricultural product price prediction model can be a model constructed before starting to predict agricultural product prices. This model includes two parts: a base learner and a meta learner. Base learners refer to individual learners in ensemble learning. They can be weak learners, but they are not necessarily weak learners, and sometimes they can also be strong classifiers. In this application, the base learner includes a preset random forest model optimized by a genetic algorithm and a second preset algorithm. Genetic algorithm is a search algorithm that simulates the biological evolution process and is used to optimize the parameters of the random forest model. The second preset algorithm can be the LightGBM (Light Gradient Boosting Machine) algorithm, which is an efficient machine learning algorithm based on the gradient boosting framework. It has higher efficiency and lower memory consumption when processing big data, and improves the training speed. The main function of the meta learner is to integrate the output of the base learner into a final prediction, so a model with sufficient expressive power should be selected to fuse the results of the base learner. ElasticNet is selected as a meta learner. Historical agricultural product data can be data on agricultural product prices and related influencing factors collected over a period of time in the past. These data are used to train the initial agricultural product price prediction model so that it can learn the law of price changes. Through these historical data, the model can capture various factors that affect agricultural product prices, such as seasonal changes, market supply and demand, etc., thereby improving the accuracy of the forecast.

[0075] Specifically, the initial agricultural product price prediction model can be a composite model that includes a base learner and a meta-learner, where the base learner is composed of a random forest model optimized by a genetic algorithm and another preset algorithm to capture complex patterns in the data; while the meta-learner is used to further improve the generalization ability of the model. By combining this initial model with historical agricultural product data for training and adjustment, the model parameters can be optimized, and ultimately a target agricultural product price prediction model that can more accurately predict future agricultural product prices is obtained. This process involves using historical data to train the model and optimizing the model structure through techniques such as genetic algorithms to improve the accuracy and reliability of the prediction.

[0076] As an example, based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained, including: based on the historical agricultural product data, obtaining training data and test data, the test data is calibrated based on the historical agricultural product data; cross-validating according to the initial agricultural product price prediction model and the training data to obtain a reference predicted price; obtaining a loss value based on the test data and the reference predicted price; adjusting the initial agricultural product price prediction model according to the loss value and the weight coefficient in the initial agricultural product price prediction model until the initial agricultural product price prediction model converges to obtain a target agricultural product price prediction model.

[0077] Among them, the training data can be used to train the initial agricultural product price prediction model so that it can learn the patterns and rules in the historical agricultural product data. The training data contains the prices of historical agricultural products and various features that may affect the prices, which are used to build the prediction ability of the model. The test data can be used to evaluate the prediction performance of the model. The test data is also based on the historical agricultural product data, but unlike the training data, it is used for verification after the model training is completed to check the accuracy of the model's prediction of unseen data. The difference between the predicted results of the test data and the actual value can help evaluate the generalization ability of the model. The reference predicted price can be the result obtained by predicting the training data using the trained initial agricultural product price prediction model. These predicted prices are used as a reference to compare with the actual prices in the test data to evaluate the prediction performance of the model. The loss value can be an indicator of the difference between the model's predicted price and the actual price in the test data. The smaller the loss value, the more accurate the model's prediction is, and they quantify the deviation between the predicted value and the actual value. The weight coefficient can be the relative importance assigned to different base learners or prediction results in the ensemble learning model. The weight coefficient is used to adjust the contribution of each base learner to the final prediction result to optimize the overall model performance. The adjustment of weight coefficients is usually based on the performance of the model on the validation set, with the aim of reducing the loss value and improving the prediction accuracy of the model. Figure 2 As shown, Figure 2 It is a stacked integrated learning flow chart of the initial agricultural product price prediction model in the embodiment of the present application.

[0078] Specifically, firstly, the historical agricultural product data is divided into training data and test data, where the test data is obtained by calibration of historical data and is used to evaluate the model performance. Then, the training data and the initial agricultural product price prediction model are cross-validated to obtain the reference prediction price. Then, the test data is compared with the reference prediction price to calculate the loss value, which measures the accuracy of the model prediction. According to the loss value, the weight coefficient in the initial model is adjusted, and the model is continuously optimized until the model converges, and finally a target agricultural product price prediction model that can accurately predict the price of agricultural products is obtained.

[0079] Step S20, performing feature screening based on the target agricultural product data to obtain a target feature set;

[0080] It should be noted that the target feature set can be a set of key features obtained from the target agricultural product data after the feature screening process, which are considered to have a significant impact on the performance of the agricultural product price prediction model. The purpose of feature screening is to identify and retain the features that are most important to the prediction results, while removing those irrelevant or redundant features.

[0081] It can be understood that feature screening based on the target agricultural product data to obtain a target feature set means identifying and selecting the most critical and influential features for price prediction from a large amount of target agricultural product data by applying a series of data preprocessing and analysis techniques, thereby forming a concise and information-rich target feature set. This set will be used for subsequent price prediction model training to improve the model's prediction accuracy and efficiency.

[0082] Step S30, obtaining a predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model;

[0083] It should be noted that the predicted price can be the expected price of agricultural products at a certain point in the future or within a period of time obtained by using the target feature set and the target agricultural product price prediction model. This price is calculated by the model based on historical data and learned rules by inputting the selected key features into the trained prediction model. The predicted price can help agricultural producers, distributors, retailers and consumers make more informed market decisions, such as pricing strategies, inventory management, risk assessment, etc. It is the direct output of the agricultural product price prediction method and reflects the model's ability to predict future market trends.

[0084] It can be understood that by inputting the screened key features into the trained price prediction model, the model calculates and outputs the expected price of agricultural products at a specific point in time or time period in the future based on these features and the rules learned from historical data. This price forecast can assist market participants in decision-making and planning.

[0085] As an example, after the step of obtaining the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model, the step also includes: obtaining the true value and the mean based on the target agricultural product data; obtaining the determination coefficient based on the true value, the mean and the predicted price; obtaining the root mean square error value, the mean absolute error value and the mean absolute percentage error value based on the true value and the predicted price; and completing the evaluation of the price prediction result based on the determination coefficient, the root mean square error value, the mean absolute error value and the mean absolute percentage error value.

[0086] Among them, the true value can be the actual observed agricultural product price data, and the mean refers to the average of these true values. They are the basic data for evaluating the accuracy of model prediction. The coefficient of determination (R2), also known as the R-squared value, is an important statistical indicator for measuring the accuracy of model prediction. It indicates the degree of correlation between the model prediction value and the actual observed value, and its value ranges from 0 to 1. The closer the R2 value is to 1, the higher the accuracy of the model prediction, that is, the model can better explain the variability in the data. The root mean square error (RMSE) is the square root of the average of the sum of squares of the prediction errors, which is used to measure the difference between the model prediction value and the actual value. The smaller the RMSE value, the smaller the prediction error of the model and the better the prediction effect. The mean absolute error (MAE) is the average of the absolute values ​​of the prediction errors, which is used to measure the average error between the model prediction value and the actual value. The smaller the MAE value, the smaller the prediction error of the model. The mean absolute percentage error (MAPE) is the average of the absolute values ​​of the ratio of the prediction error to the actual value, which is used to measure the proportion of the prediction error to the actual value. The smaller the MAPE value, the smaller the prediction error of the model is relative to the actual value, and the better the prediction effect is.

[0087] Specifically, the actual observed price and its mean are first calculated based on the target agricultural product data. Then, the coefficient of determination (R2) is calculated using these actual values, their means, and the prices predicted by the model, which measures the accuracy of the model prediction. Next, the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) are calculated, which measure the deviation between the predicted price and the actual price. Finally, these indicators are combined to complete a comprehensive evaluation of the price prediction results to determine the prediction performance and accuracy of the model.

[0088] This embodiment provides a method for predicting agricultural product prices based on ensemble learning. This embodiment first collects and organizes historical and real-time data of relevant agricultural products, and constructs or selects a suitable price prediction model to provide basic data and analysis tools for subsequent price prediction. Then, by conducting in-depth analysis and feature extraction of the target agricultural product data, key features that have a significant impact on price prediction are screened out, thereby improving the prediction accuracy and efficiency of the model. Finally, the future prices of agricultural products are predicted using the screened key feature set and price prediction model to provide a scientific basis for decision-making. This embodiment can more accurately predict agricultural product prices, provide powerful decision-making support for agricultural producers, distributors, and policy makers, and thus improve the efficiency and stability of the entire agricultural product market.

[0089] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , Figure 3 This is a flow chart of the second embodiment of the agricultural product price prediction method based on ensemble learning of the present application. Step S20 of the agricultural product price prediction method based on ensemble learning includes steps S21 to S25:

[0090] Step S21, obtaining an initial feature set and initial feature weight values ​​corresponding to the initial feature set according to a preset random forest model and the target agricultural product data;

[0091] It should be noted that the initial feature set can be the original feature set directly extracted from the target agricultural product data without any screening or optimization. These features may include various factors that affect agricultural product prices, such as climate conditions, seasonal changes, market supply and demand conditions, historical price trends, etc. The initial feature set provides a basis for subsequent feature selection and model training. The initial feature set can be the possible relevant features screened out by the global search capability of the Boruta algorithm. The initial feature weight value can be a weight value calculated by the random forest model for each feature in the initial feature set during the training process, indicating the importance of the feature in the model prediction. Features with higher weight values ​​have a greater impact on the model's prediction results, while features with lower weight values ​​have a smaller impact. These weight values ​​are calculated through the internal mechanism of the random forest model (such as the amount of impurity reduction based on feature splitting) and are used to evaluate the contribution of each feature to the prediction target (agricultural product price). By analyzing the initial feature set and its weight values, the features that have the greatest impact on agricultural product price prediction can be identified, providing a basis for subsequent feature screening and model optimization.

[0092] It can be understood that an initial feature set can be extracted based on the preset random forest model and target agricultural product data. This set contains all the original features that may affect the price of agricultural products. At the same time, an initial feature weight value is calculated for each feature in this set. This weight value reflects the importance of each feature in the model prediction, thereby helping to identify the features that have the greatest impact on the prediction of agricultural product prices.

[0093] Step S22, obtaining an image feature set based on the first preset algorithm and the initial feature set;

[0094] It should be noted that the image feature set may be a set of features obtained after processing the initial feature set using the first preset algorithm (Boruta algorithm). This set of features is specially selected or converted to represent the most critical visual or image information in the original data set for the prediction task.

[0095] It can be understood that the image feature set can be a set of image-related features that are screened or generated after applying a first preset algorithm to analyze and process the data in the initial feature set. These features can represent the visual effects of agricultural products, such as color, texture, shape, etc., which are of great significance for understanding and predicting the prices of agricultural products.

[0096] Step S23, obtaining a reference feature weight value corresponding to the image feature set according to the preset random forest model and the image feature set;

[0097] It should be noted that the reference feature weight value can be a quantitative indicator of the contribution of each feature to the model's prediction ability after analyzing the image feature set through a preset random forest model. These weight values ​​are usually calculated based on the contribution of the feature to the reduction of impurity when each decision tree node is split in the construction of a random forest. They can be Gini impurity reduction or information gain, etc. They reflect the importance of the feature in the random forest model. The higher the weight value, the greater the influence of the feature on predicting agricultural product prices.

[0098] It can be understood that according to the preset random forest model and image feature set, reference feature weight values ​​corresponding to the image feature set can be obtained. These weight values ​​are determined by evaluating the contribution of each image feature to reducing impurity (such as Gini impurity or information gain) when constructing a decision tree through the model, thereby quantifying the importance of each feature to agricultural product price prediction. The higher the weight value, the more important the role of the feature in the prediction model.

[0099] Step S24, performing feature classification on the initial feature set according to the initial feature weight value and the reference feature weight value to obtain a reference feature set;

[0100] It should be noted that the reference feature set can be a set of features selected after comprehensive evaluation and classification of the initial feature set according to the initial feature weight value and the reference feature weight value during the feature selection process. This set includes those features that show high importance in the two different weight value evaluations, which are considered to be the most critical and contributing features to the agricultural product price prediction model. The purpose of the reference feature set is to further streamline the feature set and exclude those features that may not be important or contribute less to the model, thereby improving the prediction efficiency and accuracy of the model.

[0101] It can be understood that the evaluation results of the importance of each feature by two different weight values ​​are comprehensively considered, and the features in the initial feature set are sorted and screened according to their contribution to the model's prediction ability, and finally a subset containing the most important features, namely the reference feature set, is determined. This set will be used to improve the accuracy and efficiency of the agricultural product price prediction model. For example, the algorithm first uses a random forest model to evaluate the contribution of each feature to the target variable. In a random forest, the importance of a feature is usually determined by calculating the "impurity" or information gain of a tree node. The random forest calculates the contribution of each feature in all decision trees to obtain the total importance of each feature. For example, Gini impurity can be used to measure the impact of each category on model performance. Based on the feature importance evaluation, the Boruta algorithm generates corresponding image features for each original feature. These image features are randomly generated by disrupting the order of the original features, and their distribution should be close to random noise, which serves as a benchmark. By comparing the importance of the original feature and the image feature, it is decided whether to retain the feature. If the importance of an original feature is significantly higher than that of the image feature, it means that the feature has a significant impact on the target variable and should be retained. On the contrary, if the importance of a feature is comparable to that of an image feature, the feature is considered redundant or irrelevant and may be deleted. If the importance is close, the feature is retained and the next round of iteration is performed. The Boruta algorithm uses a step-by-step feature selection method to continuously screen features through multiple iterations. Each round of iteration calculates the comparison results between the original features and the image features, and updates the status of each feature. The iterative process continues until all features are determined to be "important" or "irrelevant", or the preset maximum number of iterations is reached. Finally, the Boruta algorithm can effectively eliminate redundant or irrelevant features through continuous comparison and adjustment, thereby screening out features that are highly correlated with the target variable.

[0102] Step S25, performing feature screening on the reference feature set to obtain a target feature set.

[0103] It is understandable that in the final stage of feature engineering, by further analyzing and evaluating each feature in the reference feature set and using methods such as cross-validation and model performance testing, the most representative features that contribute the most to the prediction model are carefully screened out to form the final target feature set. This set will be directly used to build and train an efficient agricultural product price prediction model to ensure that the model can achieve the best prediction effect in practical applications.

[0104] As an example, feature screening is performed on the reference feature set to obtain a target feature set, including: obtaining a ridge regression model and a regularization parameter; obtaining a reference feature matrix and reference variables based on the reference feature set; obtaining ridge regression estimation coefficients based on the ridge regression model, the regularization parameter, the reference feature matrix and the reference variables; performing cross-validation based on the ridge regression estimation coefficients and the regularization parameter to obtain reference feature subset performance; and performing iterative deletion based on the reference feature subset performance and the reference feature set to obtain a target feature set.

[0105] Among them, ridge regression can be a regression analysis method for processing collinear data, which is a modified version of linear regression. The regularization parameter (such as λ) can be a parameter used to control the trade-off between bias and variance in ridge regression. It reduces the complexity of the model and prevents overfitting by adding a penalty term to the model. The reference feature matrix can be a data matrix composed of the features in the reference feature set, each row represents a sample, and each column represents a feature. The reference variable can be a response variable or a target variable, that is, a variable that you want to predict, which usually refers to the price of agricultural products in price prediction. The process of screening features can be as follows: Figure 4 As shown, Figure 4 It is a schematic diagram of the screening process of the target feature set of the embodiment of the present application. The ridge regression estimation coefficient can be a parameter estimate obtained by minimizing the residual sum of squares plus a regularization term (related to the regularization parameter). These coefficients determine the contribution of each feature in the prediction model. The reference feature subset performance can be This refers to the result of evaluating the model performance after using specific regularization parameters and estimation coefficients in the ridge regression model, which is usually completed by cross validation. Among them, the specific calculation formula of the ridge regression estimation coefficient can be:

[0106] β=(X T X+λI) -1 X T y

[0107] Where β is the ridge regression estimation coefficient, X is the feature matrix, y is the reference variable, and λ is the regularization parameter.

[0108] Specifically, first construct a reference feature matrix and determine the reference variable, and then calculate the ridge regression estimation coefficient. Then use these coefficients and regularization parameters to cross-validate to evaluate the performance of different feature subsets. Based on the performance evaluation results, the feature set is optimized by iterative deletion, and finally a streamlined target feature set with good prediction performance is obtained to improve the accuracy and efficiency of agricultural product price prediction. In this application, the ridge regression model is selected based on the recursive feature elimination method (Recursive Feature Elimination with Cross-Validation, RFECV), and the base models such as logistic regression and decision tree can also be used to evaluate the performance of each feature subset. First, RFECV will use the entire feature set to train the base model and evaluate its performance in cross-validation. The initial importance of each feature is evaluated based on the performance of the training set. In each iteration, RFECV will delete a feature, usually the least important feature, and then perform k-fold cross-validation evaluation on the subset after deleting the feature, train and verify the current feature subset multiple times, record the performance indicators of each verification, and select the best performing feature subset. If the model performs better after deleting a certain feature, the algorithm will delete the feature; conversely, if the performance decreases after deleting a certain feature, the feature will be retained. This continues until all features are evaluated and a final decision is made whether to retain them. When the optimal feature subset is reached, the RFECV algorithm stops iterating. The advantage of RFECV is that it selects the best feature subset through cross-validation, which can effectively avoid the overfitting problem that may be caused by relying solely on the training set evaluation. Cross-validation divides the data set into multiple subsets, usually k-fold cross-validation. In each iteration, part of the data is used as the validation set, and the other part is used as the training set. Verification is performed on multiple data splits to avoid the deviation that may be caused by the evaluation of a single data set, and the effect of each feature subset is evaluated in multiple model training and verification. This process ensures that the selected feature subset not only performs well on the training data, but also maintains good predictive ability on the predicted data.

[0109] This embodiment first uses a preset random forest model and target agricultural product data to extract an initial feature set and its corresponding initial feature weight values, which reflect the relative importance of each feature in the random forest model. Then, based on the first preset algorithm (which may be a feature extraction or conversion algorithm), an image feature set is further extracted from the initial feature set. This set contains features directly related to the agricultural product image. Then, the random forest model is used again to evaluate the image feature set, and reference feature weight values ​​corresponding to these features are obtained to further quantify the contribution of each image feature to price prediction. Then, by comparing the initial feature weight values ​​and the reference feature weight values, the initial feature set is classified, and those features that show importance in two different evaluations are screened out to form a reference feature set. Finally, the reference feature set is carefully screened to remove those features that contribute less to the model performance, and finally the target feature set is obtained. This set is used to construct the final agricultural product price prediction model. This embodiment gradually extracts and screens the most predictive features from the original agricultural product data. It not only involves the evaluation of the importance of features, but also the conversion and optimization of features. The final target feature set can more accurately capture the key factors affecting agricultural product prices, thereby improving the performance and reliability of the prediction model. It can ensure that the model only focuses on the most valuable information when predicting agricultural product prices, reduce noise interference, and improve the accuracy of prediction.

[0110] For example, in order to help understand the implementation process of the agricultural product price prediction method based on ensemble learning obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 5 , Figure 5 A brief flowchart of an agricultural product price prediction method based on ensemble learning is provided. Specifically:

[0111] First, feature selection is performed based on the original agricultural product data using the Boruta algorithm, and then the features are further screened using the RFECV algorithm to obtain the final feature data. Next, the data is divided into 80% training sets and 20% test sets. On the training set, genetic algorithm-optimized random forest (GA-RF) and genetic algorithm-optimized LightGBM (GA-lightGBM) are used as base learners for training, and 3-fold, 5-fold, and 10-fold cross-validation are used to improve the generalization ability of the model. Finally, the prediction results of the base learner are input into the ElasticNet meta-learner as new features to obtain the final prediction results.

[0112] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the agricultural product price prediction method based on ensemble learning of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0113] This application also provides an agricultural product price prediction device based on ensemble learning, please refer to Figure 6 , the agricultural product price prediction device based on ensemble learning comprises:

[0114] An acquisition module 10 is used to acquire target agricultural product data and a target agricultural product price prediction model;

[0115] An obtaining module 20 is used to perform feature screening based on the target agricultural product data to obtain a target feature set;

[0116] The completion module 30 is used to obtain the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model.

[0117] The agricultural product price prediction device based on ensemble learning provided by the present application adopts the agricultural product price prediction method based on ensemble learning in the above-mentioned embodiment, which can solve the technical problem of how to accurately predict the price of agricultural products. Compared with the prior art, the beneficial effects of the agricultural product price prediction device based on ensemble learning provided by the present application are the same as the beneficial effects of the agricultural product price prediction method based on ensemble learning provided by the above-mentioned embodiment, and the other technical features of the agricultural product price prediction device based on ensemble learning are the same as the features disclosed in the above-mentioned embodiment method, which will not be described in detail here.

[0118] In one embodiment, the acquisition module 10 is further used to acquire initial agricultural product data; perform missing value processing based on the initial agricultural product data to obtain reference agricultural product data; and perform time series and normalization processing on the reference agricultural product data to obtain target agricultural product data.

[0119] In one embodiment, the obtaining module 20 is also used to obtain an initial feature set and an initial feature weight value corresponding to the initial feature set based on a preset random forest model and the target agricultural product data; obtain an image feature set based on a first preset algorithm and the initial feature set; obtain a reference feature weight value corresponding to the image feature set based on the preset random forest model and the image feature set; perform feature classification on the initial feature set based on the initial feature weight value and the reference feature weight value to obtain a reference feature set; and perform feature screening on the reference feature set to obtain a target feature set.

[0120] In one embodiment, the obtaining module 20 is also used to obtain a ridge regression model and a regularization parameter; obtain a reference feature matrix and a reference variable based on the reference feature set; obtain a ridge regression estimation coefficient based on the ridge regression model, the regularization parameter, the reference feature matrix and the reference variable; perform cross-validation based on the ridge regression estimation coefficient and the regularization parameter to obtain a reference feature subset performance; perform iterative deletion based on the reference feature subset performance and the reference feature set to obtain a target feature set.

[0121] In one embodiment, the acquisition module 10 is also used to acquire an initial agricultural product price prediction model and historical agricultural product data, the initial agricultural product price prediction model includes a base learner and a meta learner, the base learner includes a preset random forest model optimized by a genetic algorithm and a second preset algorithm; based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained.

[0122] In one embodiment, the acquisition module 10 is also used to obtain training data and test data based on the historical agricultural product data, wherein the test data is calibrated based on the historical agricultural product data; cross-validate the initial agricultural product price prediction model and the training data to obtain a reference predicted price; obtain a loss value based on the test data and the reference predicted price; and adjust the initial agricultural product price prediction model according to the loss value and the weight coefficient in the initial agricultural product price prediction model until the initial agricultural product price prediction model converges to obtain a target agricultural product price prediction model.

[0123] In one embodiment, the completion module 30 is also used to obtain the true value and the mean value based on the target agricultural product data; obtain the determination coefficient based on the true value, the mean value and the predicted price; obtain the root mean square error value, the mean absolute error value and the mean absolute percentage error value based on the true value and the predicted price; and complete the evaluation of the price prediction result according to the determination coefficient, the root mean square error value, the mean absolute error value and the mean absolute percentage error value.

[0124] The present application provides an agricultural product price prediction device based on ensemble learning, and the agricultural product price prediction device based on ensemble learning includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the agricultural product price prediction method based on ensemble learning in the above-mentioned embodiment one.

[0125] Reference below Figure 7, which shows a schematic diagram of the structure of an agricultural product price prediction device based on ensemble learning suitable for implementing the embodiment of the present application. The agricultural product price prediction device based on ensemble learning in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The agricultural product price prediction device based on integrated learning shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0126] like Figure 7 As shown, the agricultural product price prediction device based on ensemble learning may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the agricultural product price prediction device based on ensemble learning are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the agricultural product price prediction device based on ensemble learning to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an agricultural product price prediction device based on ensemble learning with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0127] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0128] The agricultural product price prediction device based on ensemble learning provided by the present application adopts the agricultural product price prediction method based on ensemble learning in the above embodiment, which can solve the technical problem of how to accurately predict the price of agricultural products. Compared with the prior art, the beneficial effects of the agricultural product price prediction device based on ensemble learning provided by the present application are the same as the beneficial effects of the agricultural product price prediction method based on ensemble learning provided by the above embodiment, and the other technical features in the agricultural product price prediction device based on ensemble learning are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0129] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0131] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the agricultural product price prediction method based on integrated learning in the above-mentioned embodiment.

[0132] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0133] The above-mentioned computer-readable storage medium may be included in the agricultural product price prediction device based on integrated learning; or it may exist independently without being assembled into the agricultural product price prediction device based on integrated learning.

[0134] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the agricultural product price prediction device based on ensemble learning, the agricultural product price prediction device based on ensemble learning: obtains target agricultural product data and a target agricultural product price prediction model; performs feature screening based on the target agricultural product data to obtain a target feature set; and obtains a predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model.

[0135] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0136] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0137] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0138] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned agricultural product price prediction method based on ensemble learning, and can solve the technical problem of how to accurately predict agricultural product prices. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the agricultural product price prediction method based on ensemble learning provided in the above-mentioned embodiment, and will not be repeated here.

[0139] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned agricultural product price prediction method based on ensemble learning.

[0140] The computer program product provided by this application can solve the technical problem of how to accurately predict the price of agricultural products. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the agricultural product price prediction method based on ensemble learning provided by the above embodiment, which will not be repeated here.

[0141] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for predicting agricultural product prices based on ensemble learning, characterized in that: The method comprises: Obtain target agricultural product data and target agricultural product price prediction model; Perform feature screening based on the target agricultural product data to obtain a target feature set; Based on the target feature set and the target agricultural product price prediction model, a predicted price of the target agricultural product is obtained.

2. The method according to claim 1, characterized in that Before the step of obtaining the target agricultural product data and the target agricultural product price prediction model, the method further includes: Obtaining initial agricultural product data; Perform missing value processing based on the initial agricultural product data to obtain reference agricultural product data; The reference agricultural product data is subjected to time series and normalization processing to obtain target agricultural product data.

3. The method according to claim 1, characterized in that The feature screening based on the target agricultural product data to obtain a target feature set includes: According to the preset random forest model and the target agricultural product data, an initial feature set and initial feature weight values ​​corresponding to the initial feature set are obtained; Based on the first preset algorithm and the initial feature set, an image feature set is obtained; According to the preset random forest model and the image feature set, a reference feature weight value corresponding to the image feature set is obtained; According to the initial feature weight value and the reference feature weight value, feature classification is performed on the initial feature set to obtain a reference feature set; Feature screening is performed on the reference feature set to obtain a target feature set.

4. The method according to claim 3, characterized in that The step of screening the reference feature set to obtain a target feature set includes: Get the ridge regression model and regularization parameters; According to the reference feature set, a reference feature matrix and a reference variable are obtained; Based on the ridge regression model, the regularization parameter, the reference feature matrix and the reference variable, obtaining ridge regression estimation coefficients; Performing cross validation based on the ridge regression estimation coefficient and the regularization parameter to obtain a reference feature subset performance; Iterative deletion is performed based on the reference feature subset performance and the reference feature set to obtain a target feature set.

5. The method according to claim 2, characterized in that Before the step of obtaining the initial agricultural product data, the method further includes: Acquire an initial agricultural product price prediction model and historical agricultural product data, wherein the initial agricultural product price prediction model comprises a base learner and a meta learner, wherein the base learner comprises a preset random forest model optimized by a genetic algorithm and a second preset algorithm; Based on the initial agricultural product price prediction model and the historical agricultural product data, a target agricultural product price prediction model is obtained.

6. The method according to claim 5, characterized in that The step of obtaining a target agricultural product price prediction model based on the initial agricultural product price prediction model and the historical agricultural product data includes: Based on the historical agricultural product data, training data and test data are obtained, wherein the test data is obtained by calibration based on the historical agricultural product data; Perform cross-validation based on the initial agricultural product price prediction model and the training data to obtain a reference prediction price; Based on the test data and the reference predicted price, a loss value is obtained; The initial agricultural product price prediction model is adjusted according to the loss value and the weight coefficient in the initial agricultural product price prediction model until the initial agricultural product price prediction model converges to obtain a target agricultural product price prediction model.

7. The method according to claim 1, characterized in that After the step of obtaining the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model, the method further includes: Based on the target agricultural product data, obtain the true value and the mean value; Obtaining a coefficient of determination based on the true value, the mean, and the predicted price; Based on the true value and the predicted price, a root mean square error value, a mean absolute error value, and a mean absolute percentage error value are obtained; The evaluation of the price prediction result is completed based on the determination coefficient, the root mean square error value, the mean absolute error value and the mean absolute percentage error value.

8. An agricultural product price prediction device based on ensemble learning, characterized in that: The device comprises: An acquisition module, used to acquire target agricultural product data and a target agricultural product price prediction model; An obtaining module is used to perform feature screening based on the target agricultural product data to obtain a target feature set; The completion module is used to obtain the predicted price of the target agricultural product based on the target feature set and the target agricultural product price prediction model.

9. An agricultural product price prediction device based on ensemble learning, characterized in that: The device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the agricultural product price prediction method based on ensemble learning as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the agricultural product price prediction method based on ensemble learning as described in any one of claims 1 to 7 are implemented.