Structured model construction method and device, equipment and storage medium

By segmenting the sample data and introducing meta-labels, multiple first models with different data lengths were constructed, solving the problems of long training time and poor adaptability to market style switching in stacking combined models, and achieving high generalization ability and high accuracy of the model in different market environments.

CN116861227BActive Publication Date: 2026-03-24HUNAN FUMI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies, when training with large amounts of data in terms of feature dimensions, result in long training times for stacking-based combined models, high model convergence, and poor adaptability to market style changes, leading to insufficient generalization ability of the models in different market environments.

Method used

By segmenting the sample data, a validation set and multiple first training sets with different data lengths are generated. Multiple first models are constructed, and second models are generated by introducing prior knowledge through meta-labels. Finally, a structured model is constructed based on preset rules.

Benefits of technology

This improves the model's generalization ability and adaptability in different market environments, ensuring the stability and accuracy of the model's predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116861227B_ABST
    Figure CN116861227B_ABST
Patent Text Reader

Abstract

The application discloses a structured model construction method and device, equipment and a storage medium. The method comprises: performing segmentation processing on obtained sample data to obtain a verification set and at least two first training sets, the data lengths of each first training set being different; obtaining at least two first models and at least two first prediction results based on the verification set and the at least two first training sets; performing splicing processing on each first prediction result and the first training set to generate a second training set; constructing a meta-label, the meta-label being used to represent an effect index of the first model; performing processing based on the meta-label and the second training set to obtain a second model and a second prediction result; and constructing a structured model according to a preset rule based on the first prediction result and the second prediction result. The scheme has stronger expansibility and is more adaptive to special scenarios, not only ensuring the accuracy of model prediction, but also improving the generalization ability of the model in different market environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to the field of integrated learning technology, and specifically to a method, apparatus, device and storage medium for constructing a structured model. Background Technology

[0002] With the continuous development of ensemble learning technology, which constructs and combines multiple machine learning machines to complete learning tasks, it has been widely applied in various fields such as finance. For example, it can be used for ensemble learning in classification, regression, feature selection, and outlier detection. Its core idea is to combine the biases or variances of weak learners to create a strong learner for better performance. Ensemble learning algorithms can be categorized into three main types based on the relationships between individual learners: Bagging, Boosting, and Stacking.

[0003] Currently, one approach in related technologies is based on stacking models. This involves first training an initial training set to build a primary learner, then using the output of the primary learner as input features to generate a new dataset for training, thus constructing a secondary learner. However, in scenarios with large amounts of feature data, this approach results in long training times for the base models at different levels. Furthermore, the relatively fixed structure used in each stack layer makes it difficult to differentiate training methods, leading to high model convergence. This also results in poor adaptability to market style changes and insufficient generalization ability across different market environments when applied to market trading. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, apparatus, device and storage medium for constructing structured models.

[0005] In a first aspect, the present invention provides a method for constructing a structured model, the method comprising:

[0006] The acquired sample data is segmented to obtain a validation set and at least two first training sets, each with a different data length.

[0007] Based on the validation set and at least two first training sets, at least two first models and at least two first prediction results are obtained;

[0008] Each of the first prediction results is concatenated with the first training set to generate a second training set, wherein the first training set and the second training set have the same data length.

[0009] Construct meta-labels, which are used to characterize the performance metrics of the first model;

[0010] Based on the meta-labels and the second training set, a second model and a second prediction result are obtained;

[0011] Based on the first prediction result and the second prediction result, a structured model is constructed according to preset rules.

[0012] In one embodiment, based on the validation set and at least two first training sets, at least two first models and at least two first prediction results are obtained, including:

[0013] Based on the at least two first training sets, at least two first models are obtained by training according to a preset training algorithm.

[0014] The validation set is input into each of the at least two first models to obtain at least two first prediction results corresponding to the first model.

[0015] In one embodiment, each of the at least two first models is constructed according to the following steps:

[0016] Divide the first training set into K subsets;

[0017] K-1 subsets are used as training subsets and 1 subset is used as test subset;

[0018] The first model to be constructed is trained using the training subset to obtain the first model to be verified.

[0019] The first model is obtained by optimizing the hyperparameters of the first model to be verified using the test subset according to the loss function minimization.

[0020] In one embodiment, the hyperparameters in the first model to be validated are optimized using the test subset according to the loss function minimization method to obtain the first model, including:

[0021] Obtain the true value from the sample data;

[0022] The test subset is input into the first model to be validated to obtain the predicted values;

[0023] Calculate the loss function based on the true value and the predicted value;

