Data prediction method and device based on deep regression model, and electronic equipment

By dividing the financial dataset into batches and calculating the feature distance matrix, a deep regression model was trained, which solved the problem of decreased prediction accuracy caused by uneven sample distribution and improved the accuracy of data prediction in the financial field.

CN118982430APending Publication Date: 2024-11-19PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411129101.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

Because the sample distribution of regression tasks is often continuous and unbalanced, the predictive accuracy of deep regression models in the financial field decreases, affecting key areas such as investment decisions and risk management.

Method used

By partitioning the financial dataset into a first financial set and a second financial set, and inputting them into a deep regression model for batch partitioning, the label distance matrix and feature distance matrix are calculated. The feature distance readout module is used for distance estimation and feature mapping, and a pre-trained deep regression model is trained. Finally, the data prediction is performed by combining the label and feature distance matrices.

Benefits of technology

It improves the prediction accuracy of deep regression models, avoids the impact of imbalanced sample distribution, and enhances the accuracy of data prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982430A_ABST
    Figure CN118982430A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data prediction method and device based on a deep regression model and electronic equipment, and belongs to the field of financial science and technology. The method comprises the steps of obtaining a financial data set, and performing data division to obtain a first financial set and a second financial set; inputting the first financial set into a deep regression model for batch division, and outputting a plurality of financial sample batches; carrying out subtraction operation on financial tags of the financial data to obtain a tag distance matrix; performing distance estimation on the financial sample batches through a feature distance reading module to obtain a feature distance matrix, and performing feature mapping on the financial sample batches through a regression head to obtain a regression value; training a deep regression model according to the label distance matrix, the feature distance matrix and the regression value; and inputting the second financial set into a pre-trained deep regression model for data prediction to obtain a prediction result. According to the embodiment of the invention, the prediction accuracy of the deep regression model can be improved, and the prediction accuracy is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to a data prediction method, device and electronic device based on a deep regression model. Background Art

[0002] Regression tasks are tasks in machine learning that predict continuous numerical outputs. Regression problems have a wide range of applications, including stock price and credit score prediction in finance, disease and drug response prediction in medicine, sales and customer value prediction in marketing, and various predictions in other fields such as meteorology, transportation planning, energy management, logistics, real estate, and human resources.

[0003] Deep regression refers to the use of deep learning models for regression tasks. The power of deep learning lies in its ability to handle large-scale and complex data, while also being able to learn implicit patterns in the data. Taking the financial field as an example, the accuracy of regression tasks is crucial because the prediction results directly affect key areas such as investment decisions, risk management, and financial planning. However, since the sample distribution of regression tasks is often continuous and unbalanced, a large amount of training data is often required, which affects the accuracy of the regression model and further leads to the problem of reduced prediction accuracy. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a data prediction method, device and electronic device based on a deep regression model, which can improve the prediction accuracy of the deep regression model and further improve the prediction accuracy rate.

[0005] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a data prediction method based on a deep regression model, the method comprising: Acquire a financial data set, and perform data division on the financial data set to obtain a first financial set and a second financial set, wherein each financial data in the financial data set carries a financial label; Inputting the first financial set into a deep regression model for batch division, and outputting a plurality of financial sample batches, wherein each of the financial sample batches includes at least two of the financial data; For each of the financial sample batches, subtract the financial labels of the financial data to obtain a label distance matrix, where the label distance matrix is ​​used to represent the distance between the financial labels; Performing distance estimation on the batch of financial samples through a feature distance reading module in the deep regression model to obtain a feature distance matrix, and performing feature mapping on the batch of financial samples through a regression head of the deep regression model to obtain a regression value; Training the deep regression model according to the label distance matrix, the feature distance matrix, and the regression value to obtain a pre-trained deep regression model; The second financial set is input into a pre-trained deep regression model for data prediction to obtain a prediction result.

[0006] In some embodiments, dividing the financial data set to obtain a first financial set and a second financial set includes: Performing a preprocessing operation on the financial data set; Performing feature extraction on the financial data set after the preprocessing operation to obtain a feature vector corresponding to the financial data; The financial data set is bucketed to obtain a first financial set and a second financial set.

