Associated variable determination method and device, equipment, storage medium and program product
By extracting features from the historical data sequence of target variables and candidate variables, predicting future data and combining historical and future data for causal mining, the problem of low accuracy of causal mining is solved, and the accuracy of determining correlation variables is improved.
Patent Information
- Application Number
- CN202310641042.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, the accuracy of causal relationship mining between variables is low, resulting in the accuracy of determining correlation variables, especially in the case of processing complex time series data and the presence of noise and outliers.
By extracting features from the historical data sequence of target variables and candidate variables, predicting future data sequences, and using historical and future data to mine causal relationships, multi-module combination methods (such as feature extraction, sequence prediction, and causal determination module) to determine the association variable.
The accuracy of causal relationship mining and the accuracy of correlation variable determination can be improved, and the accuracy of causal relationship mining can be improved more effectively.
Smart Images

Figure CN119067243A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to artificial intelligence technology, and in particular to a method, device, equipment, storage medium and program product for determining associated variables. Background Art
[0002] In business scenarios, there are various variables, and there may be certain correlations between these variables, that is, there is a phenomenon that the data change of a certain variable will cause the data of another variable to change. The process of determining the associated variables for the target variable in the business scenario can be achieved by mining the causal relationship between variables. It can be seen that the accuracy of mining the causal relationship between variables directly affects the accuracy of determining the associated variables. However, various causal relationship mining methods in related technologies all have the problem of low accuracy in mining the causal relationship between variables, which makes the accuracy of determining the associated variables low. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for determining associated variables, which can improve the accuracy of determining associated variables.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application embodiment provides a method for determining an associated variable, including:
[0006] Extracting a target sequence feature of the target variable from a first historical data sequence of the target variable, and extracting a candidate sequence feature of each of the candidate variables from respective second historical data sequences of a plurality of candidate variables;
[0007] Based on the target sequence characteristics of the target variable, predicting a first predicted data sequence of the target variable at a future time, and based on the candidate sequence characteristics of each of the candidate variables, predicting a second predicted data sequence of each of the candidate variables at the future time;
[0008] Determine causal information between the target variable and each of the candidate variables based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence;
[0009] A candidate variable whose causal information representation has a causal relationship with the target variable among the multiple candidate variables is determined as an associated variable corresponding to the target variable.
[0010] The present application embodiment provides a device for determining an associated variable, including:
[0011] A feature extraction module, used to extract a target sequence feature of the target variable from a first historical data sequence of the target variable, and to extract a candidate sequence feature of each of the candidate variables from a second historical data sequence of each of the plurality of candidate variables;
[0012] A sequence prediction module, configured to predict a first prediction data sequence of the target variable at a future time based on the target sequence feature of the target variable, and to predict a second prediction data sequence of each candidate variable at the future time based on the candidate sequence feature of each candidate variable;
[0013] a causal determination module, configured to determine causal information between the target variable and each of the candidate variables based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence;
[0014] The variable determination module is used to determine the candidate variables whose causal information representation has a causal relationship with the target variable among the multiple candidate variables as associated variables corresponding to the target variable.
[0015] In some embodiments of the present application, the feature extraction module is further used to divide the first historical data sequence of the target variable into multiple local sequence fragments; extract the local pattern features of each local sequence fragment from each local sequence fragment; and extract the target sequence features of the target variable from the multiple local pattern features corresponding to the multiple local sequence fragments.
[0016] In some embodiments of the present application, the feature extraction module is also used to determine global additional features from the first historical data sequence of the target variable; and to extract the local pattern features of each local sequence fragment from each local sequence fragment and the global additional features.
[0017] In some embodiments of the present application, the global additional features include: sequence statistical features and sequence spectral features; the feature extraction module is also used to apply a sliding window to the first historical sequence data, and determine the statistical features of the business data within the sliding window as the sequence statistical features; perform a discrete Fourier transform on the first historical sequence data to obtain the spectral information of the first historical data, and extract the sequence spectral features of the first historical sequence data from the spectral information.
[0018] In some embodiments of the present application, the causal determination module is further used to fuse the first historical data sequence and the first prediction data sequence to obtain a first fused data sequence corresponding to the target variable; fuse the second historical data sequence and the second prediction data sequence to obtain a second fused data sequence corresponding to each of the candidate variables; and determine the causal information between the target variable and each of the candidate variables based on the first fused data sequence and the second fused data sequence.
[0019] In some embodiments of the present application, the causal determination module is also used to predict the correlation between the target variable and each of the candidate variables based on the first fusion data sequence and the second fusion data sequence to obtain a correlation prediction result; the correlation prediction result is used to characterize whether there is a correlation between the target variable and each of the candidate variables; from the multiple candidate variables, the candidate variables characterized by the correlation prediction result as being correlated with the target variable are screened to obtain the candidate variables to be tested; for the remaining candidate variables of the multiple candidate variables, causal information characterizing that there is no causal relationship with the target variable is generated; wherein the remaining candidate variables refer to the candidate variables among the multiple candidate variables except the candidate variables to be tested; using the first fusion data sequence and the second fusion data sequence of the candidate variables to be tested, a causal test is performed on the target variable and the candidate variables to be tested, and the test result is determined as the causal information between the target variable and the candidate variables to be tested.
[0020] In some embodiments of the present application, the causal determination module is also used to construct a univariate autoregressive model of the target variable using the first fused data sequence; to construct a bivariate autoregressive model of the target variable and the candidate variable to be tested using the first fused data sequence and the second fused data sequence of the candidate variable to be tested; to calculate the statistic of the target distribution based on the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model; to determine the hypothesis test probability corresponding to the statistic of the target distribution based on the statistic of the target distribution and the degrees of freedom of the target distribution; to complete the test of the causal relationship between the target variable and the candidate variable to be tested by comparing the hypothesis test probability with a preset significance level, and to obtain the test result.
[0021] In some embodiments of the present application, the causal determination module is also used to generate a test result indicating the existence of a causal relationship for the target variable and the candidate variable to be tested when the hypothesis test probability is less than the preset significance level, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested; when the hypothesis test probability is greater than or equal to the preset significance level, generate a test result indicating the absence of a causal relationship for the target variable and the candidate variable to be tested, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested.
[0022] In some embodiments of the present application, the causal determination module is also used to perform difference calculation on the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model, and perform a proportional operation on the difference result and the lag order to obtain a first statistical component; perform difference calculation on the number of business data in the first fusion data sequence, the amplified lag order and the preset parameters to obtain a bivariate model factor, and determine the ratio of the residual sum of squares of the bivariate model to the bivariate model factor as a second statistical component; perform a ratio calculation on the first statistical component and the second statistical component to obtain the statistic of the target distribution.
[0023] In some embodiments of the present application, the associated variable determination device also includes: a sequence generation module, which is used to obtain the historical business data of the target variable and the historical business data of each of the candidate variables; performing data cleaning on the historical business data of the target variable to obtain the cleaned data of the target variable, and performing data cleaning on the historical business data of each of the candidate variables to obtain the cleaned data of each of the candidate variables; performing standardization processing on the cleaned data of the target variable to obtain the standardized data of the target variable, and performing standardization processing on the cleaned data of each of the candidate variables to obtain the standardized data of each of the candidate variables; arranging the standardized data of the target variable in chronological order to obtain a first historical data sequence, and arranging the standardized data of each of the candidate variables in chronological order to obtain the second historical data sequence.
[0024] In some embodiments of the present application, the associated variable determination device also includes: a data optimization module, used to optimize the business data of the associated variables to obtain the optimized business data of the associated variables; the optimized business data of the associated variables is used to cause optimization of the business data of the target variable.
[0025] An embodiment of the present application provides an electronic device, including:
[0026] A memory for storing computer executable instructions or computer programs;
[0027] The processor is used to implement the associated variable determination method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.
[0028] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for causing a processor to execute and implement the associated variable determination method provided in the embodiment of the present application.
[0029] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, can implement the associated variable determination method provided in the embodiment of the present application.
[0030] The embodiments of the present application have the following beneficial effects: the electronic device will first perform feature extraction on the first historical data sequence of the target variable and the second historical data sequence of each candidate variable, respectively, and based on the extracted target sequence features and candidate sequence features, respectively predict the first predicted data sequence and the second predicted data sequence in the future time, and then combine all the obtained data sequences to mine the causal relationship between the target variable and the candidate variables, so as to obtain the causal information between the target variable and the candidate variables. In this way, the historical data and future trends of the target variable and the historical data and future trends of the candidate variables can be combined at the same time to realize the causal relationship mining between the target variable and the candidate variables, which will make the causal relationship mining between the target variable and the candidate variables more accurate, thereby improving the accuracy of determining the associated variables. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a schematic diagram of the architecture of the associated variable determination system provided in an embodiment of the present application;
[0032] Figure 2 The embodiment of this application provides Figure 1 A schematic diagram of the structure of the server in FIG.
[0033] Figure 3 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 1 ;
[0034] Figure 4 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 2 ;
[0035] Figure 5 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 3 ;
[0036] Figure 6This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 4 ;
[0037] Figure 7 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 5 ;
[0038] Figure 8 It is a schematic diagram of the process when the server provided in the embodiment of the present application performs causal relationship mining on various variables. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0040] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0041] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0042] 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.
[0043] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0044] 1) 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.
[0045] 2) Machine Learning (ML) is a multi-disciplinary subject involving 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 in all areas of artificial intelligence.
[0046] 3) Deep Learning (DL) is a research direction in the field of machine learning that attempts to use multiple processing layers with complex structures or multiple nonlinear transformations to perform high-level abstraction of data. Deep learning is mostly based on artificial neural networks, which consist of multiple input layers, output layers, and hidden layers. Each layer contains units that can convert input data into information for the next layer to use in prediction.
[0047] 4) Convolutional Neural Network (CNN) is a type of feedforward neural network with deep structure and convolutional calculation, and is one of the representative algorithms of deep learning. CNN has the ability of representation learning and can classify input information in a translation-invariant manner according to its hierarchical structure, so it can also be called "translation-invariant artificial neural network".
[0048] 5) Long Short-Term Memory (LSTM) is a special type of recurrent neural network that can learn long-term dependencies in time series data. The key component of LSTM is the memory cell, which is controlled by the forget gate, input gate, and output gate to control the flow of information.
[0049] 6) Gated Recurrent Unit (GRU) is similar to LSTM. It controls input, memory and other information through a gating mechanism and makes predictions at the current time step. GRU consists of a reset gate and an update gate. The reset gate determines how to combine new input information with previous memory, and the update gate defines the amount of previous memory saved to the current time step.
[0050] 7) Time series data refers to data collected at different time steps, which is used to describe the changes of variable data over time.
[0051] 8) Causal relationship mining is used to determine whether there is a causal relationship between two variables, that is, to determine whether the data change of one variable will cause the data change of another variable. For example, whether the change in weather will cause the change in ice cream sales.
[0052] In business scenarios, there are various variables, and there may be certain correlations between these variables, that is, the data change of a certain variable will cause the data of another variable to change (for example, the sales volume of a product will be affected by the quality of the product, so the quality of the product can be regarded as a correlated variable of the sales volume of the product). Therefore, the process of determining the associated variables for the target variables in the business scenario can be achieved by mining the causal relationship between variables. It can be seen that the accuracy of mining the causal relationship between variables directly affects the accuracy of determining the associated variables.
[0053] In the related technologies, the following methods are usually used to realize causal relationship mining between variables: realizing causal relationship mining based on statistics, realizing causal relationship mining based on traditional machine learning models, and realizing causal relationship mining based on deep learning models. Among them, realizing causal relationship mining based on statistics means using correlation test and other methods to model the causal relationship between different variables; realizing causal relationship mining based on traditional machine learning models means modeling the causal relationship between different variables based on support vector machines, random forests, etc.; realizing causal relationship mining based on deep learning models means using a single deep learning model, such as LSTM, GRU, etc., to model the causal relationship between different variables.
[0054] However, the methods of implementing causal relationship mining between variables in related technologies all have certain defects. For example, implementing causal relationship mining based on statistics requires assuming that the data obeys a certain distribution. If the assumption does not conform to the actual situation, it will affect the accuracy of causal relationship mining; when implementing causal relationship mining based on traditional machine learning models, the traditional machine learning models have limited data processing capabilities and cannot process complex time series data, which will affect the accuracy of causal relationship mining; when implementing causal relationship mining based on deep learning models, a single deep learning model may be difficult to guarantee the processing performance of complex nonlinear data, and the processing capability of long-term dependencies is limited, which leads to the accuracy of causal relationship mining. It can be seen that various causal relationship mining methods in related technologies all have the problem of low accuracy in causal relationship mining between variables, which makes the accuracy of determining associated variables low.
[0055] Moreover, since variable data usually contain noise and outliers, this will have a certain impact on the accuracy of causal relationships, thereby affecting the accuracy of determining associated variables.
[0056] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for determining an associated variable, which can improve the accuracy of the associated variable determination. The following describes an exemplary application of an electronic device for determining an associated variable provided by an embodiment of the present application. The electronic device provided by an embodiment of the present application can be implemented as various types of terminals such as a laptop computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), and can also be implemented as a server. Below, an exemplary application when the electronic device is implemented as a server will be described.
[0057] See also Figure 1 , Figure 1 1 is a schematic diagram of the architecture of the associated variable determination system provided in the embodiment of the present application. In order to support an associated variable determination application, in the associated variable determination system 100, the terminal (terminal 400-1 and terminal 400-2 are shown as examples) is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two. A database 500 is also provided in the associated variable determination system 100, wherein the database 500 can be independent of the server 200 or integrated in the server 200. Figure 1 The illustrated case is that the database 500 is independent of the server 200 .
[0058] The terminal 400 - 1 and the terminal 400 - 2 are used to generate business data in response to the user's operation on the business interface on the graphic interface 410 - 1 and the graphic interface 410 - 2 , and send the business data to the database 500 .
[0059] The server 200 is used to extract the business data of the target variable at historical time and the business data of multiple candidate variables at historical time from the database 500; form a first historical data sequence according to the business data of the target variable at historical time, and form a second historical data sequence according to the business data of each candidate variable at historical time; extract the target sequence feature of the target variable from the first historical data sequence of the target variable, and extract the candidate sequence feature of each candidate variable from the second historical data sequence of each of the multiple candidate variables; predict the first predicted data sequence of the target variable at a future time based on the target sequence feature of the target variable, and predict the second predicted data sequence of each candidate variable at a future time based on the candidate sequence feature of each candidate variable; determine the causal information between the target variable and each candidate variable based on the first historical data sequence, the first predicted data sequence, the second historical data sequence and the second predicted data sequence; determine the candidate variable whose causal information represents a causal relationship with the target variable among the multiple candidate variables as the associated variable corresponding to the target variable.
[0060] The embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.
[0061] Cloud computing is a general term for network technology, information technology, integration technology, management platform and application technology based on the cloud computing business model. It can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The system background services of the technical network require a large amount of computing and storage resources, which need to be realized through cloud computing.
[0062] Exemplarily, server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or 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. Terminals 400-1 and 400-2 may be smart phones, tablet computers, laptops, desktop computers, smart speakers, smart watches, smart home appliances, car terminals, etc., but are not limited thereto. The terminals and servers may be directly or indirectly connected via wired or wireless communications, which is not limited in the embodiments of the present application.
[0063] See also Figure 2 , Figure 2 The embodiment of this application provides Figure 1 A schematic diagram of the structure of a server (an implementation of an electronic device) in FIG. Figure 2 The server 200 shown includes: at least one processor 210, a memory 250, at least one network interface 220 and a user interface 230. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .
[0064] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0065] The user interface 230 includes one or more output devices 231 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0066] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.
[0067] The memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.
[0068] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0069] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0070] A network communication module 252, used to reach other computing devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB);
[0071] a presentation module 253 for enabling presentation of information via one or more output devices 231 (e.g., display screen, speaker, etc.) associated with the user interface 230 (e.g., a user interface for operating peripherals and displaying content and information);
[0072] The input processing module 254 is used to detect one or more user inputs or interactions from one of the one or more input devices 232 and translate the detected inputs or interactions.
[0073] In some embodiments, the associated variable determination device provided in the embodiments of the present application can be implemented in software. Figure 2 The associated variable determination device 255 stored in the memory 250 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a feature extraction module 2551, a sequence prediction module 2552, a causal determination module 2553, a variable determination module 2554, a sequence generation module 2555 and a data optimization module 2556. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.
[0074] In other embodiments, the associated variable determination device provided in the embodiments of the present application can be implemented in hardware. As an example, the associated variable determination device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the associated variable determination method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.
[0075] In some embodiments, the terminal or server (both electronic devices may be real-time) can implement the associated variable determination method provided by the embodiment of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a business analysis APP, an e-commerce platform APP, etc.; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.
[0076] The embodiment of the present application can be applied to the associated variable determination scenario of information recommendation, resource processing, etc. Below, the associated variable determination method provided by the embodiment of the present application is described. As mentioned above, the electronic device that implements the associated variable determination method of the embodiment of the present application can be a terminal, a server, or a combination of the two. Therefore, the execution subject of each step will not be repeatedly described below.
[0077] See also Figure 3 , Figure 3 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 1 , will combine Figure 3 The steps shown are explained.
[0078] S101, extracting a target sequence feature of a target variable from a first historical data sequence of the target variable, and extracting a candidate sequence feature of each candidate variable from a second historical data sequence of each of a plurality of candidate variables.
[0079] The embodiment of the present application performs causal relationship mining on multiple business variables in a business scenario, and is implemented in a scenario where a corresponding associated variable is determined for a business variable specific to the business scenario, that is, a target variable, wherein an associated variable refers to a variable that has a causal relationship with the target variable. After the electronic device determines the target variable for which the corresponding associated variable needs to be determined, it will acquire the historical data sequence of the target variable, and use the acquired historical data sequence as the first historical data sequence. At the same time, for multiple candidate variables of the target variable, the historical data sequence is acquired respectively, and the acquired historical data sequence is used as the second historical data sequence of each candidate variable. Then, the electronic device will perform feature extraction on the first historical data sequence and the second historical data sequence respectively, so as to obtain the target sequence feature of the target variable and the candidate sequence feature of each candidate variable.
[0080] It should be noted that the target variable is a business variable specified among multiple business variables of the business scenario, and may also be the business variable with the highest degree of importance among multiple business variables. The specific content of the target variable is related to the specific business scenario. For example, when the business scenario is a commodity sales scenario, the target variable may be the number of commodities sold; when the business scenario is an object quality inspection scenario, the target variable may be the quality of the object.
[0081] Multiple candidate variables are used to provide a selection range for associated variables, and the associated variables are included in the multiple candidate variables, that is, the associated variable is one of the multiple candidate variables. The candidate variables can be the business variables remaining from the multiple business variables excluding the target variable, or they can be some business variables preliminarily screened out from the multiple business variables (the electronic device can complete the initial screening based on the logical relationship between the meanings of the business variables, or perform the initial screening randomly). The specific content of the candidate variables is also related to the specific business scenario. For example, when the business scenario is a commodity sales scenario, the candidate variables can be the quality of the commodity, the evaluation of the commodity, etc.; when the business scenario is an object quality inspection scenario, the business variables can be the manufacturing process of the object, the raw materials for the manufacture of the object, and so on.
[0082] The first historical data sequence of the target variable can be a sequence consisting of the business data of the target variable at historical time (such as the sales volume of goods, the quality index of goods, etc.), or a sequence consisting of data obtained after preprocessing the business data at historical time. Similarly, the second historical data sequence of the candidate variable can be a sequence consisting of the business data of the candidate variable at historical time (such as the number of favorable comments of goods, the number of raw materials for making goods, etc.), or a sequence consisting of data obtained after preprocessing the business data at historical time.
[0083] It should be noted that in the embodiment of the present application, the electronic device will use the same feature extraction method to extract the target sequence features from the first historical data sequence and extract the candidate sequence features from the second historical data sequence. Below, only the process of extracting the target sequence features from the first historical data sequence is used to illustrate the feature extraction method of the embodiment of the present application.
[0084] See also Figure 4 , Figure 4 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 2 In some embodiments of the present application, Figure 3 Extracting the target sequence features of the target variable from the first historical data sequence of the target variable in S101 can be achieved through S1011-S1013 as follows:
[0085] S1011. Divide the first historical data sequence of the target variable into multiple local sequence segments.
[0086] The electronic device segments the first historical data sequence to obtain a plurality of local sequence segments, each of which is a continuous segment in the first historical data sequence. It should be noted that in the embodiment of the present application, there may or may not be overlapping portions between the local sequence segments.
[0087] In some embodiments, the electronic device can segment the first historical data sequence through a time window of fixed length, that is, use the business data within the time window to form local sequence segments, and obtain multiple local sequence segments by sliding the time window. In this way, the lengths of different local sequence segments are the same.
[0088] In other embodiments, the electronic device may also randomly segment the first historical data sequence, that is, randomly determine a segmentation point in the first historical data sequence, and segment the sequence at the segmentation point to obtain multiple local sequence segments. In this way, the lengths of different local sequence segments may be different.
[0089] S1012: Extract local pattern features of each local sequence segment from each local sequence segment.
[0090] The electronic device extracts local pattern features from each local sequence segment, thereby obtaining multiple local pattern features corresponding to the multiple local sequence segments. It should be noted that the local pattern feature refers to the local structure existing in the local sequence segment, and the local structure can be trend change, periodicity, etc.
[0091] In some embodiments, the electronic device can extract features from each local sequence segment through a local feature extraction model to obtain corresponding local pattern features. The local feature extraction model can be implemented through a CNN model or a multi-layer perceptron model.
[0092] In other embodiments, the electronic device may further extract statistical features for each local sequence segment, and determine the extracted statistical features as local pattern features of each local sequence segment. The statistical features may include at least one of the number of business data contained in the local sequence segment, the mean of the business data, the variance of the business data, the standard deviation of the business data, and the median of the business data.
[0093] S1013. Extract target sequence features of the target variable from the multiple local pattern features corresponding to the multiple local sequence fragments.
[0094] After obtaining multiple local model features, the electronic device will arrange the multiple local pattern features according to the order between the multiple local sequence fragments, and then extract features from these local pattern features, and determine the extracted features as the target sequence features corresponding to the target variable.
[0095] In some embodiments, the electronic device can extract long-term dependent features from multiple local model features through a dependent feature extraction model to obtain a target sequence feature, that is, the target sequence feature can be a long-term dependent feature between multiple local model features. It should be noted that the dependent feature extraction model can be an LSTM model or a GRU model, which is not limited in the embodiments of the present application.
[0096] In other embodiments, the electronic device may also extract global features from multiple local pattern features, and determine the obtained global features as the final target sequence features. The global features may refer to the common features of multiple local pattern features, or the feature mean of multiple local pattern features.
[0097] It can be understood that the electronic device divides the first historical data sequence into multiple local sequence fragments, and extracts the final target sequence features based on the local pattern features of each local sequence fragment. It can first perform feature extraction from the local perspective of the first historical data sequence, and then perform feature extraction again from the global perspective, so that the target sequence features can simultaneously provide local information and global information of the first historical data sequence, thereby improving the amount of information that the target sequence features can provide.
[0098] In order to further enhance the global information of the first historical data sequence, that is, to avoid the loss of global information caused by segmenting the first historical data sequence. Figure 4 After S1011 and before S1013, that is, after dividing the first historical data sequence of the target variable into multiple local sequence fragments, and before extracting the target sequence features of the target variable from multiple local pattern features corresponding to the multiple local sequence fragments, the method may also include the following processing (which can be regarded as an alternative to S1012): extracting global additional features from the first historical data sequence of the target variable; extracting local pattern features of each local sequence fragment from each local sequence fragment and the global additional features.
[0099] That is to say, in addition to directly extracting the corresponding local pattern features from each local sequence segment, the electronic device can also first extract global additional features from the first historical data sequence of the target variable, and combine the extracted global additional features into the extraction process of the local pattern features, that is, the electronic device uses the local sequence segments and the global additional features as the feature extraction objects corresponding to each local sequence segment at the same time to perform feature extraction, and determines the extracted features as the local pattern features of each local sequence segment. In this way, the local pattern features of each local sequence segment will also contain the global information of the first historical data sequence, so that the global information will not be lost during the feature extraction process.
[0100] It should be noted that the above-mentioned global additional features may include at least one of the sequence statistical features and sequence spectral features of the first historical data sequence. The sequence statistical features refer to the statistical features of the first historical data sequence, such as the mean, median, standard deviation, etc. of the first historical data sequence or each fragment in the first historical data sequence (the fragment may be the same as or different from the local sequence fragment); the sequence spectral features refer to the features of the first historical data sequence in the frequency domain, which are used to provide the periodicity information and frequency components of the first historical data sequence.
[0101] In some embodiments of the present application, the global additional features include: sequence statistical features and sequence frequency features. In this case, determining the global additional features from the first historical data sequence of the target variable can be achieved by the following processing: applying a sliding window to the first historical sequence data, and determining the statistical features of the business data within the sliding window as sequence statistical features; performing a discrete Fourier transform on the first historical sequence data to obtain the spectrum information of the first historical data, and extracting the sequence spectrum features of the first historical sequence data from the spectrum information.
[0102] It should be noted that the size and step size of the sliding window can be set according to actual conditions. For example, if the size of the sliding window is set to 5, the sliding window can select 5 business data in the first historical data sequence at a time; if the step size of the sliding window is set to 2, the sliding window will slide in units of 2 business data.
[0103] The statistical characteristics of the business data within the sliding window may be at least one of the mean, median, standard deviation, maximum value, and minimum value of the business data within the sliding window. The spectrum information of the first historical sequence data may include the amplitude and phase of different frequency components. The electronic device may preset the amplitude and phase of the frequency components (such as the first and second frequency components) as sequence spectrum characteristics, which is not limited in the embodiments of the present application.
[0104] S102. Based on the target sequence characteristics of the target variable, predict a first predicted data sequence of the target variable at a future time, and based on the candidate sequence characteristics of each candidate variable, predict a second predicted data sequence of each candidate variable at a future time.
[0105] After obtaining the target sequence characteristics of the target variable and the candidate sequence characteristics of each candidate variable, the electronic device will predict the business data sequence of the target variable in the future based on the target sequence characteristics, and use the predicted data sequence as the first predicted data sequence. Similarly, the electronic device will predict the business data sequence of each candidate variable in the future based on the candidate sequence characteristics, and use the predicted data sequence as the second predicted data sequence. It can be understood that the first predicted data sequence reflects the changes in the business data of the target variable in the future, and the second predicted data sequence reflects the changes in the business data of the candidate variable in the future.
[0106] It should be noted that in the embodiment of the present application, the electronic device will use the same sequence prediction method to process the target sequence features and the candidate sequence features to obtain the first predicted data sequence and the second predicted data sequence. Below, only the prediction process of the first predicted data sequence is taken as an example to illustrate the prediction process of the first predicted data sequence and the second predicted data sequence in the embodiment of the present application.
[0107] In other embodiments of the present application, Figure 3 In S102, based on the target sequence characteristics of the target variable, the first predicted data sequence of the target variable in the future is predicted, which can be achieved by the following processing: reading the target sequence characteristics through the sequence prediction model, and determining the output sequence of the sequence prediction model as the first predicted data sequence.
[0108] Among them, the sequence prediction model can be implemented through a network layer such as a fully connected layer, or through a decoder for decoding target sequence features, such as a decoder in a Transformer.
[0109] In other embodiments of the present application, Figure 3 In S102, based on the target sequence characteristics of the target variable, the first predicted data sequence of the target variable in the future is predicted, which can also be achieved by the following processing: matching the target sequence characteristics with multiple preset characteristics corresponding to multiple preset data sequences, and determining the preset data sequence corresponding to the preset characteristics that match the target sequence characteristics (for example, the similarity is greater than a similarity threshold) as the first predicted data sequence.
[0110] S103. Determine causal information between the target variable and each candidate variable based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence.
[0111] After obtaining the first prediction data sequence and the second prediction data sequence, the electronic device will simultaneously combine the first historical data sequence, the first prediction data sequence, the second historical data sequence, and the second prediction data sequence to mine the causal relationship between the target variable and each candidate variable, thereby obtaining the causal information between the target variable and each candidate variable. In other words, the causal information characterizes whether there is a causal relationship between the target variable and each candidate variable. Among them, the causal relationship can be that the candidate variable is the "cause" and the target variable is the "result", that is, the change in the business data of the candidate variable will cause the business data of the target variable to change accordingly; the causal relationship can also be that the target variable is the "cause" and the candidate variable is the "result", that is, the change in the business data of the target variable will cause the business data of the candidate variable to change accordingly.
[0112] It should be noted that the first historical data sequence provides the changes in the business data of the target variable in historical time, the first predicted data sequence provides the change trend of the business data of the target variable in the future, the second historical data sequence provides the change trend of the business data of the candidate variable in historical time, and the second predicted data sequence provides the change trend of the business data of the candidate variable in the future. Since there are two business variables with a causal relationship, if the business variable as the "cause" changes, the business variable as the "effect" will often change accordingly only after a certain period of time, that is, there is a certain lag. Therefore, in order to highlight whether there is a causal relationship between the target variable and the candidate variable, in addition to considering the changes in the business data of the target variable and the candidate variable in historical time, it is necessary to combine the change trend of the business data of the target variable and the candidate variable in the future, so that the potential causal relationship between the target variable and the candidate variable can be highlighted, thereby improving the accuracy of causal relationship mining.
[0113] See also Figure 5 , Figure 5 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 3 In some embodiments of the present application, Figure 3 S103 in the above, i.e., determining the causal information between the target variable and each candidate variable based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence, can be implemented through S1031-S1033 as follows:
[0114] S1031. Fuse the first historical data sequence and the first predicted data sequence to obtain a first fused data sequence corresponding to the target variable.
[0115] The electronic device may fuse the first historical data sequence and the first predicted data sequence by splicing, or may fuse the first historical data sequence and the first predicted data sequence by weighted summation, and the obtained fusion result is the first fused data sequence.
[0116] S1032. Fuse the second historical data sequence and the second predicted data sequence to obtain a second fused data sequence corresponding to each candidate variable.
[0117] The electronic device may fuse the second historical data sequence and the second predicted data sequence in a manner similar to S1011 to obtain a second fused data sequence, which will not be described in detail herein.
[0118] S1033. Based on the first fused data sequence and the second fused data sequence, perform causal relationship mining on the target variable and each candidate variable to obtain causal information between the target variable and each candidate variable.
[0119] After obtaining the first fused data sequence and the second fused data sequence, the electronic device will simultaneously combine the first fused data sequence and the second fused data sequence to determine whether there is a causal relationship between the target variable and each candidate variable, thereby obtaining causal information between the target variable and each candidate variable. In this way, the electronic device can obtain multiple causal information, and the multiple causal information corresponds to the multiple candidate variables one by one.
[0120] See also Figure 6 , Figure 6 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 4 In some embodiments of the present application, Figure 5 S1033, i.e., determining the causal information between the target variable and each candidate variable based on the first fused data sequence and the second fused data sequence, can be implemented through S1033a-S1033d as follows:
[0121] S1033a. Based on the first fused data sequence and the second fused data sequence, predict the correlation between the target variable and each candidate variable to obtain a correlation prediction result.
[0122] The electronic device can complete the correlation prediction between the target variable and each candidate variable by calculating the Pearson correlation coefficient of the first fused data sequence and the second fused data sequence, or calculating the Spearman rank correlation technology method, and the obtained correlation prediction result is used to characterize whether there is a correlation between the target variable and each candidate variable. In this way, the electronic device can obtain multiple correlation prediction results corresponding to multiple candidate variables one by one.
[0123] S1033b. From multiple candidate variables, select candidate variables whose correlation prediction results represent the correlation with the target variable to obtain candidate variables to be tested.
[0124] The electronic device reads each correlation result and screens out candidate variables that have correlation with the target variable according to the correlation result. These variables need to be further tested for causal relationship with the target variable in the future, so as to determine these candidate variables as candidate variables to be tested.
[0125] It is understandable that by screening candidate variables to be tested through correlation prediction results, the number of candidate variables that need to be subsequently tested for causal relationships with the target variable can be reduced (causal relationship tests are computationally time-consuming), which can help improve the efficiency of generating causal information.
[0126] S1033c. For the remaining candidate variables among the plurality of candidate variables, generate causal information indicating that there is no causal relationship between the candidate variables and the target variable.
[0127] It should be noted that the remaining candidate variables refer to the candidate variables other than the candidate variables to be tested among the multiple candidate variables. These remaining candidate variables are not correlated with the target variable, and when two variables are not correlated, the two variables will inevitably not have a causal relationship (a causal relationship must be related). Therefore, the electronic device will directly generate causal information representing the absence of a causal relationship between the candidate variables other than the candidate variables to be tested among the multiple candidate variables, that is, the remaining candidate variables, and the target variable. In this way, the electronic device can complete the determination of causal information for some of the multiple candidate variables, that is, the remaining candidate variables except the candidate variables to be tested.
[0128] S1033d. Perform a causal test on the target variable and the candidate variable to be tested by using the first fused data sequence and the second fused data sequence of the candidate variable to be tested, and determine the test result as the causal information between the target variable and the candidate variable to be tested.
[0129] The electronic device uses the first fused data sequence and the second fused data sequence to test whether there is indeed a causal relationship between the target variable and the candidate variable to be tested, so that the obtained test result also represents whether there is a causal relationship between the target variable and the candidate variable to be tested. Therefore, the electronic device can directly determine the test result as the causal information between the target variable and the candidate variable to be tested. In this way, after S1013c and S1013d, the electronic device obtains multiple causal information corresponding to multiple candidate variables.
[0130] In some embodiments, Figure 6 S1013d in the method, i.e., using the first fused data sequence of the target variable and the second fused data sequence of the business variable to be tested to perform a causal test on the target variable and the candidate variable to be tested, can be achieved by the following processing: using the first fused data sequence to construct a univariate autoregression model of the target variable; using the first fused data sequence and the second fused data sequence of the candidate variable to be tested to construct a bivariate autoregression model of the target variable and the candidate variable to be tested; calculating the statistic of the target distribution based on the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model; determining the hypothesis test probability corresponding to the statistic of the target distribution based on the statistic of the target distribution and the degrees of freedom of the target distribution; completing the test of the causal relationship between the target variable and the candidate variable to be tested by comparing the hypothesis test probability with the preset significance level, and obtaining the test result.
[0131] Among them, the univariate autoregression model of the target variable can use the business data of the target variable in the historical time to predict the business data of the target variable in the future time, so that the univariate autoregression model is used to compare the business data of the target variable itself in the historical time to the business data of the target variable in the future time. The bivariate autoregression model of the target variable and the candidate variable to be tested can simultaneously use the business data of the target variable in the historical time and the business data of the candidate variable to be tested in the historical time to predict the business data of the target variable in the future time, so that the bivariate autoregression model is used to compare the predictive ability of the candidate variable to be tested to the business data of the target variable in the future time. By comparing the predictive ability of the univariate autoregression model and the bivariate autoregression model, it is possible to evaluate whether the candidate variable to be tested causally affects the target variable, and it is also possible to determine whether there is a causal relationship between the candidate variable to be tested and the target variable. Therefore, in the embodiment of the present application, the electronic device needs to construct a univariate autoregression model and a bivariate autoregression model respectively.
[0132] After obtaining the univariate autoregressive model and the bivariate autoregressive model, the electronic device will calculate the residual sum of squares of the univariate regression model and the bivariate regression model respectively, and calculate the statistics of the target distribution based on the two residual sums of squares calculated, and then combine the degrees of freedom of the target distribution itself to generate a hypothesis test probability corresponding to the statistics of the target distribution. Finally, the electronic device can determine whether there is a causal relationship between the target variable and the candidate variable to be tested by comparing the size between the hypothesis test probability and the significance level, thereby completing the test of the causal relationship.
[0133] In more detail, by comparing the hypothesis test probability with the preset significance level, the test of the causal relationship between the target variable and the candidate variable to be tested is completed, and the test result is obtained, which can be obtained by the following processing: when the hypothesis test probability is less than the preset significance level, a test result representing the existence of a causal relationship is generated for the target variable and the candidate variable to be tested, and the test of the causal relationship between the target variable and the candidate variable to be tested is completed; when the hypothesis test probability is greater than or equal to the preset significance level, a test result representing the absence of a causal relationship is generated for the target variable and the candidate variable to be tested, and the test of the causal relationship between the target variable and the candidate variable to be tested is completed.
[0134] It should be noted that the target distribution in the embodiment of the present application can be an F distribution or a T distribution, and the embodiment of the present application is not limited here. The degree of freedom of the target distribution is an inherent attribute of the target distribution. For example, the F distribution has two degrees of freedom, which are the degrees of freedom of the chi-square distribution obeyed by the target variable and the degrees of freedom of the chi-square distribution obeyed by the candidate variable to be tested. After the statistics and degrees of freedom of the target distribution are determined, the electronic device can determine the corresponding hypothesis test probability for the statistics of the target distribution by looking up the mapping relationship table between the test probability, statistics and degrees of freedom. Among them, the hypothesis test probability can be regarded as the minimum significance level that does not accept the null hypothesis (that is, the target variable and the candidate variable to be tested have no causal relationship), and the preset significance level can be set in advance, for example, set to 0.05, etc.
[0135] It should also be noted that the residual sum of squares of the univariate autoregressive model can be obtained by first estimating (using the least squares method) the parameters (such as the intercept term and the lag coefficient) in the univariate autoregressive model, and then using the estimated parameters to estimate the service data in the first fused data sequence, and calculating the sum of squares of the residuals between the estimated values and the actual values of the service data. Similarly, the residual sum of squares of the bivariate autoregressive model can also be obtained in a similar manner, which is not limited here.
[0136] In some embodiments, the statistics of the target distribution are calculated based on the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model, which can be achieved by the following processing: performing difference calculation on the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model, and performing a proportional operation on the difference result and the lag order to obtain a first statistical component; performing difference calculation on the number of business data in the first fusion data sequence, the amplified lag order and the preset parameters to obtain a bivariate model factor, and determining the ratio of the residual sum of squares of the bivariate model to the bivariate model factor as the second statistical component; performing a ratio calculation on the first statistical component and the second statistical component to obtain the statistics of the target distribution.
[0137] Among them, the lag order is used to characterize the time difference between the target variable and the candidate variable to be tested, that is, how long does the change of the candidate variable to be tested lag the target variable to change accordingly. The lag order can be obtained by observing the change trends of the first fused data sequence and the second fused data sequence. Afterwards, it can be magnified by 2 times or 3 times to obtain the amplified lag order.
[0138] The number of service data in the first fused data sequence is the number of service data included in the first fused data sequence, and the number is the same as the number of service data in the second fused data sequence.
[0139] It should be noted that the preset parameter can be set to 1 or 2, and the embodiment of the present application does not limit this.
[0140] Illustratively, the present application embodiment provides a calculation formula for the statistic of target distribution, see formula (1):
[0141]
[0142] Among them, RSS1 is the residual sum of squares of the univariate autoregression model, RSS2 is the residual sum of squares of the bivariate autoregression model, p is the lag order, T is the number of business data in the first fused data sequence, 1 is the preset parameter, and F is the statistic of the target distribution.
[0143] In some embodiments, the statistics of the target distribution are calculated based on the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model. This can also be achieved by the following processing: proportionally calculating the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model to obtain the statistics of the target distribution.
[0144] That is, the electronic device can also directly compare the two residual sums of squares (where the residual sum of squares of the univariate autoregression model can be used as the numerator, or the residual sum of squares of the bivariate autoregression model can be used as the numerator), and the obtained ratio is the statistic of the target distribution.
[0145] In other embodiments of the present application, Figure 5 In S1013, based on the first fused data sequence and the second fused data sequence, causal relationship mining is performed on the target variable and each candidate variable to obtain the causal information between the target variable and each candidate variable. This can also be achieved by the following processing: using the first fused data sequence and the second fused data sequence of each candidate variable, a bivariate autoregression model of the target variable and each candidate variable is constructed; when the lag coefficient corresponding to each candidate variable in the bivariate autoregression model is not equal to 0, the causal information between the target variable and each candidate variable is determined as the causal information between the target variable and each candidate variable.
[0146] That is to say, if the lag coefficient of the candidate variable is significantly different from 0 in the bivariate autoregression model, it can be inferred that there is a causal relationship between the candidate variable and the target variable (the lag coefficient can be obtained by estimating the parameters in the bivariate autoregression model).
[0147] In other embodiments of the present application, Figure 3In S103, the causal information between the target variable and each candidate variable is determined based on the first historical data sequence, the first predicted data sequence, the second historical data sequence and the second predicted data sequence. This can also be achieved by the following processing: determining the data change trend of the target variable from the first historical data sequence and the first predicted data sequence; determining the data change trend of each candidate variable from the second historical data sequence and the second predicted data sequence; when the data change trend of the target variable is consistent with the data change trend of the candidate variable, it will characterize the existence of a causal relationship between the target variable and each candidate variable, which is determined as the causal information between the target variable and each candidate variable.
[0148] The data change trend of the target variable is consistent with the data change trend of the candidate variable, which means that when one of the target variable and the candidate variable undergoes a certain change (such as a decrease or fluctuation), the other variable will also undergo the same change immediately or after a period of time. In this way, the electronic device can also determine the corresponding causal information for the target variable and the candidate variable.
[0149] S104: Determine the candidate variables whose causal information represents a causal relationship with the target variable among the multiple candidate variables as associated variables corresponding to the target variable.
[0150] After obtaining the causal information between the target variable and each candidate variable, the electronic device will clarify which candidate variables have a causal relationship with the target variable, that is, which candidate variables' business data changes will cause changes in the target variable's business data, or which candidate variables' business data changes will cause changes in the target variable's business data. The electronic device reads the causal information of each candidate variable, and screens the candidate variables whose causal information indicates a causal relationship with the target variable. The screened candidate variables are the final associated variables.
[0151] Of course, the number of candidate variables that represent a causal relationship with the target variable, that is, the number of associated variables corresponding to the target variable may be more than one. In this case, the electronic device can continue to mine the optimal associated variable for at least one associated variable through reinforcement learning (that is, when the business data of different associated variables can change, the change in the business data of the target variable caused by the change can be used to determine the corresponding reward signal, and an optimal associated variable can be screened out through the reward signal), so as to obtain an optimal associated variable with the closest causal relationship with the target variable.
[0152] It is understandable that various causal relationship mining methods in the related art all have the problem of low accuracy in causal relationship mining between variables, which leads to low accuracy in determining associated variables. In the embodiment of the present application, the electronic device will first perform feature extraction on the first historical data sequence of the target variable and the second historical data sequence of each candidate variable, respectively, and based on the extracted target sequence features and candidate sequence features, respectively predict the first predicted data sequence and the second predicted data sequence in the future time, and then combine all the obtained data sequences to mine the causal relationship between the target variable and the candidate variables, so as to obtain the causal information between the target variable and the candidate variables. In this way, the historical data and future trends of the target variable, as well as the historical data and future trends of the candidate variables, can be combined at the same time to realize the causal relationship mining between the target variable and the candidate variables, which will make the causal relationship mining of the target variable and the candidate variables more accurate, thereby improving the accuracy of determining associated variables.
[0153] based on Figure 3 , see Figure 7 , Figure 7 This is a schematic diagram of the process of determining the associated variable provided in the embodiment of the present application. Figure 5 In some embodiments of the present application, Figure 3 Before S101 in the above, that is, before extracting the target sequence feature of the target variable from the first historical data sequence of the target variable and extracting the candidate sequence feature of each candidate variable from the second historical data sequence of each of the multiple candidate variables, the method may further include the following processing:
[0154] S105: Obtain historical business data of the target variable and historical business data of each candidate variable.
[0155] The electronic device may obtain the historical business data of the target variable and each candidate variable from the business database, or may obtain the historical business data of the target variable and each candidate variable by sending a data request to a server of the business scenario.
[0156] S106 , performing data cleaning on the historical business data of the target variable to obtain cleaned data of the target variable, and performing data cleaning on the historical business data of each candidate variable to obtain cleaned data of each candidate variable.
[0157] After obtaining the historical business data of the target variable and each candidate variable, the electronic device will perform data cleaning on these historical business data to identify and correct outliers, fill missing values, and remove redundancy in these historical business data.
[0158] Among them, the electronic device can determine the required variables by analyzing the business scenario, and eliminate the data of irrelevant variables, or calculate the similarity of different variables, and merge the data of two variables whose similarity reaches a threshold to achieve redundancy removal. The electronic device can use quantiles and box plots to identify outliers in historical business data and correct these outliers, for example, these outliers can be replaced by the mean of normal values. The electronic device can also determine a matching filling method for these missing values for the historical business data based on the characteristics of the historical business data, and use the matching filling method to fill the missing values in the historical business data.
[0159] Exemplarily, when the characteristics of historical business data are uniform and continuous distribution, or normal distribution, the electronic device may use mean filling as the matching filling method for missing values; when the characteristics of historical business data are uneven and continuous distribution, or skewed distribution, the electronic device may use median filling as the matching filling method; when the characteristics of historical business data are unevenly distributed categories, the electronic device may use mode filling as the matching filling method; when the characteristics of historical business data are ordered numerical values, the electronic device may use interpolation filling as the matching filling method, and so on.
[0160] S107 , performing standardization processing on the cleaned data of the target variable to obtain the standardized data of the target variable, and performing standardization processing on the cleaned data of each candidate variable to obtain the standardized data of each candidate variable.
[0161] After obtaining the cleaned data of the target variable and each candidate variable, the electronic device will convert the cleaned data into a distribution with a mean of 0 and a standard deviation of 1 through standardization (which can be achieved through Z-score standardization, minimum and maximum standardization, etc.), and the obtained data is the standardized data.
[0162] S108. Arrange the standardized data of the target variable in chronological order to obtain a first historical data sequence, and arrange the standardized data of each candidate variable in chronological order to obtain a second historical data sequence.
[0163] Finally, the electronic device will arrange the standardized data of the target variable in the order of their historical time, and use the sequence obtained after the arrangement as the first historical data sequence. Similarly, the electronic device will obtain the second historical data sequence in the same way. In this way, the electronic device can subsequently determine the corresponding associated variables for the target variable based on the first historical data sequence and the second historical data sequence.
[0164] It can be understood that compared with the related art, since the data of the variables usually contain noise and outliers, which will affect the accuracy of determining the associated variables, in the embodiments of the present application, the electronic device will clean, standardize, and perform other processing on the data of the variables to eliminate the noise and outliers in the data, thereby helping to improve the accuracy of determining the associated variables.
[0165] In some embodiments of the present application, Figure 3 After S104, that is, after determining the candidate variables whose causal information represents a causal relationship with the target variable among multiple candidate variables as associated variables corresponding to the target variable, the method may further include the following processing: optimizing the business data of the associated variables to obtain the optimized business data of the associated variables.
[0166] It should be noted that the optimized business data of the associated variables is used to cause the optimization of the business data of the target variables. That is, the electronic device optimizes the business data of the associated variables to optimize the business data of the target variables. For example, the quality of the goods is improved to achieve the purpose of increasing the sales volume of the goods, or the raw materials for manufacturing objects are optimized to achieve the purpose of improving the quality of the objects. In this way, the electronic device can use the associated variables to optimize the business data for the target variables that are difficult to optimize directly.
[0167] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.
[0168] The embodiment of the present application is to mine the causal relationship of various variables on the e-commerce platform, so as to find variables (called associated variables) related to the sales volume of goods (called target variables), so as to increase the sales volume of goods by optimizing the business strategy of the variables.
[0169] Figure 8 This is a schematic diagram of the process of the server (referred to as an electronic device) provided in the embodiment of the present application performing causal relationship mining on various variables. The process may include the following steps:
[0170] S201. Collect historical data for different variables, pre-process the collected historical data, and use the pre-processed data to form historical time series data.
[0171] For example, historical data of commodities are collected, such as data on sales volume (called target variable), price, promotional activities, inventory, commodity evaluation and other characteristics (collectively referred to as multiple candidate variables), and then the collected data is cleaned, standardized and other processes are performed to form historical time series data with different characteristics (the time series data of sales volume is called the first historical data series, and the time series data of other characteristics is called the second historical time series).
[0172] Among them, data cleaning can include the following processing: deleting irrelevant or redundant features, filling or deleting missing values; processing outliers, such as by quantiles; merging features with similar meanings.
[0173] Standardizing data means converting the data of these variables into a unified metric to facilitate the processing of subsequent deep learning models. Common standardization methods include: minimum and maximum standardization, which scales the data of the variables to the interval [0,1]; Z-score standardization, which converts the values of the variables into a standard normal distribution; and robust standardization, which uses quantiles instead of mean and standard deviation for scaling.
[0174] In addition, in order to train the subsequent deep learning model, the obtained time series data needs to be divided into training set, validation set and test set. Common division methods include: holdout method, that is, randomly selecting some time series data as the test set and the remaining time series data as the training set; K-fold cross-validation method, that is, dividing all time series data into K subsets of equal size, using one subset as the test set each time, and the other subsets as the training set; stratified sampling method: that is, ensuring that the proportion of each category in the training set and the test set is consistent with the original data set.
[0175] S202: Extract sliding window statistical features and Fourier transform features of time series data.
[0176] The server can extract sliding window statistical features (called sequence statistical features) of time series data through the sliding window method, that is, sliding a fixed-size window on the time series data and calculating the statistics of the data in the window. Common statistics include mean, median, standard deviation, maximum, minimum, etc. Sliding window statistical features can capture local patterns and changing trends of time series data.
[0177] Assume that the time series data is X = x1, x2, ..., x n , the sliding window size is w, and the actual position of the sliding window is t, then the sliding window statistical characteristics can be expressed as follows:
[0178] Mean: μ(t) = (1 / w)*∑(x i), where, i=t, t+1,..., t+w-1;
[0179] Median: data located in the middle of the sliding window;
[0180] Standard Deviation: Among them, i=t, t+1,..., t+w-1;
[0181] Maximum value: max(t)=max(x i ), where, i=t, t+1,..., t+w-1;
[0182] Minimum value: min(t)=min(x i ), where i=t, t+1,..., t+w-1.
[0183] The server uses discrete Fourier transform to extract features from time series data, which can capture the periodic characteristics and frequency components of time series data.
[0184] Assume that the time series data is X = {x1, x2, ..., x n}, then the discrete Fourier transform can be expressed as formula (2):
[0185] X(k)=∑x t *e -2πi *(t-1)*(k-1) / n) (2)
[0186] Among them, t=1, 2, ..., n; k=1, 2, ..., n.
[0187] Through discrete Fourier transform, the spectrum of time series data can be obtained. The amplitude and phase information in the spectrum can be used as the Fourier transform features of time series data (called Fourier features). In order to reduce the computational complexity, the server can only retain the first few main components in the spectrum as features.
[0188] By combining the extracted sliding window features and Fourier transform features with subsequent time series data, it is possible to capture the characteristics of time series data from different aspects, namely global and local methods, thereby providing richer information for subsequent causal relationship mining.
[0189] S203: construct a deep learning model, and train and optimize the constructed deep learning model.
[0190] In the embodiment of the present application, any one of the following three deep learning models can be used as a deep learning model for subsequent feature extraction. The three deep learning models can be: a hybrid LSTM and CNN model, a bidirectional GRU model, and a multi-layer perceptron.
[0191] In the hybrid LSTM and CNN model, CNN is used to capture local time series patterns (called local pattern features), where local time series patterns refer to local patterns or local structures in time series data. Time series data usually contains various patterns and structures, such as trends, seasonality, cyclicality, and other short-term or long-term local patterns. LSTM is used to capture long-term dependencies, and finally, the fully connected layer is used to integrate features and output the final prediction results, that is, the time series data of different features in the future.
[0192] It should be noted that LSTM is a special recurrent neural network that can learn long-term dependencies in time series data. The key component of LSTM is the memory cell, which is controlled by the forget gate, input gate, and output gate to control the flow of information. The calculation formula of LSTM is as follows:
[0193] Forget gate: f t =σ(W f *[h(t-1),x t ]+b f );
[0194] Input gate: i t =σ(W i *[h(t-1),x t ]+b i );
[0195] Output gate: o t =σ(W o *[h(t-1),x t ]+b o );
[0196] Memory cell renewal: c t =f t ⊙c(t-1)+i t ⊙tanh(W c *[h(t-1),x t ]+b c );
[0197] Final output: h t =o t ⊙tanh(c t ).
[0198] Among them, σ represents the Sigmoid activation function, ⊙ represents the element-by-element multiplication, W and b represent the weight matrix and bias respectively, t represents the time step, and x t Represents the input at the tth time step.
[0199] CNN is a deep learning model with local connection and weight sharing characteristics, which can efficiently extract local features. The key components of CNN are convolutional layer and pooling layer. Among them, the convolutional layer extracts local features through convolution operation, while the pooling layer is used to reduce the spatial dimension of the data. The calculation formula of the convolution operation is as follows:
[0200]
[0201] in, represents the activation function, such as ReLU, tanh and other functions, W and b represent the weight matrix and bias of the convolution kernel, p is the size of the convolution kernel, and X(t-p+1:t) represents the local segment of the input data in the time window t-p+1 to t (called the local sequence segment).
[0202] In an embodiment of the present application, the sliding window features and Fourier transform features extracted in S202 will be input into CNN together with the local segments of the time series data for feature extraction. The output of CNN will be passed to the input layer of LSTM, and the output of LSTM will be passed to the fully connected layer to output the final prediction result.
[0203] The bidirectional GRU model uses the gated recurrent unit (GRU) to establish recurrent neural networks on the forward and reverse time axes to capture the bidirectional dependencies of time series data. The calculation formula of GRU can be as follows:
[0204] Update gate: z t =σ(W z *[h(t-1),x t ]+b z )
[0205] Reset gate: r t =σ(W r *[h(t-1),x t ]+b r )
[0206] Hide candidate status:
[0207] Output:
[0208] Among them, σ represents the Sigmoid activation function, ⊙ represents the element-by-element multiplication, W and b represent the weight matrix and bias respectively, t represents the time step, and x t Represents the input at the tth time step.
[0209] In the bidirectional GRU model, time series data, sliding window features, and Fourier transform features are input into the forward GRU layer and the reverse GRU layer to capture the forward and reverse dependencies, respectively. Then the outputs of the two GRU layers are merged and passed to the fully connected layer and the output layer. The final prediction result, i.e., the future time series data, is output through the fully connected layer.
[0210] The multilayer perceptron is a feedforward neural network that consists of an input layer, one or more hidden layers, and an output layer. Each layer is fully connected. Activation functions such as ReLU, Sigmoid, or Tanh are used to introduce nonlinearity. Of course, the multilayer perceptron can also be combined with other deep learning models to improve the generalization ability of the model.
[0211] The multi-layer perceptron consists of multiple fully connected layers, and each neuron is connected to all neurons in the previous layer. The server reads time series data, sliding window features, and Fourier transform features through the multi-layer perceptron, and extracts features through multiple fully connected layers. Finally, the extracted features are passed to the output layer for result prediction, that is, predicting future time series data. The calculation formula of the fully connected layer is as follows:
[0212]
[0213] in, represents the activation function, W and b represent the weight matrix and bias, X represents the input of each fully connected layer, and Y represents the output of each fully connected layer.
[0214] After the server builds a deep learning model for predicting future time series data, it will train and optimize the deep learning model. The training and optimization process of the deep learning model includes the following three steps:
[0215] The first step is to evaluate the performance of the deep learning model through cross-validation, such as using K-fold cross-validation, so as to prevent overfitting of the deep learning model during training and improve the generalization ability of the deep learning model;
[0216] The second step is to measure the difference between the predicted value and the true value of the deep learning model through the loss function. Common loss functions include mean square error, cross entropy loss, etc.
[0217] The third step is to update the weights of deep learning through the optimizer to reduce the value of the loss function. Common optimizers include gradient descent, random extraction descent, Adam, RMSprop, etc. Choosing a suitable optimizer and learning rate strategy can accelerate model convergence and improve training efficiency.
[0218] S204. Predict the future time series data of different variables from the sliding window statistical features, Fourier transform features and time series data through the trained and optimized deep learning model.
[0219] After completing deep learning training and optimization, the server will read the sliding window statistical features, Fourier transform features, and time series data through the deep learning model, and use this information to predict the future time series data of different variables (the time series data of sales volume is called the first prediction data series, and the time series data of other features is called the second prediction time series).
[0220] S205. Combine historical time series data with future time series data to explore the causal relationship between different variables.
[0221] The server uses the historical time series data and future time series data of different variables to mine and analyze the causal relationship of different variables. The mining and analysis of causal relationships can include the following three steps:
[0222] Step 1: Correlation analysis. Correlation analysis is used to measure the degree of linear association between two variables. Through correlation analysis, variable pairs that may have a causal relationship (i.e., the target variable and the candidate variable to be tested) can be preliminarily screened.
[0223] The second step is Granger causality test. The idea of this process is that if the historical value of a variable is helpful for the prediction of another variable, then the former can be regarded as the Granger cause of the latter. Granger causality test uses a linear autoregression model to perform the test. The F statistic (called the statistic of the target distribution) and the corresponding P value (called the hypothesis test probability) are calculated based on the residual of the autoregression model. Based on the size between the P value and the significance level, it can be determined whether a variable has a significant Granger causal relationship with another variable. The following is the detailed process of the Granger causality test:
[0224] For the features of two sequence data of interest, namely, the sequence data of variable X with potential causal relationship (i.e., the second fused sequence data of the candidate variable to be tested) and the sequence data of variable Y (i.e., the first fused sequence data of the target variable), two autoregressive models are established, namely, a univariate model (called a univariate autoregressive model) and a bivariate model (called a bivariate autoregressive model). The univariate model is represented by Y t =α1+∑(β i *Y(ti))+ε t (i=1, 2, ..., p), the bivariate model is represented by Y t =α2+∑(γ i*Y(ti))+∑(δ i *X(ti))+ζ t (i=1,2,...,p). Among them, α1 and α2 are intercept terms, β i and γ i is the hysteresis coefficient of Y, δ i is the lag coefficient of X, ε t and t is the error term, and p is the lag order.
[0225] It can be seen that the univariate model is an autoregressive model established for Y, which uses the Y value at the historical moment to predict the Y value at the future moment. This model is used to compare the predictive ability of Y's own historical information on the future value of Y; the bivariate model is an autoregressive model established for two variables X and Y, which uses the X value and Y value at the historical moment to predict the Y value at the current moment. This model is used to compare the predictive ability of X's historical information on the future value of Y.
[0226] By comparing the prediction performance of the univariate model and the bivariate model, we can evaluate whether the X variable causally affects the Y variable. If the prediction performance of the bivariate model is significantly better than that of the univariate model, that is, the addition of the X variable provides additional information or explanatory power for the prediction of Y, then it is inferred that X has a Granger causal relationship with Y.
[0227] The server can determine whether X and Y have a causal relationship through the lag coefficients in the univariate model and the bivariate model. For example, the server compares the lag coefficient of X in the bivariate model with the lag coefficient of Y in the univariate model to evaluate the causal relationship between X and Y. If the lag coefficient of X is significantly different from 0 in the bivariate model, the server determines that X has a Granger causal relationship with Y.
[0228] The server can also estimate the parameters in the univariate model and the bivariate model by the least squares method, and calculate the residual sum of squares, and then calculate the F statistic based on the two residual sums of squares. Among them, the residual sum of squares of the univariate model is RSS1=∑(ε t ) 2 , the residual sum of squares of the bivariate model is RSS2 = ∑(ζ t ) 2 , the F statistic can be calculated using formula (1). The server calculates the corresponding P value based on the degrees of freedom of the F distribution (called the target distribution) and the statistic of the F distribution, and compares the P value with the significance level (such as 0.05). If the P value is less than the significance level, it is determined that there is a causal relationship between X and Y. Otherwise, it is determined that there is no causal relationship between X and Y.
[0229] Step 3: Reinforcement learning. The server can use reinforcement learning to continue searching for the optimal causal structure. The process may include the following steps:
[0230] 1. Define the state space, that is, regard each variable as a state and construct a state space;
[0231] 2. Define the action space, treat each decision as an action, and construct an action space, where each action represents whether there is a causal edge connecting two variables;
[0232] 3. Define the reward function. According to the task requirements, define the reward function to evaluate the quality of the causal structure. The reward function can be based on causal evaluation indicators, such as the size of the causal effect, the accuracy of the causal relationship, etc.
[0233] 4. Define strategy: Choose an appropriate algorithm to select actions based on the current state;
[0234] 5. Reinforcement learning training, that is, selecting actions based on the current state, observing the reward signal from the environment, and updating the strategy function based on the reward signal to gradually learn the optimal causal structure;
[0235] 6. Result evaluation, that is, after reinforcement learning is completed, evaluate the learned causal structure and performance, and make further adjustments and optimizations as needed.
[0236] In an embodiment of the present application, after completing the mining of causal relationships, the server can also dynamically adjust and optimize the deep learning model to continue to improve the performance of the deep learning model in practical applications.
[0237] The server can dynamically adjust and optimize the deep learning model through any of the following methods: online learning, transfer learning, and adaptive adjustment. Among them, online learning is a method of continuously updating the deep learning model as new data arrives, so that the deep learning model can adapt to the dynamic changes of data; transfer learning is to apply the knowledge of one business scenario to another business scenario, that is, the causal relationship knowledge can be transferred from one business to another to reduce the training time of the deep learning model and improve the prediction accuracy; adaptive adjustment is a method of dynamically adjusting the parameters of the deep learning model according to the dynamic performance of the deep learning model, so that the deep learning model can achieve better performance in different business scenarios and data sets.
[0238] It is understandable that in the embodiments of the present application, user information, such as user evaluations and other related data, is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0239] The following is a description of an exemplary structure of the associated variable determination device 255 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the associated variable determination device 255 of the memory 250 may include:
[0240] A feature extraction module 2551 is used to extract a target sequence feature of the target variable from a first historical data sequence of the target variable, and to extract a candidate sequence feature of each of the candidate variables from a second historical data sequence of each of the plurality of candidate variables;
[0241] A sequence prediction module 2552 is used to predict a first predicted data sequence of the target variable at a future time based on the target sequence characteristics of the target variable, and to predict a second predicted data sequence of each candidate variable at the future time based on the candidate sequence characteristics of each candidate variable;
[0242] A causal determination module 2553, configured to determine causal information between the target variable and each of the candidate variables based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence;
[0243] The variable determination module 2554 is used to determine the candidate variables whose causal information representation has a causal relationship with the target variable among the multiple candidate variables as associated variables corresponding to the target variable.
[0244] In some embodiments of the present application, the feature extraction module 2551 is further used to divide the first historical data sequence of the target variable into multiple local sequence fragments; extract the local pattern features of each local sequence fragment from each local sequence fragment; and extract the target sequence features of the target variable from the multiple local pattern features corresponding to the multiple local sequence fragments.
[0245] In some embodiments of the present application, the feature extraction module 2551 is also used to determine global additional features from the first historical data sequence of the target variable; and to extract the local pattern features of each local sequence fragment from each local sequence fragment and the global additional features.
[0246] In some embodiments of the present application, the global additional features include: sequence statistical features and sequence spectral features; the feature extraction module 2551 is also used to apply a sliding window to the first historical sequence data, and determine the statistical features of the business data within the sliding window as the sequence statistical features; perform a discrete Fourier transform on the first historical sequence data to obtain the spectral information of the first historical data, and extract the sequence spectral features of the first historical sequence data from the spectral information.
[0247] In some embodiments of the present application, the causal determination module 2553 is also used to fuse the first historical data sequence and the first prediction data sequence to obtain a first fused data sequence corresponding to the target variable; fuse the second historical data sequence and the second prediction data sequence to obtain a second fused data sequence corresponding to each of the candidate variables; and determine the causal information between the target variable and each of the candidate variables based on the first fused data sequence and the second fused data sequence.
[0248] In some embodiments of the present application, the causal determination module 2553 is also used to predict the correlation between the target variable and each of the candidate variables based on the first fused data sequence and the second fused data sequence to obtain a correlation prediction result; the correlation prediction result is used to characterize whether there is a correlation between the target variable and each of the candidate variables; from the multiple candidate variables, the candidate variables characterized by the correlation prediction results as being correlated with the target variable are screened to obtain the candidate variables to be tested; for the remaining candidate variables among the multiple candidate variables, causal information characterizing that there is no causal relationship with the target variable is generated; wherein the remaining candidate variables refer to the candidate variables among the multiple candidate variables except the candidate variables to be tested; using the first fused data sequence and the second fused data sequence of the candidate variables to be tested, a causal test is performed on the target variable and the candidate variables to be tested, and the test result is determined as the causal information between the target variable and the candidate variables to be tested.
[0249] In some embodiments of the present application, the causal determination module 2553 is also used to construct a univariate autoregression model of the target variable using the first fused data sequence; to construct a bivariate autoregression model of the target variable and the candidate variable to be tested using the first fused data sequence and the second fused data sequence of the candidate variable to be tested; to calculate the statistic of the target distribution based on the residual sum of squares of the univariate autoregression model and the residual sum of squares of the bivariate autoregression model; to determine the hypothesis test probability corresponding to the statistic of the target distribution based on the statistic of the target distribution and the degrees of freedom of the target distribution; and to complete the test of the causal relationship between the target variable and the candidate variable to be tested by comparing the hypothesis test probability with a preset significance level to obtain the test result.
[0250] In some embodiments of the present application, the causal determination module 2553 is also used to generate a test result indicating the existence of a causal relationship for the target variable and the candidate variable to be tested when the hypothesis test probability is less than the preset significance level, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested; when the hypothesis test probability is greater than or equal to the preset significance level, generate a test result indicating the absence of a causal relationship for the target variable and the candidate variable to be tested, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested.
[0251] In some embodiments of the present application, the causal determination module 2553 is also used to perform difference calculation on the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model, and perform a proportional operation on the difference result and the lag order to obtain a first statistical component; perform difference calculation on the number of business data in the first fusion data sequence, the amplified lag order and the preset parameters to obtain a bivariate model factor, and determine the ratio of the residual sum of squares of the bivariate model to the bivariate model factor as a second statistical component; perform a ratio calculation on the first statistical component and the second statistical component to obtain the statistic of the target distribution.
[0252] In some embodiments of the present application, the associated variable determination device 255 also includes: a sequence generation module 2555, which is used to obtain the historical business data of the target variable and the historical business data of each of the candidate variables; performing data cleaning on the historical business data of the target variable to obtain the cleaned data of the target variable, and performing data cleaning on the historical business data of each of the candidate variables to obtain the cleaned data of each of the candidate variables; performing standardization processing on the cleaned data of the target variable to obtain the standardized data of the target variable, and performing standardization processing on the cleaned data of each of the candidate variables to obtain the standardized data of each of the candidate variables; arranging the standardized data of the target variable in chronological order to obtain a first historical data sequence, and arranging the standardized data of each of the candidate variables in chronological order to obtain the second historical data sequence.
[0253] In some embodiments of the present application, the associated variable determination device 255 also includes: a data optimization module 2556, which is used to optimize the business data of the associated variables to obtain the optimized business data of the associated variables; the optimized business data of the associated variables is used to cause the optimization of the business data of the target variable.
[0254] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the above-mentioned method for determining the associated variable in the embodiment of the present application.
[0255] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will be caused to execute the associated variable determination method provided in the embodiment of the present application, for example, Figure 3 The method for determining associated variables is shown.
[0256] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0257] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0258] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0259] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0260] In summary, through the embodiment of the present application, the electronic device first extracts features from the first historical data sequence of the target variable and the second historical data sequence of each candidate variable, respectively, and predicts the first predicted data sequence and the second predicted data sequence in the future based on the extracted target sequence features and candidate sequence features, and then combines all the obtained data sequences to mine the causal relationship between the target variable and the candidate variables, thereby obtaining the causal information between the target variable and the candidate variables. In this way, the historical data and future trends of the target variable and the historical data and future trends of the candidate variables can be combined at the same time to realize the causal relationship mining between the target variable and the candidate variables, which will make the causal relationship mining between the target variable and the candidate variables more accurate, thereby improving the accuracy of the determination of the associated variables. .
[0261] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for determining associated variables, It is characterized in that The method comprises: Extracting a target sequence feature of the target variable from a first historical data sequence of the target variable, and extracting a candidate sequence feature of each of the candidate variables from respective second historical data sequences of a plurality of candidate variables; Based on the target sequence characteristics of the target variable, predicting a first predicted data sequence of the target variable at a future time, and based on the candidate sequence characteristics of each of the candidate variables, predicting a second predicted data sequence of each of the candidate variables at the future time; Determine causal information between the target variable and each of the candidate variables based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence; A candidate variable whose causal information representation has a causal relationship with the target variable among the multiple candidate variables is determined as an associated variable corresponding to the target variable.
2. The method according to claim 1, It is characterized in that The step of extracting a target sequence feature of the target variable from a first historical data sequence of the target variable comprises: Dividing the first historical data sequence of the target variable into a plurality of local sequence segments; Extracting local pattern features of each local sequence segment from each local sequence segment; The target sequence feature of the target variable is extracted from the multiple local pattern features corresponding to the multiple local sequence fragments.
3. The method according to claim 2, It is characterized in that After dividing the first historical data sequence of the target variable into a plurality of local sequence segments and before extracting the target sequence feature of the target variable from a plurality of local pattern features corresponding to the plurality of local sequence segments, the method further includes: determining global additional features from the first historical data sequence of the target variable; The local pattern feature of each local sequence segment is extracted from each local sequence segment and the global additional feature.
4. The method according to claim 3, It is characterized in that The global additional features include: sequence statistical features and sequence spectrum features; the determining of the global additional features from the first historical data sequence of the target variable includes: Applying a sliding window to the first historical sequence data, and determining the statistical features of the business data within the sliding window as the sequence statistical features; A discrete Fourier transform is performed on the first historical sequence data to obtain frequency spectrum information of the first historical data, and the sequence frequency spectrum feature of the first historical sequence data is extracted from the frequency spectrum information.
5. The method according to any one of claims 1 to 4, It is characterized in that The determining, based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence, causal information between the target variable and each of the candidate variables comprises: Fusing the first historical data sequence and the first predicted data sequence to obtain a first fused data sequence corresponding to the target variable; Fusing the second historical data sequence and the second predicted data sequence to obtain a second fused data sequence corresponding to each of the candidate variables; Based on the first fused data sequence and the second fused data sequence, causal information between the target variable and each of the candidate variables is determined.
6. The method according to claim 5, It is characterized in that The determining, based on the first fused data sequence and the second fused data sequence, causal information between the target variable and each of the candidate variables comprises: Based on the first fused data sequence and the second fused data sequence, predict the correlation between the target variable and each of the candidate variables to obtain a correlation prediction result; the correlation prediction result is used to characterize whether there is a correlation between the target variable and each of the candidate variables; From the plurality of candidate variables, the candidate variables whose correlation prediction results represent a correlation with the target variable are screened to obtain candidate variables to be tested; For the remaining candidate variables among the plurality of candidate variables, generating causal information indicating that there is no causal relationship with the target variable; wherein the remaining candidate variables refer to the candidate variables among the plurality of candidate variables except the candidate variable to be tested; A causal test is performed on the target variable and the candidate variable to be tested using the first fused data sequence and the second fused data sequence of the candidate variable to be tested, and the test result is determined as the causal information between the target variable and the candidate variable to be tested.
7. The method according to claim 6, It is characterized in that The using the first fused data sequence and the second fused data sequence of the candidate variable to be tested to perform a causal test on the target variable and the candidate variable to be tested includes: Using the first fused data sequence, constructing a univariate autoregressive model of the target variable; Using the first fused data sequence and the second fused data sequence of the candidate variable to be tested, constructing a bivariate autoregressive model of the target variable and the candidate variable to be tested; Calculating a statistic of a target distribution based on the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model; Determining a hypothesis test probability corresponding to the statistic of the target distribution according to the statistic of the target distribution and the degrees of freedom of the target distribution; By comparing the hypothesis test probability with the preset significance level, the test of the causal relationship between the target variable and the candidate variable to be tested is completed to obtain the test result.
8. The method according to claim 7, It is characterized in that The test of the causal relationship between the target variable and the candidate variable to be tested is completed by comparing the hypothesis test probability with the preset significance level to obtain the test result, including: When the hypothesis test probability is less than the preset significance level, a test result indicating the existence of a causal relationship is generated for the target variable and the candidate variable to be tested, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested; When the hypothesis test probability is greater than or equal to the preset significance level, a test result indicating that there is no causal relationship is generated for the target variable and the candidate variable to be tested, thereby completing the test of the causal relationship between the target variable and the candidate variable to be tested.
9. The method according to claim 7, It is characterized in that The calculating the statistic of the target distribution based on the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model includes: Calculate the difference between the residual sum of squares of the univariate autoregressive model and the residual sum of squares of the bivariate autoregressive model, and perform a proportional operation on the difference result and the lag order to obtain a first statistical component; Performing difference calculation on the number of business data in the first fused data sequence, the amplified lag order and the preset parameters to obtain a bivariate model factor, and determining the ratio of the residual sum of squares of the bivariate model to the bivariate model factor as the second statistical component; A ratio calculation is performed on the first statistical component and the second statistical component to obtain a statistic of the target distribution.
10. The method according to any one of claims 1 to 4, It is characterized in that Before extracting the target sequence feature of the target variable from the first historical data sequence of the target variable and extracting the candidate sequence feature of each candidate variable from the second historical data sequence of each of the plurality of candidate variables, the method further comprises: Acquire historical business data of the target variable and historical business data of each of the candidate variables; Performing data cleaning on the historical business data of the target variable to obtain cleaned data of the target variable, and performing data cleaning on the historical business data of each of the candidate variables to obtain cleaned data of each of the candidate variables; Performing standardization processing on the cleaned data of the target variable to obtain the standardized data of the target variable, and performing standardization processing on the cleaned data of each of the candidate variables to obtain the standardized data of each of the candidate variables; The standardized data of the target variable is arranged in chronological order to obtain a first historical data sequence, and the standardized data of each candidate variable is arranged in chronological order to obtain the second historical data sequence.
11. The method according to any one of claims 1 to 4, It is characterized in that After determining the candidate variables whose causal information representations have a causal relationship with the target variable among the plurality of candidate variables as associated variables corresponding to the target variable, the method further includes: The business data of the associated variables are optimized to obtain the optimized business data of the associated variables; the optimized business data of the associated variables are used to cause the optimization of the business data of the target variable.
12. A device for determining an associated variable, It is characterized in that The device comprises: A feature extraction module, used to extract a target sequence feature of the target variable from a first historical data sequence of the target variable, and to extract a candidate sequence feature of each of the candidate variables from a second historical data sequence of each of the plurality of candidate variables; A sequence prediction module, configured to predict a first prediction data sequence of the target variable at a future time based on the target sequence feature of the target variable, and to predict a second prediction data sequence of each candidate variable at the future time based on the candidate sequence feature of each candidate variable; a causal determination module, configured to determine causal information between the target variable and each of the candidate variables based on the first historical data sequence, the first predicted data sequence, the second historical data sequence, and the second predicted data sequence; The variable determination module is used to determine the candidate variables whose causal information representation has a causal relationship with the target variable among the multiple candidate variables as associated variables corresponding to the target variable.
13. An electronic device, It is characterized in that The electronic device comprises: A memory for storing computer executable instructions or computer programs; A processor, configured to implement the method for determining associated variables according to any one of claims 1 to 11 when executing the computer executable instructions or computer programs stored in the memory.
14. A computer-readable storage medium storing computer-executable instructions or a computer program, It is characterized in that When the computer executable instructions or computer program are executed by a processor, the associated variable determination method according to any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program or computer executable instructions, It is characterized in that When the computer program or computer executable instructions are executed by a processor, the associated variable determination method according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Energy storage equipment life prediction method and system, electronic equipment and storage medium
CN120372574A
Energy storage device life prediction method and system, electronic device, and storage medium
CN120372574B
Atmospheric pollution gridding prediction method and system based on meteorological parameter optimization
CN120387379A
Data anomaly detection method and electronic equipment
CN121479595A