[0024] Using deep learning tools, the hyperparameters corresponding to the minimization of the loss function are found iteratively according to the training algorithm to obtain the first model.

[0025] In one embodiment, based on the meta-labels and the second training set, a second model and a second prediction result are obtained, including:

[0026] The meta-labels are used as label input features, and the second training set is used to train the second model according to the training algorithm to obtain the second model.

[0027] The validation set is input into the second model to obtain the second prediction result.

[0028] In one embodiment, based on the first prediction result and the second prediction result, a structured model is constructed according to preset rules, including:

[0029] Based on the first prediction result and the second prediction result, the output result is determined according to a preset rule;

[0030] When the output result is positive, the first model and the second model are fused together according to the stacking integration framework to obtain a structured model.

[0031] In one embodiment, based on the first prediction result and the second prediction result, the output result is determined according to a preset rule, including:

[0032] When both the first prediction result and the second prediction result are positive, the output result is determined to be positive;

[0033] When either the first prediction result or the second prediction result is negative, the output result is determined to be negative.

[0034] Secondly, embodiments of this application provide a structured model building apparatus, which includes:

[0035] The segmentation module is used to segment the acquired sample data to obtain a validation set and at least one first training set, each of which has a different data length.

[0036] The first processing module is used to obtain at least two first models and at least two first prediction results based on the validation set and at least two first training sets;

[0037] The splicing module is used to splice each of the first prediction results with the first training set to generate a second training set, wherein the first training set and the second training set have the same data length.

[0038] A construction module is used to construct meta-labels, which are used to characterize the reliability index of the first model;

[0039] The second processing module is used to process the meta-labels and the second training set to obtain the second model and the second prediction result.

[0040] The third processing module is used to construct a structured model based on the first prediction result and the second prediction result according to preset rules.

[0041] Thirdly, embodiments of this application provide an apparatus including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the structured model construction method as described in the first aspect above.

[0042] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being used to implement the structured model construction method of the first aspect above.

[0043] The structured model construction method, apparatus, device, and storage medium provided in this application embodiment divide the acquired sample data into a validation set and at least two first training sets, each with a different data length. Based on the validation set and the at least two first training sets, at least two first models and at least two first prediction results are obtained. The first prediction results are then concatenated with the first training sets to generate a second training set, and meta-labels are constructed. These meta-labels are used to characterize the performance metrics of the first models. Based on the meta-labels and the second training set, a second model and a second prediction result are obtained. Finally, based on the first and second prediction results, a structured model is constructed according to preset rules. This technical solution, due to the different data lengths of each first training set, increases data diversity, resulting in multiple different first models. These different first models are suitable for domains where the training and prediction data have different distributions, thus exhibiting stronger scalability. Furthermore, by constructing meta-labels, prior knowledge is introduced, making the final integrated structured model more adaptable to specific scenarios. This not only ensures the accuracy of model predictions but also improves the model's generalization ability in different market environments. Attached Figure Description

[0044] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0045] Figure 1 A schematic diagram of the implementation environment for the structured model construction method provided in this application embodiment;

[0046] Figure 2 A flowchart illustrating the structured model construction method provided in this application embodiment;

[0047] Figure 3 This is a schematic diagram of the lightweight structured framework provided in the embodiments of this application;

[0048] Figure 4A schematic diagram of the data segmentation and lightweight structured framework provided in the embodiments of this application;

[0049] Figure 5 This is a schematic diagram of the meta-tag learning structure provided in the embodiments of this application;

[0050] Figure 6 A schematic diagram of the structure of a structured model building apparatus provided in another embodiment of this application;

[0051] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0052] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0053] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0054] Ensemble learning is a machine learning method that uses a series of individual learners to learn and integrates the learning results using certain rules to achieve better learning results than a single learner. Based on how the individual learners are generated, ensemble learning methods can be broadly divided into two categories: the first category is a serialization method where individual learners have strong dependencies and must be generated sequentially; the representative of this method is "Boosting". The second category is a parallelization method where individual learners do not have strong dependencies and can be generated simultaneously; its representatives are "Bagging", "Random Forest", and "Stacking".

[0055] Currently, related technologies can employ a traditional stacking ensemble model approach. This involves first training an initial training set to build a primary learner, then using the primary learner's output as input features to generate a new dataset for training, thus constructing a secondary learner. The initial sample labels are still used as example labels. However, this traditional stacking approach uses shared methods for model training data length, validation loss function construction, and label algorithm design. Furthermore, in real-world applications, the data distribution in the testing environment is difficult to maintain absolute independence and identical distribution from the training data distribution. For example, in stock market applications, market styles shift, leading to poor adaptability to market style changes and insufficient generalization ability across different market environments, resulting in low model prediction stability and accuracy.