[0007] In some embodiments, the distance estimation of the batch of financial samples is performed by the feature distance reading module in the deep regression model to obtain a feature distance matrix, including: Inputting the financial sample batch into the feature distance reading module of the deep regression model, so that the feature distance reading module subtracts the feature vectors in the financial sample batch to obtain a subtraction result; The distance of the subtraction result is estimated by using a preset activation function and a preset readout vector to obtain a feature distance matrix, wherein the readout vector is a weight vector in the feature distance readout module, and the feature distance matrix is ​​used to characterize the distance between the feature vectors.

[0008] In some embodiments, the step of inputting the first financial set into a deep regression model for batch division and outputting multiple batches of financial samples includes: determining a data type of the first financial set; Inputting the first financial set into a deep regression model, so that the deep regression model performs encoding processing on the first financial set according to the data type and outputs a plurality of encoding features; The coding features are bucketed, and the coded features after the bucketing operation are averaged to obtain multiple financial sample batches.

[0009] In some embodiments, the training of the deep regression model according to the label distance matrix, the feature distance matrix, and the regression value to obtain a pre-trained deep regression model includes: Performing similarity calculation on the label distance matrix and the feature distance matrix to obtain a similarity loss value; Calculating a regression loss value between the regression value and a preset true value using a preset loss function; The deep regression model is gradient calculated according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model.

[0010] In some embodiments, the first financial set includes a validation set; after performing gradient calculation on the deep regression model according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model, the method further includes: The validation set is input into the pre-trained deep regression model for model testing.

[0011] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a data prediction device based on a deep regression model, the device comprising: A data acquisition module, used to acquire a financial data set, and divide the financial data set into a first financial set and a second financial set, wherein each financial data in the financial data set carries a financial label; A batch division module, used for inputting the first financial set into a deep regression model for batch division, and outputting a plurality of financial sample batches, wherein each of the financial sample batches includes at least two of the financial data; A matrix calculation module, used for performing a subtraction operation on the financial labels of the financial data for each batch of the financial samples to obtain a label distance matrix, wherein the label distance matrix is ​​used to represent the distance between the financial labels; A distance estimation module, configured to perform distance estimation on the batch of financial samples through a feature distance reading module in the deep regression model to obtain a feature distance matrix, and perform feature mapping on the batch of financial samples through a regression head of the deep regression model to obtain a regression value; A model training module, used to train the deep regression model according to the label distance matrix, the feature distance matrix and the regression value to obtain a pre-trained deep regression model; The data prediction module is used to input the second financial set into a pre-trained deep regression model for data prediction to obtain a prediction result.

[0012] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the data prediction method based on the deep regression model as described in the first aspect when executing the computer program.

[0013] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data prediction method based on the deep regression model as described in the first aspect.

[0014] The data prediction method, device, electronic device and storage medium based on the deep regression model proposed in the present application first obtain a financial data set including financial data, and divide the financial data set into a first financial set and a second financial set, so as to facilitate the subsequent training of the deep regression model, and then input the first financial set into the deep regression model for batch division to obtain multiple financial sample batches, so as to facilitate the subsequent model to learn more generalized feature representations, and for each financial sample batch, subtract the financial labels of the financial data to obtain a label distance matrix, so as to obtain the distance between the financial labels of the financial data, and then estimate the distance of the financial sample batches through the feature distance readout module in the deep regression model to obtain the feature distance matrix. The deep regression model is used to obtain a distance matrix, and feature mapping is performed on the batch of financial samples through the regression head of the deep regression model to obtain regression values, which can predict accurate numerical results from the input features of the batch of financial samples. After that, the deep regression model is trained according to the label distance matrix, the feature distance matrix and the regression value, so that the deep regression model can combine the label distance matrix and the feature distance matrix for data prediction, realize the training of the deep regression model, and improve the accuracy of the deep regression model for data prediction. Finally, the second financial set is input into the pre-trained deep regression model for data prediction to obtain the prediction result, which can realize the data prediction of the second financial set from both the label and feature aspects, avoid the impact of uneven sample distribution, and improve the accuracy of data prediction. The embodiment of the present application makes the distance between the constraint features closer by constraining the pairwise distance between features and the pairwise distance between labels, thereby improving the accuracy of data prediction as a whole and avoiding the impact of uneven sample distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of a data prediction method based on a deep regression model provided by an embodiment of the present application; Figure 2 yes Figure 1 Flow chart of step S101 in FIG. Figure 3 This is a flowchart of a specific method for estimating the distance of a batch of financial samples through a feature distance reading module in a deep regression model provided by an embodiment of the present application; Figure 4 This is a flowchart of a specific method for performing feature mapping on a batch of financial samples through a regression head of a deep regression model provided by an embodiment of the present application; Figure 5yes Figure 1 Flow chart of step S102 in FIG. Figure 6 yes Figure 1 Flow chart of step S105 in FIG. Figure 7 is a flow chart of a data prediction method based on a deep regression model provided by another embodiment of the present application; Figure 8 It is a structural schematic diagram of a data prediction device based on a deep regression model provided in an embodiment of the present application; Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0017] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0019] First, some nouns involved in this application are analyzed: Natural Language Processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0020] Convolutional Neural Network (CNN): Convolutional neural network is a type of feedforward neural network with deep structure and convolutional calculation, and is one of the representative algorithms of deep learning. Convolutional neural network has the ability of representation learning and can classify input information in a translation-invariant manner according to its hierarchical structure.

