Business prediction method, training method of business prediction model and computer equipment
By using the frequency domain fitting function in the business prediction model to process continuous features and intersect features with discrete features, the problem of inaccurate characterization of continuous features is solved, and the accuracy of business prediction is improved.
Patent Information
- Application Number
- CN202311015185.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-11
- Publication Date
- 2025-02-18
AI Technical Summary
When processing continuous features, the prior art has inaccurate feature characterization, resulting in low business prediction accuracy.
The second embedding layer of the business prediction model is used to map the fitting functions of continuous features in each frequency domain space to obtain feature vectors, and characterization accuracy is improved through feature crossover.
By adapting to the data distribution changes of continuous features in different business scenarios, a reasonable feature vector representation of continuous features is obtained, which improves the representation accuracy of business feature vectors, thereby improving the accuracy of business prediction.
Smart Images

Figure CN119475003A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence technology and deep learning technology, and in particular to a business prediction method, a business prediction model training method and a computer device. Background Art
[0002] With the rapid development of artificial intelligence technology, machine learning is increasingly being used. A typical application of machine learning is business prediction. Business models are trained using business data and business predictions are achieved using business models. Business models can be applied to services such as video recommendation, music recommendation, news recommendation, search engines, and question-answer retrieval.
[0003] The original data of nature is a low-dimensional manifold embedded in the high-dimensional space where the original data is located. Then, the task of deep learning is to map the high-dimensional original data (images, sentences) to a low-dimensional manifold, so that the high-dimensional original data becomes separable after being mapped to the low-dimensional manifold, and this mapping is called embedding. For continuous data, commonly used methods include data standardization, MinMax normalization, equal-distance binning, equal-frequency binning, and card-point binning. However, these methods have the problem of inaccurate feature representation, which leads to low accuracy of business predictions. Summary of the invention
[0004] Based on this, it is necessary to provide a business prediction method and device that accurately characterizes continuous features and thereby improves the accuracy of business predictions, a business prediction model training method and device, computer equipment, computer-readable storage media, and computer program products to address the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a business forecasting method, the method comprising:
[0006] Acquire target business data; the target business data includes discrete features and continuous features;
[0007] Inputting the discrete feature into a first embedding layer of a business prediction model, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature;
[0008] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameter of the fitting function conforms to the data distribution of the continuous feature and is obtained by training the business prediction model;
[0009] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0010] The business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
[0011] In a second aspect, the present application also provides a method for training a business prediction model, the method comprising:
[0012] Acquire a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object;
[0013] Inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features;
[0014] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature;
[0015] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0016] Inputting the service feature vector into the classifier of the service prediction model, and outputting the service prediction result through the classifier;
[0017] Based on the loss function of the business prediction model, adjusting the parameters of the business model; the loss function includes the cross entropy loss of the business prediction result and the prediction object;
[0018] Iteratively return to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer to obtain the feature vector of the discrete features, and continuing to train the business prediction model using the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
[0019] In a third aspect, the present application further provides a business prediction device, the device comprising:
[0020] A data acquisition module is used to acquire target business data; the target business data includes discrete features and continuous features;
[0021] A first embedding processing module, used for inputting the discrete feature into a first embedding layer of a business prediction model, and converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature;
[0022] A second embedding processing module is used to input the continuous feature into a second embedding layer of the business prediction model, and the second embedding layer maps the continuous feature to multiple frequency domain spaces by using the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameters of the fitting function conform to the data distribution of the continuous feature and are obtained by training the business prediction model;
[0023] A feature crossover module, used to perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0024] The prediction module is used to input the business feature vector into the classifier of the business prediction model and output the business prediction result through the classifier.
[0025] In a fourth aspect, the present application also provides a training device for a business prediction model, the device comprising:
[0026] A sample set acquisition module, used to acquire a business sample set, each sample of the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object;
[0027] A discrete processing module, used for inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features;
[0028] A continuous processing module, used for inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature;
[0029] A cross processing module, used for performing feature cross processing on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0030] A classification module, used for inputting the service feature vector into a classifier of the service prediction model, and outputting a service prediction result through the classifier;
[0031] An adjustment module, used to adjust the parameters of the business model based on the loss function of the business prediction model; the loss function includes the cross entropy loss of the business prediction result and the prediction object;
[0032] An iterative control module is used to control iterative training when the training iteration stop condition is not met, so as to continue to train the business prediction model using the business sample set until the training iteration stop condition is met, thereby obtaining a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous feature.
[0033] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0034] Acquire target business data; the target business data includes discrete features and continuous features;
[0035] Inputting the discrete feature into a first embedding layer of a business prediction model, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature;
[0036] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameter of the fitting function conforms to the data distribution of the continuous feature and is obtained by training the business prediction model;
[0037] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0038] The business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
[0039] In a sixth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0040] Acquire a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object;
[0041] Inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features;
[0042] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature;
[0043] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0044] Inputting the service feature vector into the classifier of the service prediction model, and outputting the service prediction result through the classifier;
[0045] Based on the loss function of the business prediction model, adjusting the parameters of the business model; the loss function includes the cross entropy loss of the business prediction result and the prediction object;
[0046] Iteratively return to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer to obtain the feature vector of the discrete features, and continuing to train the business prediction model using the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
[0047] In a seventh aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0048] Acquire target business data; the target business data includes discrete features and continuous features;
[0049] Inputting the discrete feature into a first embedding layer of a business prediction model, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature;
[0050] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameter of the fitting function conforms to the data distribution of the continuous feature and is obtained by training the business prediction model;
[0051] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0052] The business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
[0053] In an eighth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0054] Acquire a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object;
[0055] Inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features;
[0056] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature;
[0057] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0058] Inputting the service feature vector into the classifier of the service prediction model, and outputting the service prediction result through the classifier;
[0059] Based on the loss function of the business prediction model, adjusting the parameters of the business model; the loss function includes the cross entropy loss of the business prediction result and the prediction object;
[0060] Iteratively return to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer to obtain the feature vector of the discrete features, and continuing to train the business prediction model using the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
[0061] In a ninth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0062] Acquire target business data; the target business data includes discrete features and continuous features;
[0063] Inputting the discrete feature into a first embedding layer of a business prediction model, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature;
[0064] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameter of the fitting function conforms to the data distribution of the continuous feature and is obtained by training the business prediction model;
[0065] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0066] The business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
[0067] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0068] Acquire a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object;
[0069] Inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features;
[0070] Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature;
[0071] Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector;
[0072] Inputting the service feature vector into the classifier of the service prediction model, and outputting the service prediction result through the classifier;
[0073] Based on the loss function of the business prediction model, adjusting the parameters of the business model; the loss function includes the cross entropy loss of the business prediction result and the prediction object;
[0074] Iteratively return to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer to obtain the feature vector of the discrete features, and continuing to train the business prediction model using the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
[0075] The above-mentioned business prediction method, device, computer equipment, storage medium and computer program product are processed by using a business prediction model. The first embedding layer of the business prediction model processes discrete features to complete the embedding of discrete features. The second embedding layer of the business prediction model processes continuous features. The second embedding layer expresses the continuous features in the frequency domain by using the fitting function of the continuous features in each frequency domain space, and maps the continuous features to the amplitude in the continuous or discrete frequency domain, thereby mapping the continuous features and distribution to the frequency domain expression corresponding to the features, and realizing the fitting of different features for the feature distribution. The parameters of the fitting function conform to the data distribution of the continuous features and are obtained by training the business prediction model. Therefore, the embedding method of the continuous features in this embodiment can adapt to the changes in the data distribution of the continuous features in different business scenarios, and can obtain a reasonable feature vector representation of the continuous features. On this basis, the feature vector of the discrete feature and the feature vector of the continuous feature are cross-featured to obtain a business feature vector, which improves the representation accuracy of the business feature vector and thus improves the accuracy of business prediction.
[0076] The training method, device, computer equipment, storage medium and computer program product of the above-mentioned business model, the business prediction model includes a second embedding layer for embedding continuous features. During the business model training process, the second embedding layer is synchronously trained. The second embedding layer maps the continuous features to multiple frequency domain spaces by using the fitting function of the continuous features in each frequency domain space to obtain the feature vector of the continuous features, so that the second embedding layer can adapt to the changes in the data distribution of the continuous features in different business scenarios during the business prediction model training process, and can obtain a reasonable feature vector representation of the continuous features. On this basis, the feature vector of the discrete feature and the feature vector of the continuous feature are cross-featured to obtain the business feature vector, which improves the representation accuracy of the business feature vector and thus improves the accuracy of business prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 An application environment diagram of a business prediction method and a business prediction model training method in one embodiment;
[0078] Figure 2 A flowchart of a business prediction method in an embodiment;
[0079] Figure 3 is a flow chart of a process of fitting using Fourier transform in one embodiment;
[0080] Figure 4 A schematic diagram of the structure of a business prediction model in an embodiment;
[0081] Figure 5 A flowchart of a training method for a business prediction model in one embodiment;
[0082] Figure 6 is a schematic diagram illustrating training the second embedding layer using Fourier transform in one embodiment;
[0083] Figure 7 is a structural block diagram of a business prediction device in one embodiment;
[0084] Figure 8 is an internal structure diagram of a training device for a business prediction model in one embodiment;
[0085] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0086] 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.
[0087] 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. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0088] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. 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 and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0089] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0090] The solution provided in the embodiments of the present application involves technologies such as machine learning, which are specifically described by the following embodiments:
[0091] The business prediction method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other servers.
[0092] Among them, the terminal 102 is installed with business software, and the business software provides business services for users. The terminal 102 sends user data to the server 104, and the server obtains target business data; the target business data includes discrete features and continuous features; the discrete features are input into the first embedding layer of the business prediction model, and the discrete features are converted and processed by the first embedding layer to obtain the feature vector of the discrete features; the continuous features are input into the second embedding layer of the business prediction model, and the second embedding layer maps the continuous features to multiple frequency domain spaces by using the fitting function of the continuous features in each frequency domain space to obtain the feature vector of the continuous features; wherein the parameters of the fitting function conform to the data distribution of the continuous features and are obtained by training the business prediction model; the feature vectors of the discrete features and the continuous features are cross-featured to obtain the business feature vector; the business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
[0093] The server pushes the business prediction result to the terminal 102. In one embodiment, the business software is a video software that provides video services to users. The server obtains the prediction result of video recommendation based on the business prediction model, and pushes the recommended video to the terminal 102. In one embodiment, the business software is a shopping platform that provides commodity shopping services to users. The server obtains the prediction result of commodity recommendation based on the business prediction model, and pushes the recommended commodity to the terminal 102.
[0094] The server can also implement a training method for a business prediction model, which method includes: obtaining a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object; inputting the discrete feature in the sample into a first embedding layer of the business prediction model to be trained, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature; inputting the continuous feature into a second embedding layer of the business prediction model, the second embedding layer maps the continuous feature to multiple frequency domain spaces by using the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain business feature vector; inputting the business feature vector into the classifier of the business prediction model, and outputting the business prediction result through the classifier; adjusting the parameters of the business model based on the loss function of the business prediction model; the loss function includes the cross entropy loss of the business prediction result and the prediction object; iteratively returning to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer, and obtaining the feature vector of the discrete features, so as to continue to train the business prediction model with the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
[0095] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0096] In one embodiment, Figure 2 As shown, a business prediction method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0097] Step 202, obtaining target business data; the target business data includes discrete features and continuous features.
[0098] The target business data includes business data of multiple dimensions required for realizing business prediction, and the required dimensions are related to the objects of business processing. In one embodiment, the target business data may include business data of user dimension and business data of business processing object dimension.
[0099] From the perspective of content, business data in the user dimension includes basic information about users and behavioral information generated during the use of business software. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0100] The business processing object is the prediction object of the business prediction service provided by the business software, and the business data of the business processing object dimension is the business data of the prediction object. Taking the business software as video software as an example, the prediction object of the business prediction service is the recommended video of the video software, and the business data of the business processing object dimension is the business data of the recommended video, including the name, type, director, starring, introduction, etc. of the recommended video. Taking the business software as shopping software as an example, the prediction object of the business prediction service is the recommended product of the shopping software, and the business data of the business processing object dimension is the business data of the recommended product, including the name, category, price, etc. of the recommended product.
[0101] By analyzing the content of the target business data, the target business data can usually be divided into discrete features and continuous features.
[0102] Discrete features refer to data whose values can only be calculated using natural numbers or integer units. For example, the name of a video, the type of video, and the introduction of a video are discrete features. Another example is the name of a product, the category to which the product belongs, etc. are discrete features.
[0103] Continuous features are data that can take any value within a certain interval. Their values are continuous, and two adjacent values can be divided infinitely, that is, they can take infinite values. A typical continuous feature is numerical data. For example, the total length of a video, the viewing time of a video, etc. are continuous features. For example, the price of a product is a continuous feature.
[0104] Step 204: input the discrete feature into the first embedding layer of the business prediction model, and convert the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature.
[0105] The business prediction model is a model obtained through deep learning. Natural raw data is a low-dimensional manifold embedded in the high-dimensional space where the raw data is located. The task of deep learning is to map the high-dimensional raw data (images, sentences) to a low-dimensional manifold, so that the high-dimensional raw data becomes separable after being mapped to the low-dimensional manifold, and this mapping is called embedding. So generally speaking, the embedding layer is the first layer of the deep learning model.
[0106] In this embodiment, the embedding layer of the business prediction model includes a first embedding layer and a second embedding layer. The first embedding layer is used to process discrete features. The first embedding layer digitizes the discrete features and converts them into continuous input data to obtain a feature vector of the discrete features. For example, text data is converted into continuous input data to better process text. The feature vector of the discrete feature is a conversion of the discrete feature into a continuous vector expression.
[0107] In one embodiment, if the discrete feature is text data, the first embedding layer can convert the text into a feature vector of the discrete feature by using text embedding (also known as word vector). The text embedding methods may include one-hot encoding, bag of words, TF-IDF method and n-gram model.
[0108] Step 206: input the continuous feature into the second embedding layer of the business prediction model. The second embedding layer maps the continuous feature to multiple frequency domain spaces by utilizing the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature. The parameters of the fitting function conform to the data distribution of the continuous feature and are obtained by training the business prediction model.
[0109] The second embedding layer is used to transform continuous features. Common continuous data embedding methods include data standardization, MinMax normalization, equal-distance binning, equal-frequency binning, and card-point binning. These methods rely on the assumption that the data distribution is the same. Once the model structure is determined, the data processing method cannot be changed, so it is only applicable to situations where the data distribution of the training data set and the actual data set does not change much. If the data distribution changes significantly, the traditional embedding method of continuous features will have the problem of inaccurate feature representation.
[0110] Different from the traditional embedding processing of continuous features, in this embodiment, the second embedding layer is part of the business prediction model and is trained together with the business prediction model. The embedding processing method adopted is to utilize the fitting function of the continuous feature in each frequency domain space to map the continuous feature to multiple frequency domain spaces to obtain the feature vector of the continuous feature.
[0111] The horizontal axis of the frequency domain space is frequency, and the vertical axis is the amplitude of the frequency signal. The second embedding layer uses the fitting function of the continuous feature in each frequency domain space to express the continuous feature in the frequency domain, and maps the continuous feature to the amplitude in the continuous or discrete frequency domain, thereby mapping the continuous feature distribution to the frequency domain expression corresponding to the feature, and realizing the fitting of different features for the feature distribution. The parameters of the fitting function conform to the data distribution of the continuous feature, which is obtained by training the business prediction model. Therefore, the embedding method of the continuous feature in this embodiment can adapt to the changes in the data distribution of the continuous feature in different business scenarios, and can obtain a reasonable feature vector representation of the continuous feature.
[0112] Step 208: Perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector.
[0113] Feature crossover, also called feature combination, refers to multiplying two or more features to achieve nonlinear transformation of the sample space to increase the nonlinear ability of the model. The business feature vector is the result of the feature crossover of the feature vector of the discrete feature and the feature vector of the continuous feature. In one embodiment, the feature crossover method can be Hadamard product, etc.
[0114] In this embodiment, feature crossover can be performed on feature vectors of different types of discrete features, so as to obtain more effective information expression. For example, Shenzhen City - white-collar workers, a certain star - TV series. Feature crossover can also be performed on feature vectors of discrete features and feature vectors of continuous features. For example, m minutes - a certain TV series, clicked n times - a certain movie.
[0115] Step 210: input the service feature vector into the classifier of the service prediction model, and output the service prediction result through the classifier.
[0116] The service feature vector is input into the classifier of the service prediction model, and the classifier processes the service feature vector and outputs the service prediction result. It can be understood that the parameters of the classifier of the service prediction model are obtained by pre-training.
[0117] The above-mentioned business prediction method is processed by using a business prediction model. The first embedding layer of the business prediction model processes discrete features to complete the embedding of discrete features. The second embedding layer of the business prediction model processes continuous features. The second embedding layer uses the fitting function of the continuous features in each frequency domain space to express the continuous features in the frequency domain, and maps the continuous features to the amplitude in the continuous or discrete frequency domain, thereby mapping the continuous features and distribution to the frequency domain expression corresponding to the features, and realizing the fitting of different features for the feature distribution. The parameters of the fitting function conform to the data distribution of the continuous features and are obtained by training the business prediction model. Therefore, the embedding method of the continuous features in this embodiment can adapt to the changes in the data distribution of the continuous features in different business scenarios, and can obtain a reasonable feature vector representation of the continuous features. On this basis, the feature vector of the discrete feature and the feature vector of the continuous feature are cross-featured to obtain a business feature vector, which improves the representation accuracy of the business feature vector and thus improves the accuracy of business prediction.
[0118] In another embodiment, the second embedding layer obtains a fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains a feature vector of the continuous feature according to the amplitude in each frequency domain space.
[0119] Fourier transform can be used to analyze the frequency and amplitude of a signal, where the signal can be a periodic signal or a non-periodic signal. For non-periodic signals, Fourier transform can represent non-periodic signals by integrating the signal over an infinite interval and decomposing the signal into a sum of a set of continuous sine and cosine functions. Fourier transform converts a signal in the time domain (i.e., the representation of the signal on the time axis) into a signal in the frequency domain (i.e., the representation of the signal on the frequency axis), so the signal can be decomposed into the amplitude and phase information of different frequency components.
[0120] The horizontal axis of the frequency domain space is the frequency, and the vertical axis is the amplitude of the frequency signal. Based on the processing capability of Fourier transform for non-periodic signals, in this embodiment, the continuous feature is mapped to multiple frequency domain spaces, and the feature vector of the continuous feature is obtained according to the amplitude in each frequency domain space. The Fourier transform parameters are obtained through business prediction model training and conform to the data distribution of the continuous feature.
[0121] In other embodiments, Laplace or Z transform can be used to implement the embedding process of the second embedding layer for continuous features. When Laplace or Z transform is used, the Laplace parameters or Z transform parameters related to the second embedding layer are obtained through business prediction model training, and the related parameters also conform to the data distribution of continuous features.
[0122] In this embodiment, Fourier transform is used to fit the spatial distribution of continuous features in each frequency domain. Fourier transform has the advantages of high efficiency and high precision, and can improve the precision and efficiency of embedding processing of continuous features.
[0123] In another embodiment, the second embedding layer obtains the fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains the feature vector of the continuous feature according to the amplitude in each frequency domain space, that is, the process of fitting using Fourier transform, such as Figure 3 As shown, including:
[0124] In step 302, the second embedding layer maps the continuous feature to a frequency domain basis through Fourier frequency domain mapping to obtain M frequency domain basis functions representing the continuous feature; the parameters of the frequency domain basis functions conform to the data distribution of the continuous feature and are obtained by training the business prediction model.
[0125] Specifically, the original continuous features are projected on the frequency domain space, and each basis in the frequency domain corresponds to a trigonometric function of the original domain (i.e., f i = sin(k i x+b i )), where k i 、b i are the relevant parameters of Fourier transform, which can be obtained through deep learning.
[0126] For example, the original continuous feature is x, and through Fourier frequency domain basis mapping, M frequency domain basis functions are obtained, which can be expressed as f i (x) = sin(k i x+b i )). Assuming x=15, M=256, 256 frequency domain basis functions will be generated.
[0127] Step 304, use the M frequency domain basis functions to perform linear combination to obtain the fitting function of the continuous feature in each frequency domain space, perform low-order Fourier series approximation on the fitting function to obtain the amplitude of the continuous feature in each frequency domain space, and obtain the feature vector of the continuous feature according to the amplitude in each frequency domain space.
[0128] First, using the Fourier expansion
[0129]
[0130] Any periodic / non-periodic function can be expressed in series through frequency domain basis functions. The frequency domain basis functions projected in step 302 are used for linear combination to obtain the fitting function of the continuous feature in each frequency domain space, and the Fourier series of the fitting function is approximated at a low order, so that each dimension of the continuous feature embedding is expressed as a low order approximation of the Fourier series. Among them, the linear combination is to multiply and scale each basis function, and then superimpose them. Specifically:
[0131]
[0132] Among them, a n , The relevant parameters of Fourier transform can be obtained through deep learning.
[0133] The low-order approximation of the Fourier series is specifically the approximate solution, that is, the process of solving the problem. The Fourier decomposition method can be used to truncate the infinite Fourier series after a certain number of terms. Therefore, the continuous feature is a Fourier approximate fitting function in each dimension of the feature vector. That is,
[0134]
[0135] The final embedding vector of the numerical feature can be expressed as the amplitude of different frequency domain spaces (F1,…,F j ,…,F n )'s splicing.
[0136] In this embodiment, Fourier series expansion and approximation are used to solve the problem, so that the continuous feature can adapt to the changes in the data distribution of the continuous feature in different business scenarios, and a reasonable feature vector representation of the continuous feature can be obtained.
[0137] A business forecasting method, by Figure 4 The business prediction model shown in Figure 1 is implemented. Figure 4 As shown in , the business prediction model includes a first embedding layer 401, a second embedding layer 402, a feature cross network 403, a feature processing network 404 and a classifier 405.
[0138] The first embedding layer 401 performs a conversion process on the discrete feature to obtain a feature vector of the discrete feature. If the continuous feature is directly cross-featured with the feature vector of the discrete feature, this method of processing the continuous feature can neither cross-feature with the discrete feature nor fit the data distribution that changes over time. In this embodiment, the second embedding layer 402 is used to map the continuous feature through the Fourier frequency domain basis to obtain M frequency domain basis functions representing the continuous feature; the parameters of the frequency domain basis function conform to the data distribution of the continuous feature and are obtained by training the business prediction model; the M frequency domain basis functions are linearly combined to obtain the fitting function of the continuous feature in each frequency domain space, and the fitting function is approximated by a low-order Fourier series to obtain the amplitude of the continuous feature in each frequency domain space, and the feature vector of the continuous feature is obtained according to the amplitude in each frequency domain space. Therefore, the feature vector of the continuous feature can be obtained by using the second embedding layer 402, and the feature vector of the continuous feature and the feature vector of other discrete features are further cross-featured by the feature cross network 403, and then the business feature vector is convolved through the feature processing network 404, and then the business prediction result is output through the classifier.
[0139] Taking the video recommendation service of video software as an example, in order to recommend videos to users on the homepage of the video playback interface, the service prediction method of the present application can be used. The method includes obtaining target service data, and the target service data includes discrete features and continuous features. Among them, discrete features such as the name of the video, the type of the video, and the introduction of the video are discrete features. Continuous features include the total length of the video, the viewing time of the video, etc.
[0140] The discrete feature is input into the first embedding layer of the business prediction model, and the discrete feature is converted by the first embedding layer to obtain a feature vector of the discrete feature.
[0141] The data distribution of continuous features changes at different times and in different application scenarios. If the change in data distribution is not taken into account, the embedding vector of the continuous feature cannot be accurately represented, and the cross-feature representation of discrete features and continuous features is inaccurate. For example, the information contained in "playing a TV series for 10 minutes" one year ago and "playing a TV series for 10 minutes" now is different. The average playing time per person a year ago may be 5 minutes, and the average playing time per person now may be 45 minutes. So 10 minutes a year ago exceeded expectations, while 10 minutes now may be lower than expected. Therefore, if the numerical feature of 10 minutes cannot adapt to the data and change, the derived cross-feature will not meet the current situation.
[0142] Taking into account the changes in the data distribution of numerical features, the continuous features are input into the second embedding layer of the business prediction model, and the continuous features are mapped to multiple frequency domain spaces through the second embedding layer, and the feature vector of the continuous features is obtained according to the amplitude in each frequency domain space. The second embedding layer expresses the continuous features in the frequency domain, maps the continuous features to the amplitude in the continuous or discrete frequency domain, and thus maps the continuous features and distribution to the frequency domain expression corresponding to the features, so as to achieve the fitting of different features for the feature distribution. In this embodiment, the parameters of the frequency domain basis function of the second embedding layer and the parameters of the fitting function conform to the data distribution of the continuous features, and are obtained by training the business prediction model. Therefore, the embedding method of the continuous features in this embodiment can adapt to the changes in the data distribution of the continuous features in different business scenarios, and can obtain a reasonable feature vector representation of the continuous features.
[0143] Perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a business feature vector. Input the business feature vector into the classifier of the business prediction model, and output the recommended video through the classifier. Based on the reasonable feature vector representation of the continuous feature, perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a business feature vector, thereby improving the representation accuracy of the business feature vector and further improving the accuracy of the recommendation.
[0144] Among them, before the business prediction method, the server can also implement a business prediction model training method.
[0145] like Figure 5 As shown, the training method of the business prediction model includes:
[0146] Step 502: Acquire a business sample set, where each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object.
[0147] The business sample set in this embodiment is used to train the business prediction model. The business sample set includes business data and the predicted objects annotated by the business data. Taking the business data as the business data for video recommendation as an example, the business data also includes the annotated recommended videos.
[0148] Step 504: input the discrete features in the sample into a first embedding layer of the business prediction model to be trained, and convert the discrete features through the first embedding layer to obtain a feature vector of the discrete features.
[0149] The implementation process of this step is similar to step 204 and will not be repeated here.
[0150] Step 506: input the continuous feature into the second embedding layer of the business prediction model. The second embedding layer maps the continuous feature to multiple frequency domain spaces by utilizing the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature.
[0151] The implementation process of this step is similar to step 206 and will not be repeated here.
[0152] Step 508: Perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector.
[0153] The implementation process of this step is similar to step 208 and will not be repeated here.
[0154] Step 510: input the service feature vector into the classifier of the service prediction model, and output the service prediction result through the classifier.
[0155] The implementation process of this step is similar to step 210 and will not be repeated here.
[0156] Step 512: Adjust the parameters of the business model based on the loss function of the business prediction model; the loss function includes the cross entropy loss of the business prediction result and the prediction object.
[0157] The second embedding layer is part of the business prediction model and is trained together with the business prediction model. Therefore, the second embedding layer can adapt to the data distribution of continuous features during the training of the business prediction model.
[0158] The cross entropy loss represents the gap between the business prediction result and the prediction object. Training the business prediction model under the constraint of the cross entropy loss can make the output result of the business prediction model close to the labeled prediction object.
[0159] In addition to the cross entropy loss, the loss function of the business prediction model can also set other losses according to specific business needs to constrain the training of the business prediction model.
[0160] Step 514, determine whether the iterative training stop condition is met. If not, return to step 504 to continue iteratively training the business prediction model using samples. If yes, execute step 516.
[0161] Step 516, obtaining a trained business prediction model.
[0162] In the training method of the above-mentioned business prediction model, the business prediction model includes a second embedding layer for embedding continuous features. During the training of the business model, the second embedding layer is trained synchronously. The second embedding layer maps the continuous features to multiple frequency domain spaces by using the fitting function of the continuous features in each frequency domain space to obtain the feature vector of the continuous features. Thus, the second embedding layer can adapt to the changes in the data distribution of the continuous features in different business scenarios during the training of the business prediction model, and can obtain a reasonable feature vector representation of the continuous features. On this basis, the feature vectors of the discrete features and the feature vectors of the continuous features are cross-featured to obtain the business feature vector, which improves the representation accuracy of the business feature vector and thus improves the accuracy of business prediction.
[0163] In one embodiment, the continuous feature is input into the second embedding layer of the business prediction model, and the second embedding layer maps the continuous feature to multiple frequency domain spaces by utilizing the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature, including: the second embedding layer obtains the fitting function of the continuous feature in each frequency domain space based on Fourier transform, and utilizes the fitting function of the continuous feature in each frequency domain space to map the continuous feature to multiple frequency domain spaces.
[0164] Specifically, Figure 6 As shown, step 1 performs Fourier frequency basis fitting. Specifically, the continuous feature is mapped by Fourier frequency domain basis to obtain M frequency domain basis functions representing the continuous feature; the parameters of the frequency domain basis functions conform to the data distribution of the continuous feature and are obtained by training the business prediction model.
[0165] Specifically, the original continuous features are projected in the frequency domain space, and each basis in the frequency domain corresponds to a trigonometric function in the original domain (i.e., f i = sin(k i x+b i )), where k i 、b i are learnable parameters.
[0166] Step 2, perform low-order approximation of the Fourier series. The M frequency domain basis functions are used for linear combination to obtain the fitting function of the continuous feature in each frequency domain space, and the fitting function is subjected to low-order approximation of the Fourier series to obtain the amplitude of the continuous feature in each frequency domain space, and the feature vector of the continuous feature is obtained according to the amplitude in each frequency domain space.
[0167] Specifically, each dimension of the numerical feature embedding is expressed as a low-order approximation of the Fourier series.
[0168] Using Fourier expansion
[0169]
[0170] Any periodic / non-periodic function can be expressed in series through frequency domain basis functions. Using the frequency domain basis functions projected in step 1, a low-order approximation of the Fourier series is performed, that is,
[0171]
[0172] Among them, a n , is a learnable parameter. The feature vector of the final continuous feature can be expressed as (F1,…,F j ,…,F N )'s splicing.
[0173] Step 3: Back propagation of gradient descent is performed. Through the neural network gradient descent algorithm, combined with the loss function of the specific application task, the Fourier approximation of each dimension in the embedding is adaptively fitted.
[0174] The above k i 、b i 、a n , They are all Fourier parameters and are learnable parameters, that is, for the same continuous eigenvalue, they can change with the distribution of training data, thereby automatically obtaining the Fourier approximation that best fits the current data distribution.
[0175] Furthermore, in one embodiment, the business prediction model may be continuously trained with incremental training sample sets to update the business prediction model so that the second embedding layer continuously adapts to the current data distribution.
[0176] Specifically, the method further includes: in response to an incremental training instruction, obtaining an incremental training sample set; training the trained business prediction model based on the incremental training sample set, and updating the parameters of the business prediction model.
[0177] Among them, for the incremental training of the business prediction model, a regular update method can be adopted, such as generating an incremental training sample set for the incremental business data during this period for training every day or every hour, so as to train and update the business prediction model using the incremental training sample set, so that the embedding method of continuous features can continuously adapt to the changes in the data distribution of continuous features in different business scenarios, and obtain a reasonable feature vector representation of the continuous features.
[0178] The training method of the business prediction model of this embodiment uses Fourier transform to achieve self-adaptive conversion of continuous features for training data in business scenarios when training the business model, solves the problem that continuous data can be most appropriately embedded as the data distribution changes dynamically, improves the representation accuracy of continuous features, and can obtain cross-features that best match the current data distribution with other features.
[0179] The above-mentioned business prediction method and business prediction model training method are applied to the video recommendation scenario. Through business data, it can be found that the playback time, click-through rate, etc. of the recommended videos are significantly improved.
[0180] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0181] Based on the same inventive concept, the embodiment of the present application also provides a business prediction device for implementing the business prediction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more business prediction device embodiments provided below can refer to the limitations on the business prediction method above, and will not be repeated here.
[0182] In one embodiment, Figure 7 As shown, a business prediction device is provided, comprising:
[0183] The data acquisition module 702 is used to acquire target business data; the target business data includes discrete features and continuous features.
[0184] The first embedding processing module 704 is used to input the discrete feature into the first embedding layer of the business prediction model, and convert the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature.
[0185] The second embedding processing module 706 is used to input the continuous feature into the second embedding layer of the business prediction model. The second embedding layer maps the continuous feature to multiple frequency domain spaces by utilizing the fitting function of the continuous feature in each frequency domain space to obtain the feature vector of the continuous feature; wherein the parameters of the fitting function conform to the data distribution of the continuous feature and are obtained by training the business prediction model.
[0186] The feature crossover module 708 is used to perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector.
[0187] The prediction module 710 is used to input the business feature vector into the classifier of the business prediction model, and output the business prediction result through the classifier.
[0188] In one embodiment, the second embedding processing module is used for the second embedding layer to obtain the fitting function of the continuous feature in each frequency domain space based on Fourier transform, and use the fitting function of the continuous feature in each frequency domain space to map the continuous feature to multiple frequency domain spaces, and obtain the feature vector of the continuous feature according to the amplitude in each frequency domain space.
[0189] In another embodiment, a second embedding processing module is used for the second embedding layer to map the continuous feature through the Fourier frequency domain basis mapping to obtain M frequency domain basis function representations of the continuous feature; the parameters of the frequency domain basis function conform to the data distribution of the continuous feature and are obtained by training the business prediction model; the M frequency domain basis functions are linearly combined to obtain the fitting function of the continuous feature in each frequency domain space, the fitting function is low-order approximated by the Fourier series to obtain the amplitude of the continuous feature in each frequency domain space, and the feature vector of the continuous feature is obtained according to the amplitude in each frequency domain space.
[0190] Each module in the above-mentioned business prediction device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0191] In one embodiment, Figure 8 As shown, a training device for a business prediction model is provided, comprising:
[0192] The sample set acquisition module 802 is used to acquire a business sample set, where each sample of the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object.
[0193] The discrete processing module 804 is used to input the discrete features in the sample into the first embedding layer of the business prediction model to be trained, and convert the discrete features through the first embedding layer to obtain a feature vector of the discrete features.
[0194] The continuous processing module 806 is used to input the continuous feature into the second embedding layer of the business prediction model. The second embedding layer maps the continuous feature to multiple frequency domain spaces by utilizing the fitting function of the continuous feature in each frequency domain space to obtain the feature vector of the continuous feature.
[0195] The cross processing module 808 is used to perform feature cross processing on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector.
[0196] The classification module 810 is used to input the business feature vector into the classifier of the business prediction model, and output the business prediction result through the classifier.
[0197] The adjustment module 812 is used to adjust the parameters of the business model based on the loss function of the business prediction model; the loss function includes the cross entropy loss of the business prediction result and the prediction object.
[0198] The iteration control module 814 is used to control the iterative training when the training iteration stop condition is not met, so as to continue to train the business prediction model using the business sample set until the training iteration stop condition is met, thereby obtaining a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous feature.
[0199] Each module in the training device of the business prediction model can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0200] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store training data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a business prediction method or a training method for a business prediction model is implemented.
[0201] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0202] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the business prediction method or the business model training method of the above-mentioned embodiments are implemented.
[0203] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the business prediction method or the business model training method of the above-mentioned embodiments are implemented.
[0204] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the business prediction method or the business model training method of the above-mentioned embodiments.
[0205] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0206] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0207] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A business forecasting method, characterized in that: The method comprises: Acquire target business data; the target business data includes discrete features and continuous features; Inputting the discrete feature into a first embedding layer of a business prediction model, converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature; Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameter of the fitting function conforms to the data distribution of the continuous feature and is obtained by training the business prediction model; Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector; The business feature vector is input into the classifier of the business prediction model, and the business prediction result is output through the classifier.
2. The method according to claim 1, characterized in that The second embedding layer maps the continuous feature to multiple frequency domain spaces by using the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature, including: The second embedding layer obtains the fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains the feature vector of the continuous feature according to the amplitude in each frequency domain space.
3. The method according to claim 2, characterized in that The second embedding layer obtains a fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains a feature vector of the continuous feature according to the amplitude in each frequency domain space, including: The second embedding layer maps the continuous feature through a Fourier frequency domain basis to obtain M frequency domain basis function representations of the continuous feature; the parameters of the frequency domain basis function conform to the data distribution of the continuous feature and are obtained by training the business prediction model; The M frequency domain basis functions are used for linear combination to obtain the fitting function of the continuous feature in each frequency domain space, and the fitting function is approximated by a low-order Fourier series to obtain the amplitude of the continuous feature in each frequency domain space. The characteristic vector of the continuous feature is obtained according to the amplitude in each frequency domain space.
4. A training method for a business prediction model, characterized in that: The method comprises: Acquire a business sample set, each sample in the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object; Inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features; Inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; Performing feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector; Inputting the service feature vector into the classifier of the service prediction model, and outputting the service prediction result through the classifier; Based on the loss function of the business prediction model, adjusting the parameters of the business model; the loss function includes the cross entropy loss of the business prediction result and the prediction object; Iteratively return to the step of inputting the discrete features in the sample into the first embedding layer of the business prediction model to be trained, converting the discrete features through the first embedding layer to obtain the feature vector of the discrete features, and continuing to train the business prediction model using the business sample set until the training iteration stop condition is met to obtain a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous features.
5. The method according to claim 4, characterized in that The step of inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to a plurality of frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature, comprises: The second embedding layer obtains the fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains the feature vector of the continuous feature according to the amplitude in each frequency domain space.
6. The method according to claim 5, characterized in that The second embedding layer obtains a fitting function of the continuous feature in each frequency domain space based on Fourier transform, maps the continuous feature to multiple frequency domain spaces using the fitting function of the continuous feature in each frequency domain space, and obtains a feature vector of the continuous feature according to the amplitude in each frequency domain space, including: The second embedding layer maps the continuous feature through a Fourier frequency domain basis to obtain M frequency domain basis function representations of the continuous feature; the parameters of the frequency domain basis function conform to the data distribution of the continuous feature and are obtained by training the business prediction model; The M frequency domain basis functions are used for linear combination to obtain the fitting function of the continuous feature in each frequency domain space, and the fitting function is approximated by a low-order Fourier series to obtain the amplitude of the continuous feature in each frequency domain space. The characteristic vector of the continuous feature is obtained according to the amplitude in each frequency domain space.
7. The method according to claim 5, characterized in that The method further comprises: In response to the incremental training instruction, acquiring an incremental training sample set; The trained business prediction model is trained based on the incremental training sample set, and the parameters of the business prediction model are updated.
8. A business prediction device, characterized in that: The device comprises: A data acquisition module, used to acquire target business data; the target business data includes discrete features and continuous features; A first embedding processing module, used for inputting the discrete feature into a first embedding layer of a business prediction model, and converting the discrete feature through the first embedding layer to obtain a feature vector of the discrete feature; A second embedding processing module is used to input the continuous feature into a second embedding layer of the business prediction model, and the second embedding layer maps the continuous feature to multiple frequency domain spaces by using the fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; wherein the parameters of the fitting function conform to the data distribution of the continuous feature and are obtained by training the business prediction model; A feature crossover module, used to perform feature crossover on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector; The prediction module is used to input the business feature vector into the classifier of the business prediction model and output the business prediction result through the classifier.
9. A training device for a business prediction model, characterized in that: The device comprises: A sample set acquisition module, used to acquire a business sample set, each sample of the business sample set includes a discrete feature and a continuous feature; each sample includes a marked prediction object; A discrete processing module, used for inputting the discrete features in the sample into a first embedding layer of a business prediction model to be trained, and converting the discrete features through the first embedding layer to obtain a feature vector of the discrete features; A continuous processing module, used for inputting the continuous feature into a second embedding layer of a business prediction model, wherein the second embedding layer maps the continuous feature to multiple frequency domain spaces by using a fitting function of the continuous feature in each frequency domain space to obtain a feature vector of the continuous feature; A cross processing module, used for performing feature cross processing on the feature vector of the discrete feature and the feature vector of the continuous feature to obtain a service feature vector; A classification module, used for inputting the service feature vector into a classifier of the service prediction model, and outputting a service prediction result through the classifier; An adjustment module, used to adjust the parameters of the business model based on the loss function of the business prediction model; the loss function includes the cross entropy loss of the business prediction result and the prediction object; An iterative control module is used to control iterative training when the training iteration stop condition is not met, so as to continue to train the business prediction model using the business sample set until the training iteration stop condition is met, thereby obtaining a trained business prediction model; the parameters of the fitting function of the trained business prediction model conform to the data distribution of the continuous feature.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Service flow perception method and apparatus for edge computing, and electronic device
US20250267072A1