[0056] To address the aforementioned shortcomings, this application provides a structured model construction method. Compared with existing technologies, this method, by increasing data diversity through the different data lengths of each of the at least two first training sets, enables the training of multiple different first models. These different first models are suitable for domains where the training and prediction data have different distributions, thus exhibiting greater scalability. Furthermore, by constructing meta-labels, prior knowledge is introduced, making the final integrated structured model more adaptable to specific scenarios. This not only ensures the stability and accuracy of model predictions but also improves the model's generalization ability in different market environments.

[0057] Figure 1 This is an implementation environment architecture diagram of a structured model construction method provided in an embodiment of this application. For example... Figure 1 As shown, the implementation environment architecture includes: terminal 100 and server 200.

[0058] Terminal 100 can be a terminal device in various AI application scenarios. For example, terminal 100 can be a smart home device such as a smart TV or smart TV set-top box, or a mobile portable terminal such as a smartphone, tablet computer, or e-book reader, or a smart wearable device such as smart glasses or smartwatch. This embodiment does not specifically limit it in this way.

[0059] Among them, terminal 100 can be equipped with AI applications based on ensemble learning.

[0060] Server 200 can be a single server, a server cluster consisting of several servers, or server 200 can contain one or more virtualization platforms, or server 200 can be a cloud computing service center.

[0061] Among them, server 200 can be a server device that provides backend services for the AI ​​application installed in the aforementioned terminal 100.

[0062] Terminal 100 and server 200 establish a communication connection via a wired or wireless network. Optionally, the aforementioned wireless or wired network uses standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to a Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, wired or wireless network, private network, or any combination of virtual private network.

[0063] In the construction process of the aforementioned structured model, the acquired sample data can be segmented to obtain a validation set and at least two first training sets. Then, based on the validation set and the at least two first training sets, at least two first models and at least two first prediction results are obtained, and a second training set and meta-labels are generated. Based on the meta-labels and the second training set, a second model and a second prediction result are obtained. Thus, based on the first and second prediction results, a structured model is constructed according to preset rules. This structured model can be trained and applied by server 200; or it can be trained and applied by terminal 100.

[0064] For ease of understanding and explanation, the following will use... Figures 2 to 7 This application provides a detailed description of the structured model construction method, apparatus, device, and storage medium provided in the embodiments of this application.

[0065] Figure 2 The diagram shown is a flowchart illustrating a structured model construction method according to an embodiment of this application. This method can be executed by a structured model construction device. Figure 2 As shown, the method includes:

[0066] S101. The acquired sample data is segmented to obtain a validation set and at least two first training sets, each with a different data length.

[0067] It should be noted that this application employs a lightweight structured framework to construct the structured model. The core idea of ​​this framework is based on a stacked ensemble model approach, with improvements made to the ensemble method. In constructing the first model within the structured model, to adapt the trained model to different factor feature distributions, it is necessary to increase the variability of the training data. This is achieved by using different data lengths for the training data. Such variability is suitable for domains where the training and prediction data have different distributions, thereby enhancing the stability of predictions for financial data, etc.

[0068] Please see Figure 3 As shown, the aforementioned lightweight structured framework can include at least two parallel first and second models. The first model can be a primary learner, and these at least two primary learners can be trained in parallel. This primary learner can be trained in batches using pre-defined training algorithm code. Compared to the restructured framework, because the restructured framework uses a unified validation loss function optimization, its training objective is to reduce validation loss while discarding primary learners that contribute negatively to the validation loss after stacking. Its execution is generally a serial process, continuously accumulating and reducing the loss. The lightweight structured framework used in this application includes at least two primary learners, namely Model-1, Model-2, ..., and Model-n. Model-1 can be trained in parallel using the first training set Ttain data1, Model-2 using the first training set Ttain data2, and Model-n using the first training set Ttain data-n. The primary learners obtain the first prediction results predict value mode-1, predict value mode-2, ..., predict value mode-n for Model-1, Model-2, ..., Model-n respectively, and the output results are obtained by combining the meta-learning structure of meta-labels.

[0069] Specifically, the aforementioned sample data refers to historical data used to train structured models. In the financial field, this sample data could be, for example, financial data. Optionally, it can be obtained by importing from external devices or from a pre-set database.

[0070] After obtaining the sample data, it can be split according to data length or data date to obtain a validation set and at least two first training sets. The data length of each first training set is different.