[0021] Hyperbolic Tangent (Tanh): The hyperbolic tangent function is a type of hyperbolic function. Similar to the tangent function, the hyperbolic tangent function is computationally equal to the ratio of the hyperbolic sine to the hyperbolic cosine. The hyperbolic tangent function is a mathematical function that compresses the input to between -1 and 1.

[0022] Rectified Linear Unit (ReLU): Linear rectification function, also known as rectified linear unit, is an activation function commonly used in artificial neural networks, usually referring to nonlinear functions represented by ramp functions and their variants.

[0023] Based on this, the embodiments of the present application provide a data prediction method and device, an electronic device and a storage medium based on a deep regression model, which can improve the prediction accuracy of the deep regression model and further improve the prediction accuracy rate.

[0024] The data prediction method and device based on the deep regression model, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the data prediction method based on the deep regression model in the embodiments of the present application is described.

[0025] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0026] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, module management technology of online meeting systems, natural language processing technology, and machine learning / deep learning.

[0027] The data prediction method based on the deep regression model provided in the embodiment of the present application relates to the field of data processing technology. The data prediction method based on the deep regression model provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a data prediction method based on a deep regression model, etc., but is not limited to the above forms.

[0028] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0029] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0030] Regression tasks are tasks in machine learning that predict continuous numerical outputs. Regression problems have a wide range of applications, including stock price and credit score prediction in finance, disease and drug response prediction in medicine, sales and customer value prediction in marketing, and various predictions in other fields such as meteorology, transportation planning, energy management, logistics, real estate, and human resources.

[0031] Deep regression refers to the use of deep learning models for regression tasks. The power of deep learning lies in its ability to handle large-scale and complex data, while also being able to learn implicit patterns in the data. Taking the financial field as an example, the accuracy of regression tasks is crucial because the prediction results directly affect key areas such as investment decisions, risk management, and financial planning. However, since the sample distribution of regression tasks is often continuous and unbalanced, a large amount of training data is often required, which affects the accuracy of the regression model and further leads to the problem of reduced prediction accuracy.

[0032] In order to solve the above problems, the present embodiment provides a data prediction method, device, electronic device and storage medium based on a deep regression model. First, a financial data set including financial data is obtained, and the financial data set is divided into a first financial set and a second financial set, which is convenient for subsequent training of the deep regression model. The first financial set is then input into the deep regression model for batch division to obtain multiple financial sample batches, which is convenient for the subsequent model to learn more generalized feature representations. For each financial sample batch, the financial label of the financial data is subtracted to obtain a label distance matrix, so that the distance between the financial labels of the financial data can be obtained. Then, the distance of the financial sample batch is estimated through the feature distance readout module in the deep regression model. A feature distance matrix is ​​obtained, and feature mapping is performed on the batch of financial samples through the regression head of the deep regression model to obtain regression values, which can predict accurate numerical results from the input features of the batch of financial samples. Afterwards, the deep regression model is trained according to the label distance matrix, the feature distance matrix and the regression value, so that the deep regression model can combine the label distance matrix and the feature distance matrix for data prediction, realize the training of the deep regression model, and improve the accuracy of the deep regression model for data prediction. Finally, the second financial set is input into the pre-trained deep regression model for data prediction to obtain the prediction result, which can realize the data prediction of the second financial set from both the label and feature aspects, avoid the impact of uneven sample distribution, and improve the accuracy of data prediction. The embodiment of the present application makes the distance between the constraint features closer by constraining the pairwise distance between features and the pairwise distance between labels, thereby improving the accuracy of data prediction as a whole and avoiding the impact of uneven sample distribution.

