Prediction method, computing device and readable storage medium
By introducing a combined prediction method of seasonal feature extraction model and integrated learning model in the model prediction method, the problem of inability to effectively match the seasonal characteristics of data in the prior art is solved, and more accurate prediction of seasonal business data is achieved.
Patent Information
- Application Number
- CN202411995420.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-14
AI Technical Summary
The existing model prediction methods cannot effectively match the seasonal characteristics of the data, resulting in insufficient accuracy in predicting business data with seasonal changes.
By obtaining time series data samples of the target business, the seasonal feature extraction model is used to extract seasonal features, and input them into the integrated learning model for combined prediction to improve prediction accuracy.
This method can fit real results more accurately and improve the prediction accuracy of the integrated learning model for seasonally changing business data.
Smart Images

Figure CN119622271A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent management technology, and in particular to a prediction method, a computing device, and a computer-readable storage medium. Background Art
[0002] In some current implementations, the prediction methods for data may include artificial experience prediction methods, model prediction methods, etc. Among them, the model prediction method has gradually become the mainstream prediction method due to its high efficiency and controllability of prediction standards.
[0003] However, the current model prediction method cannot match the seasonal characteristics of the data (for example, when the data drops significantly in winter, a single model will still maintain a high prediction value and cannot accurately fit the actual results). Therefore, in the process of conceiving and implementing this application, the inventors found that there are at least the following problems: For businesses with seasonal changes, how to improve the prediction accuracy of the prediction model for its data. Summary of the invention
[0004] The purpose of the present application is to provide a prediction method, a computing device, and a computer-readable storage medium, which can improve the prediction accuracy of a prediction model for data of businesses with seasonal changes.
[0005] To achieve the above objectives: In a first aspect, an embodiment of the present application provides a prediction method, comprising: obtaining a first data set of a target business, the first data set comprising a first time series data sample of the target business, the first time series data sample comprising first feature information comprising a first seasonal feature extracted by a first seasonal feature extraction model; inputting first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business.
[0006] In one embodiment, the step of obtaining a first data set of a target business includes: collecting historical time series data samples of the target business to construct a first initial data set of the target business; obtaining first feature information corresponding to each historical time series data sample based on the first initial data set and a first seasonal feature extraction model, the first feature information including a first seasonal feature and a first trend prediction value; adding the first feature information to the corresponding historical time series data samples to obtain a first time series data sample; and aggregating the first time series data samples to obtain a first data set.
[0007] In one embodiment, determining first input data according to a first data set includes: determining an associated business of a target business according to the first data set; obtaining a second prediction result of the associated business; and using the first data set and the second prediction result as the first input data.
[0008] In one embodiment, the step of obtaining a second prediction result of the associated business includes: obtaining a second data set of the associated business; and obtaining a second prediction result based on the second data set and a pre-built prediction model.
[0009] In one embodiment, the second data set includes second time series data samples; the step of obtaining a second prediction result based on the second data set and a pre-built prediction model includes: obtaining second feature information corresponding to each second time series data sample based on the second data set and a second seasonal feature extraction model, the second feature information including a second seasonal feature; adding each second feature information to the corresponding second time series data sample to update the second data set; inputting the second input data determined based on the second data set into a pre-built second integrated learning model, so that the second integrated learning model uses multiple basic models for combined prediction to output a second prediction result for the related business.
[0010] In one embodiment, the steps of building the first integrated learning model or the second integrated learning model include: dividing the training data set into a preset number of sub-data sets in a cross-validation manner; training and predicting each sub-data set using a different basic model to generate a third prediction result respectively; combining features according to the third prediction results corresponding to each basic model to obtain a new training data set; training a meta-model according to the new training data set to obtain a meta-model; and using the meta-model to make a final prediction on the prediction results of the test data to obtain the prediction output of the first integrated learning model or the second integrated learning model.
[0011] In one embodiment, after the first input data determined according to the first data set is input into a pre-built first integrated learning model so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business, the method includes: obtaining a new first time series data sample according to the first prediction result of the target business; optimizing and training the first integrated learning model through the new first time series data sample to update the first integrated learning model.
[0012] In one implementation, the target business is the agricultural machinery parts distribution business, and the related businesses include the agricultural machinery sales business and the crop yield statistics business.
[0013] In one embodiment, the first seasonal feature extraction model is a SARIMA model.
[0014] In one embodiment, the second seasonal feature extraction model is a SARIMA model.
[0015] In one embodiment, the plurality of base models include at least two of support vector machines, XGBoost, RBF, and random forests.
[0016] In a second aspect, an embodiment of the present application provides a computing device, comprising: a processor and a memory storing a computer program, and when the processor runs the computer program, the steps of the prediction method described in any one of the above items are implemented.
[0017] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the prediction method described in any one of the above items are implemented.
[0018] The prediction method, computing device and computer-readable storage medium provided by the embodiments of the present application, the prediction method includes: obtaining a first data set of the target business, the first data set includes a first time series data sample of the target business, the first time series data sample includes first feature information including a first seasonal feature extracted by a first seasonal feature extraction model; inputting the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business. In this way, the technical solution of the present application can conveniently construct a data set of the target business including a time series data sample with seasonal characteristics through a seasonal feature extraction model, and perform predictive analysis on the data set of the target business through an integrated learning model, thereby improving the accuracy of the integrated learning model's data prediction for the target business with seasonal changes, so that the data prediction results can better fit the actual results. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0020] Figure 1 It is a flowchart of the prediction method provided in the embodiment of the present application.
[0021] Figure 2 It is a framework diagram of the agricultural machinery parts distribution and allocation data prediction model according to the embodiment of the present application.
[0022] Figure 3It is a schematic diagram of a framework for building an integrated learning model in a stacking manner according to an example of an embodiment of the present application.
[0023] Figure 4 It is a schematic diagram of the structure of the computing device provided in an embodiment of the present application.
[0024] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0026] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0027] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.
[0028] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0029] It should be noted that, in this article, step codes such as S11, S12, etc. are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the sequence. When implementing it specifically, those skilled in the art may execute S12 first and then S11, etc., but these should all be within the scope of protection of this application.
[0030] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0032] See also Figure 1 , is a prediction method provided in an embodiment of the present application. The method can be executed by a computing device provided in an embodiment of the present application. The computing device can be implemented in software and / or hardware.
[0033] The prediction method provided in this embodiment includes the following steps (for example, step S11 to step S12): Step S11: Acquire a first data set of a target business, the first data set includes a first time series data sample of the target business, the first time series data sample includes first feature information including a first seasonal feature extracted by a first seasonal feature extraction model.
[0034] In one embodiment, the target business may represent a business with seasonal changes in data. Alternatively, the seasonal changes may represent a pattern or trend that recurs periodically over time.
[0035] In one embodiment, businesses with seasonal changes are very common. The following are examples of some common industries and business areas that are affected by seasonal factors: (1) Retail industry, such as holiday sales peaks and seasonal product sales (such as winter clothing, summer swimwear, etc.); (2) Tourism: peak and off-season; (3) Agriculture: seasonality of crop planting and harvesting, such as sowing in spring and harvesting in autumn; seasonality of agricultural machinery sales and agricultural machinery parts sales; (4) Construction industry: Due to the influence of weather, construction activities may increase in warm seasons; (5) Energy industry: Electricity and natural gas demand peaks in winter and summer; (6) Catering industry: Increased demand for catering during holidays and special events; (7) Hotel industry: Hotel occupancy rates increase during the peak tourist season; (8) Transportation industry: Traffic volume increases during holidays; (9) Education industry: seasonal changes in the number of students due to school openings and holidays; (10) Healthcare industry: flu season and health issues related to summer travel; (11) Advertising and marketing: advertising for specific festivals and seasonal events; (12) Financial services: cash flows resulting from year-end bonus payments and holiday spending; (13) Recreation and Sports: seasonality of sporting events and outdoor activities; (14) Real estate: The peak of home buying and leasing activities usually occurs in seasons with better weather; (15) Manufacturing: The production and sales of certain products may vary according to the season, such as heating equipment in winter; (16) Fisheries: fishing seasons for fish and other marine life; (17) Landscaping: seasonal work of planting and maintaining plants; (18) E-commerce: Online shopping peaks during specific holidays.
[0036] These industries and business areas need to determine relevant data based on seasonal changes as the basis for adjusting inventory management, material distribution management, marketing strategies, human resource planning and financial budgeting to maximize profits and efficiency.
[0037] In one embodiment, the time series data sample may represent the observed value or specific information of a specific phenomenon or characteristic variable of a specific business changing over time. Optionally, the specific phenomenon or characteristic variable is arranged in chronological order, which may be a frequency such as per second, per minute, per hour, per day, per week, per month or per year.
[0038] In one embodiment, the first time series data sample including the first seasonal feature may be characterized by using the first seasonal feature as a feature variable in the time series data sample.
[0039] In one implementation, the first seasonal feature may represent a seasonal prediction value corresponding to a specific time point or a specific period in the time series data sample.
[0040] In one embodiment, the first seasonal feature extraction model may represent a seasonal feature extraction model, that is, the feature information related to the seasonal characteristics of the time series data samples may be extracted.
[0041] In one embodiment, a seasonal feature extraction model is used, such as a seasonal autoregressive moving average model (SARIMA model), a seasonal decomposition model (STL model), and the like.
[0042] In one embodiment, the first feature information may represent feature information related to seasonal characteristics of the time series data sample, such as seasonal characteristics, trend prediction values, etc.
[0043] In one embodiment, step S11: obtaining a first data set of a target business may include: collecting historical time series data samples of the target business to construct a first initial data set of the target business; obtaining first feature information corresponding to each historical time series data sample based on the first initial data set and a first seasonal feature extraction model, the first feature information including a first seasonal feature and a first trend prediction value; adding the first feature information to the corresponding historical time series data sample to obtain a first time series data sample; and aggregating the first time series data samples to obtain a first data set.
[0044] In one embodiment, the historical time series data samples may represent the observed values or specific information of a specific phenomenon or characteristic variable of the target business in the past operation over time.
[0045] In one embodiment, the first initial data set may include one or more historical time series data samples of the target business.
[0046] In one embodiment, the first feature information is added to the corresponding historical time series data sample as a newly added feature variable of the historical time series data sample, so that the historical time series data sample is used as or updated to be the first time series data sample.
[0047] In one embodiment, the first data set may include one or more first time series data samples of the target business.
[0048] In this way, the technical solution of this embodiment can not only use the historical data (historical time series data samples) of the target business to construct an initial data set, so that the subsequent prediction model can predict the data results according to the historical operating rules of the target business, so that the prediction results output by the prediction model can better fit the actual results. In addition, the technical solution of this embodiment can also use the seasonal feature extraction model to conveniently add seasonal characteristics and / or trend prediction values to the historical data as new feature variables to update the historical data, so that the updated historical data (first time series data samples) can be used subsequently to further improve the prediction accuracy of the prediction model for the data of the target business with seasonal changes, thereby making the data prediction results can further fit the actual results.
[0049] Step S12: inputting the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models to perform combined prediction to output a first prediction result of the target business.
[0050] In one embodiment, the first integrated learning model may represent a prediction model constructed by multiple basic models in a preset integration manner. Optionally, the preset integration manner may represent a method of logically combining the inputs and / or outputs of multiple basic models to achieve a data prediction function, such as a stacking method, a bagging method, a blending method, etc.
[0051] In one embodiment, the core idea of the stacking method is to input the prediction results of multiple basic models (or base learners) as new features into another model (called a meta-model or a meta-learner or a secondary learner) to improve the overall prediction performance. Optionally, the key steps and features of the stacking method may include: (1) Training basic models: First, train multiple different basic models, which can be different types of models such as decision trees, support vector machines, neural networks, XGBoost, RBF, and random forests. Each basic model can be trained independently; (2) Generate first-level prediction results: Use these basic models to predict the training set or another data set to obtain the prediction results of each model; (3) Constructing a secondary learner: The prediction results of the basic model are input into a secondary learner as new features. This secondary learner is also called a meta-model (meta-learner). (4) Obtain the final prediction result: Use the meta-model to perform a secondary prediction on the prediction result of the basic model to obtain the final prediction result; (5) Cross-validation: In order to prevent overfitting, cross-validation is usually used during the training process. For example, the data set can be divided into K parts, and K-1 parts of the data are used for training each time, and the remaining part of the data is used for validation. In this way, each data point is only used for validation once, thereby obtaining a more accurate model performance evaluation; (6) Implementation code: In practical applications, the stacked ensemble model can be implemented by writing code. The code will include the training and prediction of the basic model, as well as the training and prediction of the meta-model.
[0052] The stacking method can fully utilize the advantages of different models to improve the accuracy and robustness of predictions. The stacking method can dynamically train and generate prediction models during runtime, optimize data preprocessing and model training steps, and improve the efficiency and accuracy of predictions.
[0053] In one embodiment, bagging is a parallel ensemble learning method that generates multiple sub-datasets by performing multiple random samplings with replacement on the original data set, and training a basic model on each sub-dataset, and finally averaging or voting the prediction results of these basic models. One of the most famous bagging methods is random forest, which further improves the diversity and stability of the model by performing bagging on the basis of decision trees and randomly selecting some features when constructing each decision tree.
[0054] In one embodiment, the blending approach follows the same method as the stacking approach, but only uses a holdout set / validation set from the training set to make predictions. The holdout set is used to build a predictive model that runs on the test set. This process involves splitting the original training data into a training set and a validation set, then fitting the model on the training set, making predictions on the validation set and test set, using the validation set and its predictions as features to build a new model, and finally using the new model to make final predictions on the test set and meta-features.
[0055] In one embodiment, the ensemble learning model can improve the performance and generalization ability of the overall model by combining the prediction results of multiple base models.
[0056] The technical solution of this embodiment performs prediction in two stages: seasonal feature modeling and ensemble learning, and further integrates by stacking, that is, a combination of seasonal feature extraction models (SARIMA models) under multiple different configurations + ensemble learning models to obtain more stable prediction performance, fully integrate the characteristics of each data set, and improve the accuracy of the model.
[0057] In one implementation, the technical solution of this embodiment can give full play to the advantages of selecting basic models with low deviation from the weak classifier algorithm library, while eliminating the disadvantages of high variance of each basic model for integration, so as to form a high-precision prediction model with strong generalization ability, low deviation and low variance.
[0058] In one implementation, determining the first input data according to the first data set may include, but is not limited to, one of the following situations: Using the first data set as first input data; Determine the associated business of the target business according to the first data set; obtain a second prediction result of the associated business; and use the first data set and the second prediction result as first input data.
[0059] In one implementation, using the first data set as the first input data can enable the integrated learning model to obtain input data more efficiently, thereby improving the output efficiency of the prediction results.
[0060] In one implementation, the associated business of the target business may represent other businesses that have a logical or causal relationship with the formation of specific data of the target business, or businesses whose formed data have a direct or indirect impact on the formation of data of the target business. For example, taking the agricultural machinery sales business as the target business, the sales volume of agricultural machinery in the agricultural machinery sales business is directly affected by the crop yield (the higher the crop yield, the higher the agricultural machinery sales volume; the lower the crop yield, the lower the agricultural machinery sales volume), then the crop yield statistics business can be regarded as an associated business of the agricultural machinery sales business; for another example, taking the agricultural machinery parts distribution business as the target business, the distribution volume in the current region of the agricultural machinery parts distribution business is directly affected by the sales volume of agricultural machinery in the agricultural machinery sales business (the higher the agricultural machinery sales volume, the more the distribution volume in the current region; the lower the agricultural machinery sales volume, the less the distribution volume in the current region), and the sales volume of agricultural machinery in the agricultural machinery sales business is directly affected by the crop yield (that is, the distribution volume in the current region of the agricultural machinery parts distribution business is indirectly affected by the crop yield; and the higher the crop yield, the more the distribution volume in the current region; the lower the crop yield, the less the distribution volume in the current region), then the agricultural machinery sales business and the crop yield statistics business can each be regarded as an associated business of the agricultural machinery sales business.
[0061] In one implementation, the second prediction result of the associated service may be obtained by prediction through model prediction or by manual experience estimation.
[0062] In one embodiment, using the first data set and the second prediction result of the related business as the first input data can provide more effective data for the integrated learning model, and can further improve the prediction results output by the integrated learning model to better fit the actual results, thereby further improving the data prediction accuracy of the integrated learning model for target businesses with seasonal changes.
[0063] In one embodiment, the step of obtaining a second prediction result of the associated business includes: obtaining a second data set of the associated business; and obtaining a second prediction result based on the second data set and a pre-built prediction model.
[0064] In one embodiment, the second data set can be obtained based on historical time series data samples of the associated business, so that the subsequent prediction model can predict the data results according to the historical operating rules of the associated business, so that the prediction results output by the prediction model can better fit the actual results of the associated business.
[0065] In one embodiment, the second data set includes second time series data samples; the step of obtaining a second prediction result based on the second data set and a pre-built prediction model includes: obtaining second feature information corresponding to each second time series data sample based on the second data set and a second seasonal feature extraction model, the second feature information including a second seasonal feature; adding each second feature information to the corresponding second time series data sample to update the second data set; inputting the second input data determined based on the second data set into a pre-built second integrated learning model, so that the second integrated learning model uses multiple basic models for combined prediction to output a second prediction result for the related business.
[0066] In one embodiment, the second seasonal feature extraction model and the second integrated learning model described herein can be only a distinguishing description from the aforementioned first seasonal feature extraction model and the first integrated learning model, which are used to distinguish the same type of information or features from each other for easy understanding. Therefore, the specific implementation of the second seasonal feature extraction model and the second integrated learning model described herein can refer to the relevant content of the first seasonal feature extraction model and the first integrated learning model, and will not be repeated here.
[0067] The technical solution of this embodiment can conveniently construct a data set of related businesses including time series data samples with seasonal characteristics through a seasonal feature extraction model, and perform predictive analysis on the data set of related businesses through an integrated learning model, thereby improving the data prediction accuracy of the integrated learning model for related businesses with seasonal changes, so that the data prediction results of the related businesses can better fit the actual results of the related businesses. In this way, the technical solution of this embodiment uses the first data set and the second prediction result of the related business as the first input data, which can provide more accurate and effective auxiliary data for the integrated learning model, and can further enable the prediction results of the target business output by the integrated learning model to better fit the actual results of the target business, thereby further improving the data prediction accuracy of the integrated learning model for target businesses with seasonal changes.
[0068] In one embodiment, the first time series data sample may include feature variables formed by data corresponding to the associated business. In this way, the first time series data sample of this embodiment can directly reflect the relationship between the data of the target business and the data of the associated business, so that the integrated learning model can better learn and predict.
[0069] In one embodiment, the steps of building the first integrated learning model or the second integrated learning model include: dividing the training data set into a preset number of sub-data sets in a cross-validation manner; using different basic models to train and predict each sub-data set to generate a third prediction result respectively; combining features according to the third prediction results corresponding to each basic model to obtain a new training data set; training a meta-model according to the new training data set to obtain a meta-model; using the meta-model to make a final prediction on the prediction results of the test data to obtain the prediction output of the first integrated learning model or the second integrated learning model. In this way, the technical solution of this embodiment can build an integrated learning model by stacking, and its beneficial effects include at least: (1) Improved prediction accuracy: By combining the prediction results of multiple base models, the stacked model (ensemble learning model) can capture the complex patterns and relationships in the data more accurately than a single model, thereby improving the accuracy of the prediction; (2) Reduce the risk of overfitting: Since the stacked model uses multiple different base models, it can reduce the possible overfitting problem of a single model, especially when there is diversity among the base models; (3) Reduce model variance: The stacked model can reduce the model variance and improve the model stability by averaging or weighting the prediction results of multiple basic models; (4) Enhanced generalization ability: The stacked model can learn from multiple base models, which helps the model perform better on unknown data and enhances the generalization ability of the model; (5) Utilizing model diversity: By using different types of base models, stacked models can capture different types of information in the data and utilize model diversity to improve overall performance; (6) Flexibility and scalability: The stacked model can easily add or replace the base model to adapt to different data sets and problems, and has good flexibility and scalability; (7) Improved robustness: The stacked model is more robust to outliers and noisy data because it relies on the consensus of multiple base models rather than the output of a single model; (8) Strong adaptability: The stacked model can adapt to changes in data distribution because it combines the predictions of multiple base models, which may have different sensitivities to data changes; (9) Improving decision quality: In business and finance, stacking models can help decision makers improve the quality of their decisions by providing more accurate predictions. (10) Model interpretability: Although some base models may be difficult to interpret, stacked models can be used together with interpretable base models to improve the interpretability of the overall model; (11) Combating model decay: In dynamic environments, data distribution may change over time, and stacked models can combat model decay by periodically updating their components.
[0070] In this way, the ensemble learning model becomes a powerful tool, especially in scenarios that require high-accuracy and high-stability predictions, and the output prediction results can better fit the actual results.
[0071] In one embodiment, step S12: inputting the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business, may include: obtaining a new first time series data sample according to the first prediction result of the target business; optimizing and training the first integrated learning model through the new first time series data sample to update the first integrated learning model.
[0072] In one embodiment, after obtaining the prediction result of the target business, the target result can be evaluated and optimized, so that a new first time series data sample can be determined according to the optimized prediction result, and the integrated learning model can be iteratively trained.
[0073] The prediction method provided in this embodiment includes: step S11: obtaining a first data set of the target business, the first data set includes a first time series data sample of the target business, and the first time series data sample includes first feature information including a first seasonal feature extracted by a first seasonal feature extraction model; step S12: inputting the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business. In this way, the technical solution of this embodiment can conveniently construct a data set of the target business including a time series data sample with seasonal characteristics through a seasonal feature extraction model, and perform predictive analysis on the data set of the target business through an integrated learning model, thereby improving the accuracy of data prediction of the integrated learning model for target businesses with seasonal changes, so that the data prediction results can better fit the actual results.
[0074] Based on the same inventive concept as the above embodiments, the above embodiments are exemplarily described below through a specific application scenario: See also Figure 2 This embodiment illustrates a method for predicting data of distribution and allocation of spare parts for agricultural machinery, including: 1. Obtain the agricultural machinery sales data set (data set of the first related business), the crop yield data set (data set of the second related business), and the spare parts distribution and allocation data set of previous years (data set of the target business) to form a training data set.
[0075] 2. A SARIMA model (seasonal ARIMA modeling) is trained for the agricultural machinery sales data set, crop yield data set and spare parts distribution and allocation data set with seasonal characteristics in previous years, and the SARIMA model is used to generate trend forecast values and seasonal forecast values for agricultural machinery sales data in the future time period, trend forecast values and seasonal forecast values for crop yield data in the future time period, and trend forecast values and seasonal forecast values for spare parts distribution and allocation data in the future time period.
[0076] 3. The trend forecast values, seasonal forecast values and other relevant features output by the SARIMA model are merged into their respective data sets as input features as newly added feature variables.
[0077] Optionally, the trend prediction value and seasonal prediction value of the agricultural machinery sales data are merged into the corresponding agricultural machinery sales data set samples (ie, time series data samples) in the agricultural machinery sales data set.
[0078] Optionally, the trend prediction value and seasonal prediction value of the crop yield data are merged into corresponding crop yield data samples in the crop yield data set.
[0079] Optionally, the trend prediction value and seasonal prediction value of the accessories distribution and allocation data are merged into the corresponding accessories distribution and allocation data samples in the accessories distribution and allocation data set.
[0080] 4. Use the trained ensemble learning model to perform data prediction on the agricultural machinery sales data set and the crop yield data set, respectively, to output the prediction results for the agricultural machinery sales data and the crop yield data, respectively.
[0081] 5. Combine the prediction results corresponding to the agricultural machinery sales data, the prediction results corresponding to the crop yield data, and the spare parts distribution and allocation data set containing seasonal prediction values into a meta-data set, and use the ensemble learning model to predict the meta-data set to obtain the final prediction results of the spare parts distribution and allocation data (such as trend prediction values).
[0082] 6. Evaluate and optimize the ensemble learning model within the framework of ensemble learning, and iteratively train the ensemble learning model.
[0083] See also Figure 3 The steps for training the ensemble learning model using stacking method may include: 1. Dataset division: First, the training dataset is divided into five subsets. These subsets are divided using cross-validation.
[0084] 2. Basic model training and prediction: For each subset, a different basic model is used for training and prediction. These basic models can be any machine learning algorithms, including seasonal ARIMA models, SVM, XGBoost, RBF, random forest and other machine learning models. Each basic model will train the subset and generate prediction results for unknown data.
[0085] 3. Feature combination: The prediction results of each basic model are used as new features and combined into a new training data set. These prediction results can be used as a supplement to the original features to provide more information to train the meta-model.
[0086] 4. Metamodel training: Use the new training data set to train a metamodel. The metamodel can be any machine learning algorithm, and the goal of the metamodel is to learn how to combine the prediction results of the base model to maximize the accuracy of the overall model.
[0087] 5. Prediction: Finally, use the trained meta-model to predict the test data. The meta-model will combine and weight the prediction results of the basic models to generate the final prediction results.
[0088] Optionally, the technical solution equipment of this example supports, including but not limited to: 1) a computer; 2) a sklearn machine learning framework. Optionally, the computer is used to run the python program and configure the PC program.
[0089] The technical concept of the technical solution of this example at least includes: 1) By combining multiple basic models (SVM, XGBoost, RBF, random forest and other machine learning models) and seasonal ARIMA model (SARIMA model) through ensemble learning technology, the prediction model is dynamically trained and generated during operation, which optimizes the data preprocessing and model training steps and improves the efficiency and accuracy of prediction; 2) Forecasting is performed in two stages: seasonal feature modeling and ensemble learning. The model is further integrated by stacking, that is, a combination of seasonal feature extraction models (SARIMA models) with multiple different configurations + ensemble learning models to obtain more stable forecasting performance, fully integrate the characteristics of each data set, and improve the accuracy of the model. 3) Make full use of the weak classifier algorithm library to select the basic models with low bias advantages, and at the same time eliminate the disadvantages of high variance of each basic model for integration, so as to form a high-precision prediction model with strong generalization ability, low bias and low variance.
[0090] With the rapid development of agricultural mechanization, the demand for agricultural machinery parts is increasing, which puts higher requirements on parts supply chain management. As an important part of supply chain management, the efficiency and accuracy of parts distribution and allocation business directly affect the normal operation of agricultural machinery and the economic benefits of enterprises. The technical solution of this example solves the problem that traditional parts allocation methods rely heavily on manual experience, have problems such as inaccurate predictions and low efficiency, and cannot meet the needs of modern agricultural machinery parts supply chain management. In addition, the use of an integrated learning model in the technical solution of this embodiment can reduce data preprocessing and model training steps, so that the update and release cycle of the prediction model is short and flexible.
[0091] In addition, the technical solution of this example can also solve the problem that in some current implementations, the agricultural machinery parts distribution and allocation data prediction model mainly focuses on the training of a single model, which cannot effectively match the seasonal characteristics of the data, resulting in limited prediction results. The technical solution of this example can also avoid the situation in which, in some implementations, the agricultural machinery parts distribution and allocation data prediction model mainly relies on a single deep learning method, and the model is underfitted due to insufficient data volume, thereby reducing the accuracy of the prediction.
[0092] Optionally, the agricultural machinery parts distribution allocation data prediction method provided in this example can accurately predict future parts distribution needs by analyzing historical time series data and combining ensemble learning technology. Ensemble learning improves the performance and generalization ability of the prediction model by building and combining multiple learners (basic models), thereby improving the efficiency and accuracy of parts distribution.
[0093] The technical solution of this example combines ensemble learning technology: by integrating multiple basic models (such as support vector machines, XGBoost, RBF, and random forest machine learning models) with the seasonal ARIMA model, the model's ability to adapt to seasonal changes in data is improved, effectively matching the seasonal characteristics of the data.
[0094] The technical solution of this example can realize the combination of deep learning and traditional methods: in the context of small data volume, deep learning and traditional machine learning methods can be combined to avoid the underfitting problem of deep learning models when the data volume is insufficient, while using traditional machine learning methods to effectively extract seasonal features.
[0095] The technical solution of this example can not only achieve more accurate prediction of agricultural machinery parts distribution and allocation data, but also improve the matching and reliability of the prediction results, and provide more accurate data support for the modern agricultural machinery parts supply chain management, thereby improving the management level of the agricultural machinery parts supply chain. It can also provide data support for enterprises, optimize inventory structure, reduce operating costs, and enhance market competitiveness.
[0096] Based on the same inventive concept as the above embodiments, the present application embodiment provides a computing device, such as Figure 4 As shown, the device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 4 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 4 The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In actual applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the prediction method applied to the above device is implemented, such as Figure 1 The shown step S11: obtain a first data set of the target business, the first data set includes a first time series data sample of the target business, and the first time series data sample includes first feature information including a first seasonal feature extracted by a first seasonal feature extraction model; step S12: input the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business.
[0097] The device may also include: at least one network interface 312. The various components in the device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 4 Various buses are labeled as bus system 313.
[0098] The memory 311 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 311 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0099] The memory 311 in the embodiment of the present application is used to store various types of data to support the operation of the device. Examples of these data include: any computer program used to operate on the device, such as an operating system and an application program. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and handle hardware-based tasks. The application program may include various applications, such as a media player (MediaPlayer), a browser (Browser), etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present application may be included in the application program.
[0100] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer-readable storage medium may be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it may also be various devices including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is executed by the processor, the above-mentioned prediction method is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to Figure 1 Step S11 is shown as follows: obtaining a first data set of the target business, the first data set including a first time series data sample of the target business, the first time series data sample including first feature information including a first seasonal feature extracted by a first seasonal feature extraction model; Step S12: inputting the first input data determined according to the first data set into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models for combined prediction to output a first prediction result of the target business.
[0101] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0103] 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.
Claims
1. A prediction method, characterized in that: include: Acquire a first data set of a target business, the first data set including a first time series data sample of the target business, the first time series data sample including first feature information including a first seasonal feature extracted by a first seasonal feature extraction model; The first input data determined according to the first data set is input into a pre-built first integrated learning model, so that the first integrated learning model uses multiple basic models to perform combined prediction to output a first prediction result of the target business.
2. The method according to claim 1, characterized in that The step of obtaining a first data set of the target business includes: Collecting historical time series data samples of the target business to construct a first initial data set of the target business; Acquire the first feature information corresponding to each historical time series data sample according to the first initial data set and the first seasonal feature extraction model, wherein the first feature information includes a first seasonal feature and a first trend prediction value; Adding the first feature information to the corresponding historical time series data sample to obtain the first time series data sample; The first time series data samples are aggregated to obtain the first data set.
3. The method according to claim 1, characterized in that Determining first input data according to the first data set includes: Determine an associated business of the target business according to the first data set; Obtaining a second prediction result of the associated business; The first data set and the second prediction result are used as the first input data.
4. The method according to claim 3, characterized in that The step of obtaining the second prediction result of the associated service includes: Acquire a second data set of the associated business; The second prediction result is obtained according to the second data set and the pre-built prediction model.
5. The method according to claim 4, characterized in that The second data set includes a second time series data sample; The step of obtaining the second prediction result according to the second data set and the pre-built prediction model includes: According to the second data set and the second seasonal feature extraction model, obtaining second feature information corresponding to each second time series data sample, wherein the second feature information includes a second seasonal feature; Add each of the second feature information to the corresponding second time series data sample to update the second data set; The second input data determined according to the second data set is input into a pre-built second integrated learning model, so that the second integrated learning model uses multiple basic models to perform combined prediction to output the second prediction result of the related business.
6. The method according to claim 5, characterized in that The steps of building the first integrated learning model or the second integrated learning model include: Divide the training data set into a preset number of sub-data sets in a cross-validation manner; Using a different basic model to perform training and prediction on each of the sub-datasets to generate third prediction results respectively; Perform feature combination according to the third prediction results corresponding to each basic model to obtain a new training data set; Performing metamodel training according to the new training data set to obtain a metamodel; The meta-model is used to make a final prediction on the prediction results of the test data to obtain the prediction output of the first ensemble learning model or the second ensemble learning model.
7. The method according to any one of claims 1 to 6, characterized in that: After the step of inputting the first input data determined according to the first data set into a pre-built first integrated learning model so that the first integrated learning model uses multiple basic models to perform combined prediction to output a first prediction result of the target business, the method includes: Acquire a new first time series data sample according to the first prediction result of the target business; The first ensemble learning model is optimized and trained using the new first time series data sample to update the first ensemble learning model.
8. The method according to any one of claims 1 to 6, characterized in that: The target business is the distribution business of agricultural machinery parts, and the related businesses include the sales business of agricultural machinery and the business of statistical statistics of crop yields; and / or, The first seasonal feature extraction model is a SARIMA model; and / or, The second seasonal feature extraction model is a SARIMA model; and / or, The multiple basic models include at least two of support vector machine, XGBoost, RBF and random forest.
9. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the processor runs the computer program, the steps of the prediction method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the prediction method according to any one of claims 1 to 8 are implemented.