[0071] For example, the obtained sample data may include financial data from 2012 to December 2017. After segmenting the data, financial data from July 2017 to December 2017 may be used as a validation set, financial data from 2012 to June 2017 may be used as a first training set, and financial data from 2015 to June 2017 may be used as another first training set.

[0072] S102. Based on the validation set and at least two first training sets, obtain at least two first models and at least two first prediction results.

[0073] In this step, after obtaining the validation set and at least two first training sets, at least two first models are trained based on the at least two first training sets according to a preset training algorithm. Then, the validation set is input into each of the at least two first models to obtain at least two first prediction results corresponding to the first models. These first prediction results can be either the predicted probability of the label type of the sample data or the predicted category of the label type.

[0074] It should be noted that during the training process of the first model mentioned above, K-fold cross-validation can be used. For each first model, the first training set can be divided into K subsets. K-1 subsets are used as training subsets in turn, and the remaining 1 subset is used as test subset. The first model to be constructed is trained using the training subset to obtain the first model to be validated. Then, the hyperparameters in the first model to be validated are optimized using the test subset according to the loss function minimization to obtain the first model.

[0075] In the process of minimizing the loss function and optimizing the hyperparameters of the first model to be validated using a test subset to obtain the first model, the true values ​​can be obtained from the sample data, and the test subset can be input into the first model to be validated to obtain the predicted values. Then, based on the true values ​​and predicted values, the loss function is calculated, and the hyperparameters corresponding to the minimization of the loss function are found iteratively according to the training algorithm using deep learning tools to obtain the first model.

[0076] Specifically, the commonly used logarithmic loss function can be decomposed as follows:

[0077] Loss1 = yi log(f(xi))

[0078] Loss2 = (1-yi)log(1-f(xi))

[0079] Where yi is the true value, f(xi) is the predicted value, and xi is the test subset. For Loss1, Loss1 can only be non-zero when yi is 1, meaning Loss1 calculates the error of the model misclassifying samples labeled 1, denoted as the false positive error. For Loss2, Loss2 can only be non-zero when yi is 0, meaning Loss2 calculates the error of the model misclassifying samples labeled 0, denoted as the false negative error. The final loss function Loss comprehensively measures the model's error by adding Loss1 and Loss2. For the original logarithmic loss function, the weights of Loss1 and Loss2 are equal.

[0080] However, in the embodiments of this application, the degree of risk preference is not consistent in actual stock trading. That is, trading behaviors that cause significant drawdowns should be punished more severely, while trading behaviors that generate higher returns should be rewarded more. Therefore, the loss function constructed in this application can be:

[0081]

[0082] It can also be expressed as:

[0083]

[0084] Loss2 error is the main cause of net asset value drawdown. Adjusting the β value can change the model's aggressive / conservative bias. The β value can be determined by a formula: a large β value will prioritize optimizing Loss2, while a small β value will prioritize optimizing Loss1. Overfitting can be controlled through regularization. Furthermore, another loss term can be added. And by assigning weights λ, we obtain the following new loss function:

[0085]

[0086] Understandably, the significance of this loss function lies in the model's optimization objective of simultaneously minimizing L1 and L2, that is, the model minimizes the difference between the true value yi and the predicted value. While acknowledging the differences between them, it is also necessary to control the predicted values. The difference between si and si can be used to increase the stability of the model output and, to some extent, control the turnover rate.

[0087] Furthermore, the aforementioned lightweight structured framework is well-adapted to NNI. After pre-setting a series of hyperparameters that need adjustment, the primary learners communicate by calculating a custom validation loss value during training and sending it back to the NNI framework. This means all primary learners iteratively search for the optimal solution using the deep learning tool NNI in parallel. When iteratively searching for the hyperparameters that minimize the loss function using a deep learning tool (which can be NNI or employ tuning algorithms such as TPE, SMAC, or evolutionary algorithms), a new set of test solutions is returned. After multiple rounds of searching, the model achieves a local optimum, thus determining the hyperparameters that minimize the loss function.

[0088] It should be noted that NNI, mentioned above, is Microsoft's Automated Deep Learning tool. It uses various optimization algorithms to search for the best neural network architecture and / or hyperparameters, and supports different operating environments such as single-machine, local multi-machine, and cloud environments. It supports multiple frameworks, including a Python-based SDK supporting mainstream frameworks and libraries such as PyTorch, TensorFlow, scikit-learn, and LightGBM; it supports multiple training platforms, including running directly on the local machine, scheduling a group of GPU servers via SSH, or scheduling large-scale clusters under Kubernetes via FrameworkController, KubeFlow, OpenPAI, etc.; NNI supports multiple stages in the machine learning lifecycle, including feature engineering, Neural Network Architecture Search (NAS), hyperparameter tuning, and model compression.