[0033] The following is a detailed description with reference to the accompanying drawings.

[0034] Figure 1 is an optional flowchart of a data prediction method based on a deep regression model provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0035] Step S101, obtaining a financial data set, and dividing the financial data set into a first financial set and a second financial set.

[0036] It should be noted that each financial data in the financial dataset carries a financial label.

[0037] In step S101 of some embodiments, a financial data set is obtained and partitioned to remove invalid or erroneous data records, and the scale of the data is adjusted to a uniform range. The financial data set is then partitioned according to a certain ratio to obtain a first financial set and a second financial set, so as to facilitate subsequent training and verification of the deep regression model.

[0038] It should be noted that the first financial set in the embodiment of the present application includes a training set and a validation set, and the second financial set includes a test set.

[0039] Step S102: input the first financial set into the deep regression model for batch division, and output multiple financial sample batches.

[0040] It should be noted that each financial sample batch includes at least two financial data.

[0041] In step S102 of some embodiments, the first financial set is input into a deep regression model for batch division, the first financial set is divided into multiple batches, and multiple financial sample batches are output, and each financial sample batch includes at least two financial data, that is, includes at least two financial labels, to facilitate the subsequent calculation of the label distance matrix and the feature distance matrix.

[0042] Step S103: for each batch of financial samples, a subtraction operation is performed on the financial labels of the financial data to obtain a label distance matrix, where the label distance matrix is ​​used to represent the distance between the financial labels.

[0043] In step S103 of some embodiments, for each batch of financial samples, a subtraction operation is performed on the financial labels of the financial data to obtain a label distance matrix, so as to determine the distance between the financial labels of the financial data, which facilitates the subsequent consistency constraints on the financial data.

[0044] Specifically, taking a financial sample batch including four financial data as an example, there are four financial labels at this time, and then the four financial labels are subtracted two by two to obtain a 4*4 label distance matrix.

[0045] Step S104, performing distance estimation on the batch of financial samples through the feature distance reading module in the deep regression model to obtain a feature distance matrix, and performing feature mapping on the batch of financial samples through the regression head of the deep regression model to obtain a regression value.

[0046] In step S104 of some embodiments, the distance of the financial sample batch is estimated by the feature distance readout module in the deep regression model to obtain a feature distance matrix, so as to determine the distance between multiple feature vectors in the financial data, which is convenient for subsequent constraints on the feature vectors. The financial sample batch is feature mapped by the regression head of the deep regression model to obtain the regression value, thereby ensuring that the deep regression model can capture the relationship between the input data and the target regression value.

[0047] Step S105, training a deep regression model according to the label distance matrix, the feature distance matrix, and the regression value to obtain a pre-trained deep regression model.

[0048] In step S105 of some embodiments, a deep regression model is trained based on the label distance matrix, the feature distance matrix, and the regression value. By constraining the pairwise distances between features to be closer to the pairwise distances between labels, the effect of the regression task is improved, and a pre-trained deep regression model is obtained, thereby improving the prediction accuracy of the deep regression model and further improving the overall effect of the regression task.

[0049] Step S106: input the second financial set into the pre-trained deep regression model for data prediction to obtain a prediction result.

[0050] In step S106 of some embodiments, the second financial set is input into a pre-trained deep regression model for data prediction, so that the deep regression model performs distance consistency constraints on the financial data in the second financial set to obtain a prediction result, thereby improving the accuracy of the prediction result, avoiding the impact of uneven sample distribution, and still achieving better prediction for some samples with a small probability of occurrence in the distribution.

[0051] See also Figure 2 In some embodiments, step S101 may also include but is not limited to steps S201 to S203.

[0052] Step S201, preprocessing the financial data set.

[0053] Step S202, extracting features from the preprocessed financial data set to obtain feature vectors corresponding to the financial data.

[0054] Step S203: perform a bucketing operation on the financial data set to obtain a first financial set and a second financial set.

[0055] In steps S201 to S203 of some embodiments, in the process of data segmentation of the financial data set, the financial data set is first preprocessed. Specifically, the financial data in the financial data set is cleaned and normalized to remove invalid or erroneous data records and adjust the scale of the data to a uniform range. Feature extraction is then performed on the preprocessed financial data set to obtain feature vectors corresponding to the financial data, which is convenient for subsequent processing of different feature vectors. Finally, the financial data set is bucketed. Bucketing can convert continuous data into grouped data, making the data distribution easier to visualize and understand, and obtaining a first financial set and a second financial set, thereby smoothing random fluctuations in the data and reducing the impact of noise on the analysis.

[0056] It is worth noting that in the process of extracting features from the financial data set after preprocessing operations, feature extraction can be performed according to different data categories. Specifically, images can be extracted through convolutional neural networks, text can be converted into numerical vectors through word embedding, etc. The embodiments of the present application do not impose specific restrictions on the feature extraction process of the financial data set.

[0057] In some embodiments, in the process of bucketing a financial data set, the embodiments of the present application first determine the logic of bucketing, for example, based on a numerical range (such as amount, rate of return, etc.) or based on other business rules. The buckets can be equal width (each bucket has the same range width), equal frequency (each bucket contains the same number of data points) or custom buckets based on business logic, and then the data is bucketed through statistical software or programming language to obtain a first financial set and a second financial set.

[0058] See also Figure 3 , Figure 3 This is a flowchart of a specific method for estimating the distance of a batch of financial samples through a feature distance readout module in a deep regression model provided by an embodiment of the present application. The method includes but is not limited to the following steps S301 to S302.

[0059] Step S301 : input the batch of financial samples into the feature distance reading module of the deep regression model, so that the feature distance reading module subtracts the feature vectors in the batch of financial samples to obtain a subtraction result.

[0060] Step S302, performing distance estimation on the subtraction result by using a preset activation function and a preset readout vector to obtain a feature distance matrix.

[0061] It should be noted that the readout vector is a weight vector in the feature distance readout module, and the feature distance matrix is ​​used to represent the distance between feature vectors.

[0062] In steps S301 to S302 of some embodiments, in the process of performing distance estimation on the financial sample batches through the feature distance readout module in the deep regression model, the embodiment of the present application first inputs the financial sample batches into the feature distance readout module of the deep regression model, so that the feature distance readout module subtracts multiple feature vectors in the same financial sample batch to obtain a subtraction result, and then activates the subtraction results of the multiple feature vectors through a preset activation function to obtain a distance vector, and then performs distance estimation on the subtraction results through a preset readout vector to obtain a feature distance matrix, so that the distance between multiple feature vectors in the financial data can be determined, which is convenient for subsequent constraints on the feature vectors.

[0063] It should be noted that the characteristic distance reading module of the embodiment of the present application reads and Taking two features as an example, the process of obtaining the feature distance matrix is ​​as follows: ; in, is the subtraction result of two eigenvectors, To read out the vector, is the activation function.

[0064] Specifically, taking a financial sample batch with four financial data as an example, each financial data will have a feature vector. By calculating the four feature vectors in pairs through the feature distance reading module, a 4*4 feature distance matrix can be obtained.

[0065] It can be understood that the activation function in the embodiment of the present application can be a Sigmoid activation function, a Tanh activation function, a ReLU activation function, etc., and the embodiment of the present application does not make specific limitations.

[0066] See also Figure 4 , Figure 4 This is a flowchart of a specific method for performing feature mapping on a batch of financial samples through a regression head of a deep regression model provided by an embodiment of the present application. The method includes but is not limited to the following steps S401.

[0067] It should be noted that the regression head includes at least one linear layer.

[0068] Step S401 , mapping the feature vectors of the financial sample batches layer by layer through the linear layer of the deep regression model to map the feature vectors to the corresponding linear layer to obtain regression values.