[0089] For example, please see Figure 4 As shown, taking the first model as an example of two types of algorithms and a two-layer structure, the first layer structure includes the first model, and the second layer structure includes meta-learn. The first models are base-learn-1 and base-learn-2, respectively. For example, if sample data is obtained, including financial data from 2012 to December 2017, after splitting the data, financial data from July 2017 to December 2017 is used as the validation set. Financial data from 2012 to June 2017 is used as one first training set (input-data), and financial data from 2015 to June 2017 is used as another first training set (input-data). The two first training sets have different data lengths.

[0090] The first training set (input data) from 2012 to June 2017 can be trained using a preset training algorithm to construct base-learn-1. Conversely, the first training set (input data) from 2015 to June 2017 can be trained using the same algorithm to construct base-learn-2. Then, the validation set (validation set) from July 2017 to December 2017 is input into both base-learn-1 and base-learn-2 to obtain the first prediction result. The output of the first layer is used as the input to the second layer. Based on the first prediction results of base-learn-1 and base-learn-2, the input to the second layer structure is determined, and the output result is then determined through the meta-label learning structure.

[0091] In this embodiment, during the training of the first model, in addition to the difference in the length of the first training set data, which allows for the use of different time window lengths for training, the labels constituting the first model can also be different. This makes the trained first model suitable for domains where the training data and prediction data have different distributions, thus increasing its adaptability. Furthermore, by using the deep learning tool NNI for automated parameter tuning, an automated parameter tuning process for the primary learner is introduced. Compared to the traditional Stacking integration method, where the same algorithm often shares a single parameter template, the automated parameter tuning in this application ensures the differences in training data and labels while making the trained model more accurate, thereby improving the model's prediction accuracy to a certain extent.

[0092] S103. Each first prediction result is concatenated with the first training set to generate a second training set. The first and second training sets have the same data length.

[0093] Specifically, after obtaining each first prediction result of the first model, the first prediction result can be concatenated with the first training set according to a preset concatenation rule to obtain the second training set. This preset concatenation rule ensures that the second training set obtained after concatenation has the same data length as the first training set.

[0094] S104. Construct meta-labels, which are used to characterize the performance metrics of the first model.

[0095] In this step, the meta-label serves as the target label for the second model. Optionally, when constructing the meta-label, if the first model determines whether a stock is worth buying, then prior knowledge is added to construct the meta-label. This prior knowledge could be, for example, finding the historical trend of the stock; that is, the constructed meta-label represents the confidence level in whether or not to buy the stock. The meta-label can also be constructed based on the condition of whether the output value of the first model is correct or incorrect.

[0096] By constructing a meta-label structure, we can introduce prior knowledge from humans, making the constructed structured model more adaptable to specific scenarios.

[0097] S105. Based on the meta-labels and the second training set, the second model and the second prediction result are obtained.

[0098] Specifically, meta-labels can be used as label input features. A second model is trained using these label input features and a second training set according to a training algorithm. The validation set is then input into the second model to obtain a second prediction result. This second prediction result can be either the predicted probability of a meta-label type or the predicted category of the meta-label type.

[0099] Specifically, when training the second model using the label input features and the second training set according to the training algorithm, the second training set can be divided into a training subset and a test subset. Then, the training subset is used to train the second model to be constructed to obtain the second model to be verified. Finally, the test subset is used to optimize the hyperparameters of the second model to be verified according to the loss function minimization to obtain the second model.

[0100] S106. Based on the first and second prediction results, construct a structured model according to preset rules.

[0101] In this step, after obtaining the first prediction result and the second prediction result, the output result can be determined based on the first prediction result and the second prediction result according to a preset rule. This preset rule can be an AND gate rule.

[0102] It should be noted that the first and second prediction results mentioned above can be predicted probabilities. A first probability threshold can be set for the first model and a second probability threshold can be set for the second model. At the level of this probability threshold, the first and second models have high recall. The ROC (Receiver Operating Characteristic) curve can be used to help determine a good probability threshold.