[0069] In step S401 of some embodiments, in the process of performing feature mapping on the batch of financial samples through the regression head of the deep regression model, the regression head includes at least one linear layer, and the feature vectors of the batch of financial samples are mapped layer by layer through the linear layer of the deep regression model to map the feature vectors to the corresponding linear layers to obtain regression values, thereby ensuring that the deep regression model can capture the relationship between the input data and the target regression value.

[0070] See also Figure 5 In some embodiments, step S102 may also include but is not limited to steps S501 to S503.

[0071] Step S501, determining the data type of the first financial set.

[0072] Step S502: input the first financial set into the deep regression model, so that the deep regression model encodes the first financial set according to the data type and outputs a plurality of encoding features.

[0073] Step S503, performing a bucketing operation on the coding features, and performing average calculation on the coding features after the bucketing operation to obtain multiple batches of financial samples.

[0074] In steps S501 to S503 of some embodiments, in the process of inputting the first financial set into the deep regression model for batch division, first, since different data types of data sets require different encoders, the embodiment of the present application will first determine the data type of the first financial set, and then input the first financial set into the deep regression model, so that the deep regression model selects an encoder suitable for the first financial set according to the data type, encodes the first financial set, and outputs multiple encoding features. Finally, the encoding features are bucketed, and the encoding features after the bucketing operation are averaged. The features in each bucket are merged into an average value through bucketing and averaging, thereby reducing the dimension of the features and obtaining multiple batches of financial samples, thereby smoothing the random noise of a single data point and helping to highlight the overall trend of the data. That is, the embodiment of the present application buckets the features obtained by the encoder, averages the features in the buckets, and uses the obtained average vector to calculate the feature distance matrix, thereby alleviating the problem of unbalanced sample distribution in the regression task. It is worth noting that the embodiments of the present application will select different pre-trained models as encoders for different inputs. For example, when the data type of the first financial set is an image type, ResNet50 can be selected as the encoder; when the data type of the first financial set is a text type, transformer can be selected as the encoder, and so on. The embodiments of the present application do not impose any specific restrictions on the selection of the encoder.

[0075] See also Figure 6In some embodiments, step S105 may also include but is not limited to steps S601 to S603.

[0076] Step S601, performing similarity calculation on the label distance matrix and the feature distance matrix to obtain a similarity loss value.

[0077] Step S602, calculating the regression loss value between the regression value and the preset true value by using a preset loss function.

[0078] Step S603, performing gradient calculation on the deep regression model according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model.

[0079] In steps S601 to S603 of some embodiments, in the process of training the deep regression model according to the label distance matrix, the feature distance matrix and the regression value, the embodiments of the present application first perform similarity calculation on the label distance matrix and the feature distance matrix, that is, calculate the similarity loss value between the label distance matrix and the feature distance matrix, and then calculate the regression loss value between the regression value and the preset true value through a preset loss function. The gradient descent guided by the loss function can effectively optimize the model parameters and minimize the prediction error. Finally, the deep regression model is gradient calculated according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model, thereby improving the prediction accuracy of the deep regression model and further improving the overall effect of the regression task.

[0080] It can be understood that the embodiment of the present application performs gradient descent through back propagation, and the gradient descent algorithm automatically updates parameters according to the gradient of the loss function, reducing the need for manual adjustment of parameters, and the gradient descent algorithm helps to find the local or global minimum of the loss function, thereby obtaining better model performance.

[0081] Specifically, in the process of calculating the similarity between the label distance matrix and the feature distance matrix, you can choose mean square error loss, normalized cross-correlation loss, etc. for calculation. In the process of calculating the regression loss value between the regression value and the preset true value through a preset loss function, you can choose mean square error loss for calculation.

[0082] See also Figure 7 , Figure 7 is a flow chart of a data prediction method based on a deep regression model provided by another embodiment of the present application, Figure 7 The method may include but is not limited to step S701.

[0083] It should be noted that the first financial set includes a validation set. Step S701 occurs after the gradient of the deep regression model is calculated according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model.

[0084] Step S701: input the validation set into the pre-trained deep regression model for model testing.

[0085] In step S701 of some embodiments, the first financial set includes a training set and a validation set. After obtaining the pre-trained deep regression model, the embodiments of the present application will also input the validation set into the pre-trained deep regression model for model testing, that is, the obtained deep regression model is tested on the validation set, so as to evaluate the model's generalization ability for new data, verify the stability of the deep regression model, and improve the accuracy of data prediction of the deep regression model.

[0086] It is worth noting that in the process of model testing in the embodiment of the present application, different test conditions can also be set according to the actual usage scenario. When the target of interest is the absolute majority of samples, such as age estimation, then the test set can be directly verified. However, if the target of interest is samples in a specific range, such as the business target of interest is outlier detection, balanced sampling and post-testing are required.

[0087] See also Figure 8 The embodiment of the present application also provides a data prediction device based on a deep regression model, the device comprising: The data acquisition module 801 is used to acquire a financial data set and divide the financial data set into a first financial set and a second financial set, wherein each financial data in the financial data set carries a financial label; A batch division module 802 is used to input the first financial set into the deep regression model for batch division, and output a plurality of financial sample batches, wherein each financial sample batch includes at least two of the financial data; A matrix calculation module 803 is used to perform a subtraction operation on the financial labels of the financial data for each batch of financial samples to obtain a label distance matrix, where the label distance matrix is ​​used to represent the distance between the financial labels; The distance estimation module 804 is used to perform distance estimation on the batch of financial samples through the feature distance reading module in the deep regression model to obtain a feature distance matrix, and perform feature mapping on the batch of financial samples through the regression head of the deep regression model to obtain a regression value; A model training module 805 is used to train the deep regression model according to the label distance matrix, the feature distance matrix and the regression value to obtain a pre-trained deep regression model; The data prediction module 806 is used to input the second financial set into the pre-trained deep regression model for data prediction to obtain a prediction result.

[0088] It is worth noting that the model training module 805 in the embodiment of the present application is also used to input the verification set of the first financial set into the pre-trained deep regression model for model testing.

[0089] The specific implementation of the data prediction device based on the deep regression model is basically the same as the specific implementation of the data prediction method based on the deep regression model mentioned above, and will not be repeated here.

[0090] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned data prediction method based on the deep regression model. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0091] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes: The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the data prediction method based on the deep regression model of the embodiment of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0092] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned data prediction method based on the deep regression model.

[0093] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0094] The data prediction method, device, electronic device and storage medium based on the deep regression model provided by the embodiments of the present application first obtain a financial data set including financial data, and divide the financial data set into a first financial set and a second financial set, so as to facilitate the subsequent training of the deep regression model, and then input the first financial set into the deep regression model for batch division to obtain multiple financial sample batches, so as to facilitate the subsequent model to learn more generalized feature representations, and for each financial sample batch, subtract the financial labels of the financial data to obtain a label distance matrix, so as to obtain the distance between the financial labels of the financial data, and then estimate the distance of the financial sample batches through the feature distance reading module in the deep regression model to obtain the feature Distance matrix, and feature mapping of the financial sample batches through the regression head of the deep regression model to obtain regression values, which can predict accurate numerical results from the input features of the financial sample batches. After that, the deep regression model is trained according to the label distance matrix, feature distance matrix and regression values, so that the deep regression model can combine the label distance matrix and feature distance matrix for data prediction, realize the training of the deep regression model, and improve the accuracy of the deep regression model for data prediction. Finally, the second financial set is input into the pre-trained deep regression model for data prediction to obtain the prediction results, which can realize the data prediction of the second financial set from both the label and feature aspects, avoid the impact of uneven sample distribution, and improve the accuracy of data prediction. The embodiment of the present application makes the distance between the constraint features closer by constraining the pairwise distance between features and the pairwise distance between labels, thereby improving the accuracy of data prediction as a whole and avoiding the impact of uneven sample distribution.

[0095] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0096] It can be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.

[0097] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0098] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0099] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0100] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0101] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0102] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0105] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data prediction method based on a deep regression model, characterized in that: The method comprises: Acquire a financial data set, and perform data segmentation on the financial data set to obtain a first financial set and a second financial set, wherein each financial data in the financial data set carries a financial label; Inputting the first financial set into a deep regression model for batch division, and outputting a plurality of financial sample batches, wherein each of the financial sample batches includes at least two of the financial data; For each of the financial sample batches, subtract the financial labels of the financial data to obtain a label distance matrix, where the label distance matrix is ​​used to represent the distances between the financial labels; Performing distance estimation on the batch of financial samples through a feature distance reading module in the deep regression model to obtain a feature distance matrix, and performing feature mapping on the batch of financial samples through a regression head of the deep regression model to obtain a regression value; Training the deep regression model according to the label distance matrix, the feature distance matrix, and the regression value to obtain a pre-trained deep regression model; The second financial set is input into a pre-trained deep regression model for data prediction to obtain a prediction result.