[0103] For example, if the predicted probabilities of the first prediction results include 0.7, 0.6, and 0.4, and the first probability threshold is 0.5, then the first prediction result with a predicted probability greater than the first probability threshold is determined as 1; otherwise, the first prediction result with a predicted probability not greater than the first probability threshold is determined as 0. The determined first prediction results are 1, 1, and 0. Similarly, if the predicted probabilities of the second prediction results include 0.3, 0.4, and 0.8, and the second probability threshold is 0.6, then the second prediction result with a predicted probability greater than the second probability threshold is determined as 1, and the second prediction result with a predicted probability not greater than the second probability threshold is determined as 0. The determined second prediction results are 0, 0, and 1. Furthermore, a prediction result of 1 is defined as positive, and a prediction result of 0 is defined as negative.

[0104] When both the first and second prediction results are positive, the output result is determined to be positive; when either the first or second prediction result is negative, the output result is determined to be negative.

[0105] Furthermore, when the output is positive, the first model and the second model are fused together according to the stacking ensemble framework to obtain a structured model.

[0106] For example, please see Figure 5 As shown, sample data is acquired and segmented to obtain a validation set and at least two first training sets, each with a different data length. Then, based on the validation set and the at least two first training sets, at least two first models and at least two first prediction results are obtained. Figure 5 Only one first model is shown. Features can be extracted from the first training set, and then trained according to a preset training algorithm based on these features to obtain the first model. The first model can be generated by binary classification. The validation set is input into the first model to obtain the corresponding first prediction result. The first prediction result can be the prediction probability of the sample data. The value of the prediction probability value is in the range of [0,1]. The result with the prediction probability greater than the first probability threshold is recorded as positive, and otherwise it is recorded as negative.

[0107] The first prediction result is then concatenated with the first training set to form the second training set of the secondary model. This second training set has the same data length as the first training set. Meta labels are then constructed, serving as the target labels for the model. These meta labels can be constructed, for example, based on the judgment of the primary model's first prediction result as correct or incorrect. These meta labels are then used as label input features. The model is trained using the label input features and the second training set according to the training algorithm to obtain the second model. The validation set is then input into the second model to obtain the second prediction result. This second prediction result represents the probability that the primary model's output value is correct or incorrect. The predicted probability value ranges from [0,1]. Probabilities greater than a second probability threshold are recorded as positive, and those otherwise are recorded as negative.

[0108] After obtaining the first prediction result of the primary model and the second prediction result of the secondary model, the first and second prediction results can be combined according to the AND gate rule to obtain the output result. That is, when both the first and second prediction results are positive, the output result is determined to be positive; when either the first or second prediction result is negative, the output result is determined to be negative. When the output result is positive, the first and second models are fused according to the stacking ensemble framework to obtain the structured model.

[0109] The structured model construction method provided in this application involves segmenting the acquired sample data to obtain a validation set and at least one first training set, each with a different data length. Based on the validation set and at least one first training set, at least one first model and at least one first prediction result are obtained. The first prediction result is then concatenated with the first training set to generate a second training set, and meta-labels are constructed. These meta-labels are used to characterize the performance metrics of the first model. Based on the meta-labels and the second training set, a second model and a second prediction result are obtained. Finally, based on the first and second prediction results, a structured model is constructed according to preset rules. This technical solution, due to the different data lengths of each first training set, increases data diversity, resulting in multiple different first models. These different first models are suitable for domains where the training and prediction data have different distributions, thus exhibiting stronger scalability. Furthermore, by constructing meta-labels, prior knowledge is introduced, making the final integrated structured model more adaptable to specific scenarios. This not only ensures the accuracy of model predictions but also improves the model's generalization ability in different market environments.

[0110] It should be noted that although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0111] on the other hand, Figure 6 This is a schematic diagram of a structured model building device provided in an embodiment of this application. This device can be a component within a terminal device, such as... Figure 6 As shown, the device 400 includes:

[0112] The segmentation module 410 is used to segment the acquired sample data to obtain a validation set and at least one first training set, each first training set having a different data length.

[0113] The first processing module 420 is used to obtain at least two first models and at least two first prediction results based on the validation set and at least two first training sets.

[0114] The splicing module 430 is used to splice each first prediction result with the first training set to generate a second training set. The first training set and the second training set have the same data length.

[0115] Module 440 is used to construct meta-labels, which are used to characterize the reliability metrics of the first model.

[0116] The second processing module 450 is used to process based on meta-labels and the second training set to obtain the second model and the second prediction result;

[0117] The third processing module 460 is used to construct a structured model based on the first and second prediction results according to preset rules.

[0118] Optionally, the first processing module 420 includes:

[0119] The first training unit 421 is used to train at least two first training sets according to a preset training algorithm to obtain at least two first models;

[0120] The first prediction unit 422 is used to input the validation set into each of the at least two first models to obtain at least two first prediction results corresponding to the first model.

[0121] Optionally, the first training unit 421 is specifically used for:

[0122] Divide the first training set into K equal subsets;

[0123] K-1 subsets are used as training subsets and 1 subset is used as test subset;

[0124] The first model to be constructed is trained using a training subset to obtain the first model to be validated.

[0125] The first model is obtained by optimizing the hyperparameters of the first model to be validated using a test subset based on minimizing the loss function.

[0126] Optionally, the training unit 421 described above is also used for:

[0127] Obtain the true value from the sample data;

[0128] Input the test subset into the first model to be validated to obtain the predicted values;

[0129] Calculate the loss function based on the actual and predicted values;

[0130] Using deep learning tools, the hyperparameters corresponding to minimizing the loss function are found iteratively according to the training algorithm to obtain the first model.

[0131] Optionally, the second processing module 450 mentioned above includes:

[0132] The second training unit 451 is used to take the meta-label as the label input feature, and use the label input feature and the second training set to train according to the training algorithm to obtain the second model;

[0133] The second prediction unit 452 is used to input the validation set into the second model to obtain the second prediction result.

[0134] Optionally, the third processing module 460 mentioned above includes:

[0135] The determining unit 461 is used to determine the output result based on the first prediction result and the second prediction result according to a preset rule;

[0136] The processing unit 462 is used to fuse the first model and the second model according to the stacking integration framework to obtain a structured model when the output result is positive.

[0137] Optionally, the aforementioned determining unit 461 is specifically used for:

[0138] When both the first and second prediction results are positive, the output result is determined to be positive.

[0139] If either the first or second prediction result is negative, the output result is determined to be negative.

[0140] The structured model building apparatus provided in this application segmentation module segments the acquired sample data to obtain a validation set and at least two first training sets, each with a different data length. Based on the validation set and the at least two first training sets, a first processing module obtains at least two first models and at least two first prediction results. Then, a splicing module splices the first prediction results with the first training sets to generate a second training set. A construction module builds meta-labels, which are used to characterize the performance metrics of the first models. Based on the meta-labels and the second training sets, a second processing module and a third processing module process the data to obtain a second model and a second prediction result. Finally, based on the first prediction result and the second prediction result, a structured model is built according to preset rules. This technical solution, due to the different data lengths of each first training set, increases data diversity to obtain multiple different first models. These different first models are suitable for domains where the training data and prediction data have different distributions, and have stronger scalability. Furthermore, by constructing meta-labels, human prior knowledge is introduced, making the final integrated structured model more adaptable to special scenarios. This not only ensures the accuracy of model predictions but also improves the model's generalization ability in different market environments.

[0141] On the other hand, the terminal device provided in the embodiments of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the structured model construction method as described above.

[0142] The following is for reference. Figure 7 , Figure 7 This is a schematic diagram of the computer system structure of the terminal device according to an embodiment of this application.

[0143] like Figure 7 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage portion 603 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0144] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0145] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 603, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0146] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0148] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, they can be described as: a processor including: a segmentation module, a first processing module, a splicing module, a construction module, a second processing module, and a third processing module. The names of these units or modules do not necessarily limit the unit or module itself; for example, a segmentation module can also be described as "used to segment acquired sample data to obtain a validation set and at least one first training set, each of the first training sets having a different data length."

[0149] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs, which, when used by one or more processors, execute the structured model construction method described in this application:

[0150] The acquired sample data is segmented to obtain a validation set and at least two first training sets, each with a different data length.

[0151] Based on the validation set and at least two first training sets, at least two first models and at least two first prediction results are obtained;

[0152] Each of the first prediction results is concatenated with the first training set to generate a second training set, wherein the first training set and the second training set have the same data length.

[0153] Construct meta-labels, which are used to characterize the performance metrics of the first model;

[0154] Based on the meta-labels and the second training set, a second model and a second prediction result are obtained;

[0155] Based on the first prediction result and the second prediction result, a structured model is constructed according to preset rules.

[0156] In summary, the structured model construction method, apparatus, device, and storage medium provided in this application segment the acquired sample data to obtain a validation set and at least two first training sets, each with a different data length. Based on the validation set and the at least two first training sets, at least two first models and at least two first prediction results are obtained. The first prediction results are then concatenated with the first training sets to generate a second training set, and meta-labels are constructed. These meta-labels are used to characterize the performance metrics of the first models. Based on the meta-labels and the second training set, a second model and a second prediction result are obtained. Finally, based on the first and second prediction results, a structured model is constructed according to preset rules. This technical solution, due to the different data lengths of each first training set, increases data diversity, resulting in multiple different first models. These different first models are suitable for domains where the training and prediction data have different distributions, thus exhibiting stronger scalability. Furthermore, by constructing meta-labels, prior knowledge is introduced, making the final integrated structured model more adaptable to specific scenarios. This not only ensures the accuracy of model predictions but also improves the model's generalization ability in different market environments.

[0157] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for constructing a structured model, characterized in that, The method includes: The acquired sample data is segmented to obtain a validation set and at least two first training sets, each with a different data length; wherein, the sample data refers to historical data used to train the structured model, and the historical data includes at least financial data from the financial field; the sample data is obtained by importing from external devices or by obtaining it from a preset database; Based on the validation set and at least two first training sets, at least two first models and at least two first prediction results are obtained; Each of the first prediction results is concatenated with the first training set to generate a second training set, wherein the first training set and the second training set have the same data length. Construct meta-labels, which are used to characterize the performance metrics of the first model; Based on the meta-labels and the second training set, a second model and a second prediction result are obtained; Based on the first prediction result and the second prediction result, a structured model is constructed according to preset rules; The process of obtaining at least two first models and at least two first prediction results based on the validation set and at least two first training sets includes: Based on the at least two first training sets, at least two first models are obtained by training according to a preset training algorithm. The validation set is input into each of the at least two first models to obtain at least two first prediction results corresponding to the first model; Each of the at least two first models is constructed according to the following steps: Divide the first training set into K subsets; K-1 subsets are used as training subsets and 1 subset is used as test subset; The first model to be constructed is trained using the training subset to obtain the first model to be verified. The first model is obtained by optimizing the hyperparameters of the first model to be verified using the test subset according to the loss function minimization.

2. The method according to claim 1, characterized in that, The first model is obtained by optimizing the hyperparameters of the first model to be validated using the test subset according to the loss function minimization method, including: Obtain the true value from the sample data; The test subset is input into the first model to be validated to obtain the predicted values; Calculate the loss function based on the true value and the predicted value; Using deep learning tools, the hyperparameters corresponding to the minimization of the loss function are found iteratively according to the training algorithm to obtain the first model.

3. The method according to claim 1, characterized in that, Based on the meta-labels and the second training set, a second model and a second prediction result are obtained, including: The meta-labels are used as label input features, and the second training set is used to train the second model according to the training algorithm to obtain the second model; The validation set is input into the second model to obtain the second prediction result.

4. The method according to claim 1, characterized in that, Based on the first prediction result and the second prediction result, a structured model is constructed according to preset rules, including: Based on the first prediction result and the second prediction result, the output result is determined according to a preset rule; When the output result is positive, the first model and the second model are fused together according to the stacking integration framework to obtain a structured model.

5. The method according to claim 4, characterized in that, Based on the first prediction result and the second prediction result, the output result is determined according to preset rules, including: When both the first prediction result and the second prediction result are positive, the output result is determined to be positive; When either the first prediction result or the second prediction result is negative, the output result is determined to be negative.

6. A structured model building apparatus, characterized in that, The device includes: The segmentation module is used to segment the acquired sample data to obtain a validation set and at least one first training set, each of which has a different data length; wherein, the sample data refers to historical data used to train the structured model, and the historical data includes at least financial data in the financial field; the sample data is obtained by importing from an external device or by obtaining it from a preset database; The first processing module is used to obtain at least two first models and at least two first prediction results based on the validation set and at least two first training sets; The splicing module is used to splice each of the first prediction results with the first training set to generate a second training set, wherein the first training set and the second training set have the same data length. A construction module is used to construct meta-labels, which are used to characterize the reliability index of the first model; The second processing module is used to process the meta-labels and the second training set to obtain the second model and the second prediction result. The third processing module is used to construct a structured model based on the first prediction result and the second prediction result according to preset rules; The process of obtaining at least two first models and at least two first prediction results based on the validation set and at least two first training sets includes: Based on the at least two first training sets, at least two first models are obtained by training according to a preset training algorithm. The validation set is input into each of the at least two first models to obtain at least two first prediction results corresponding to the first model; Each of the at least two first models is constructed according to the following steps: Divide the first training set into K subsets; K-1 subsets are used as training subsets and 1 subset is used as test subset; The first model to be constructed is trained using the training subset to obtain the first model to be verified. The first model is obtained by optimizing the hyperparameters of the first model to be verified using the test subset according to the loss function minimization.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the structured model construction method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, the computer program being used to implement the structured model construction method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Relevance vector machine classification method facing large-scale data set

    CN107103332A

  • A multi-classifier fusion method based on PCA dimension reduction

    CN109447099A