2. The data prediction method based on the deep regression model according to claim 1 is characterized in that: The data segmentation of the financial data set to obtain a first financial set and a second financial set includes: Performing a preprocessing operation on the financial data set; Performing feature extraction on the financial data set after the preprocessing operation to obtain a feature vector corresponding to the financial data; The financial data set is bucketed to obtain a first financial set and a second financial set.

3. The data prediction method based on the deep regression model according to claim 2 is characterized in that: The step of performing distance estimation on the batch of financial samples through the feature distance reading module in the deep regression model to obtain a feature distance matrix includes: Inputting the financial sample batch into the feature distance reading module of the deep regression model, so that the feature distance reading module subtracts the feature vectors in the financial sample batch to obtain a subtraction result; The distance of the subtraction result is estimated by using a preset activation function and a preset readout vector to obtain a feature distance matrix, wherein the readout vector is a weight vector in the feature distance readout module, and the feature distance matrix is ​​used to characterize the distance between the feature vectors.

4. The data prediction method based on the deep regression model according to claim 2 is characterized in that: The regression head includes at least one linear layer; the step of performing feature mapping on the batch of financial samples through the regression head of the deep regression model to obtain a regression value includes: The feature vectors of the batch of financial samples are mapped layer by layer through the linear layer of the deep regression model to map the feature vectors to the corresponding linear layer to obtain regression values.

5. The data prediction method based on the deep regression model according to claim 1 is characterized in that: The step of inputting the first financial set into the deep regression model for batch division and outputting multiple batches of financial samples includes: determining a data type of the first financial set; Inputting the first financial set into a deep regression model, so that the deep regression model performs encoding processing on the first financial set according to the data type and outputs a plurality of encoding features; The coding features are bucketed, and the coded features after the bucketing operation are averaged to obtain multiple financial sample batches.

6. The data prediction method based on the deep regression model according to claim 1, characterized in that: The step of training the deep regression model according to the label distance matrix, the feature distance matrix, and the regression value to obtain a pre-trained deep regression model includes: Performing similarity calculation on the label distance matrix and the feature distance matrix to obtain a similarity loss value; Calculating a regression loss value between the regression value and a preset true value using a preset loss function; The deep regression model is gradient calculated according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model.

7. The data prediction method based on the deep regression model according to claim 6 is characterized in that: The first financial set includes a validation set; after performing gradient calculation on the deep regression model according to the similarity loss value and the regression loss value to obtain a pre-trained deep regression model, the method further includes: The validation set is input into the pre-trained deep regression model for model testing.

8. A data prediction device based on a deep regression model, characterized in that: The device comprises: A data acquisition module, used to acquire a financial data set, and divide the financial data set into a first financial set and a second financial set, wherein each financial data in the financial data set carries a financial label; A batch division module, used for inputting the first financial set into a deep regression model for batch division, and outputting a plurality of financial sample batches, wherein each of the financial sample batches includes at least two of the financial data; A matrix calculation module, used for performing a subtraction operation on the financial labels of the financial data for each batch of the financial samples to obtain a label distance matrix, wherein the label distance matrix is ​​used to represent the distance between the financial labels; A distance estimation module, configured to perform distance estimation on the batch of financial samples through a feature distance reading module in the deep regression model to obtain a feature distance matrix, and perform feature mapping on the batch of financial samples through a regression head of the deep regression model to obtain a regression value; A model training module, used to train the deep regression model according to the label distance matrix, the feature distance matrix and the regression value to obtain a pre-trained deep regression model; The data prediction module is used to input the second financial set into a pre-trained deep regression model for data prediction to obtain a prediction result.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the data prediction method based on the deep regression model described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data prediction method based on a deep regression model described in any one of claims 1 to 7 is implemented.