User tag generation method and system based on cross-platform behavior data analysis
Patent Information
- Application Number
- CN202611189978.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-27
AI Technical Summary
面对多平台背景下行为数据日益复杂且缺失频发的现实状况,既有方法在行为关联建模与标签稳定性保障两个维度上均暴露出明显的技术局限,亟需引入更为精细的数据处理机制以提升用户标签生成的整体质量
[0061]本发明利用行为-标签因果图及因果强度值计算,消除跨平台用户行为数据中混杂因素干扰,获得行为与标签间稳定因果关联,标签生成依据从表象相关性提升为因果一致性,准确度显著提高。对数据缺失用户实施反事实推断,生成反事实标签分布并与观测标签分布比较,以KL散度量化缺失行为对标签稳定性的扰动,使缺失影响被精确度量,为补全提供可靠依据。当KL散度超过稳定性阈值时,融合因果强度值与行为缺失概率计算缺失行为节点优先级,避免仅依据缺失比例或相关性排序的片面性,使补全目标序列优先覆盖对标签生成影响大且易缺失的行为环节,提升补全资源利用效率。提取以补全目标为终点的因果路径,构建因果路径贡献矩阵,显式表达缺失行为与已观测行为间的多级传递关联,还原各路径对缺失行为特征值的作用权重,结合已观测行为特征值恢复缺失行为特征,使补全结果兼顾全局因果结构和局部观测数据,补全后数据在统计分布与因果依赖关系上更接近真实完整数据。基于补全后用户行为数据生成用户标签,避免数据缺失导致的标签偏差,标签在跨平台场景下的覆盖完整性和一致性增强,对行为稀疏用户的标签生成质量改善尤为明显。上述机制使标签生成结果具备可解释性,因果强度值、KL散度、优先级排序和贡献矩阵均可追溯,标签生成过程的可靠性与可信度得到实质性提升。
Smart Images

Figure CN122986283A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cross-platform behavioral data analysis technology, and in particular to a method and system for generating user tags based on cross-platform behavioral data analysis. Background Technology
[0002] As the boundaries of internet services continue to expand, user behavioral data is often scattered across multiple business platforms. For example, e-commerce platforms record purchasing preferences, content platforms record browsing habits, and social platforms record interaction relationships. Due to significant differences in data collection methods, storage structures, and business objectives across platforms, behavioral data from a single platform can only reflect one aspect of a user's characteristics, making it difficult to form a complete characterization of user attributes, interests, and intentions. To generate multi-dimensional user tags, existing technologies typically perform simple concatenation or normalization of behavioral data from various platforms before inputting it into a unified tag generation model to construct a comprehensive user profile.
[0003] Current practices in behavioral data fusion generally ignore the inherent correlations and mutual influence mechanisms between behaviors, instead treating cross-platform behaviors as independent statistical features. The direct consequence of this approach is that when behavioral data is missing on one platform, the system cannot reasonably estimate the missing information by leveraging the interrelationships between behaviors on other platforms. The completion operation often degenerates into statistical filling based on the global mean or similar user behavior patterns. Such statistical approximations can only maintain superficial consistency in the numerical distribution of data; they cannot reconstruct the true behavioral logic of users. This makes it easy for the completed behavioral data to introduce noise information that contradicts the actual behavioral paths when used in tag generation.
[0004] Another common shortcoming lies in the stability control of the tag generation process. Existing methods typically complete the missing behavioral data in one go and directly use the completed data for tag calculation, lacking a quantitative assessment of whether the completion operation affects the credibility of the final tag. When the missing behavior involves critical decision-making nodes, different completion strategies may produce vastly different tag results, and existing technologies cannot identify the specific location where this instability occurs, nor can they adjust the priority and execution order of completion accordingly. As a result, the generated user tags may fluctuate significantly between different time windows or different data versions, weakening the reliability of the tag system in real-world business scenarios such as precision marketing, personalized recommendations, and user segmentation management. Faced with the reality of increasingly complex and frequently missing behavioral data in a multi-platform context, existing methods have exposed significant technical limitations in both behavioral association modeling and tag stability assurance, urgently requiring the introduction of more refined data processing mechanisms to improve the overall quality of user tag generation. Summary of the Invention
[0005] This invention provides a method and system for generating user tags based on cross-platform behavioral data analysis, which can solve the problems in the prior art.
[0006] A first aspect of this invention provides a method for generating user tags based on cross-platform behavioral data analysis, comprising:
[0007] Acquire user behavior data from multiple business platforms;
[0008] A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength value of the causal edges is calculated by intervening in the behavior nodes and observing the changes in the distribution of label nodes.
[0009] For users with missing behavioral data, a counterfactual label distribution is generated based on the causal strength value, an observation label distribution is generated based on the existing behavioral data, and the KL divergence between the observation label distribution and the counterfactual label distribution is calculated.
[0010] When the KL divergence exceeds the preset stability threshold, the priority of the missing behavior node is calculated by jointly calculating the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior, and the target sequence for missing behavior completion is determined.
[0011] Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix;
[0012] Based on the causal path contribution matrix and the behavioral feature values of the observed behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data.
[0013] A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength values of the causal edges are calculated by observing changes in the distribution of label nodes after intervention in behavior nodes.
[0014] Extract behavior types from user behavior data, instantiate each behavior type as a behavior node, extract tag types from a predefined tag set, and instantiate each tag type as a tag node;
[0015] For each behavior node, an intervention dataset and an observation dataset are constructed. The intervention dataset is generated by forcibly removing the behavior records of the corresponding behavior node from the user behavior data, and the observation dataset is generated by retaining the behavior records of the corresponding behavior node.
[0016] The intervention label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the intervention dataset, and the observation label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the observation dataset.
[0017] Calculate the KL divergence between the intervention label distribution and the observation label distribution, and use the KL divergence as the causal strength value of the causal edge from the corresponding behavior node to the label node;
[0018] When the causal strength value exceeds the causal association threshold, a causal edge is established in the behavior-label causal graph, pointing from the corresponding behavior node to the label node, and the causal strength value is assigned as the weight of the causal edge.
[0019] For users with missing behavioral data, a counterfactual label distribution is generated based on causal strength values, and an observed label distribution is generated based on existing behavioral data. The KL divergence between the observed label distribution and the counterfactual label distribution is calculated, including:
[0020] Identify users with missing behavioral data and retrieve the missing behavioral nodes from the user's behavioral data;
[0021] Extract the causal strength value of the causal edge connected to the missing behavior node in the behavior-label causal graph, and extract the observed behavior node connected by the causal edge and its behavior feature value in the user's existing behavior data;
[0022] Counterfactual inference is performed based on causal strength values. The behavioral feature values of observed behavioral nodes are weighted and summed with the causal strength values of the corresponding causal edges to obtain the simulated behavioral feature values of missing behavioral nodes. The simulated behavioral feature values are then filled into the missing positions to construct a hypothesis-complete dataset.
[0023] A counterfactual label distribution is generated based on the behavioral feature values of all behavioral nodes in the hypothesis completion dataset; an observation label distribution is generated based on the behavioral feature values of observed behavioral nodes in the existing user behavior data.
[0024] Extract the probability values of each label node in the observed label distribution and the counterfactual label distribution. For each label node, calculate the log ratio of the observed probability value to the counterfactual probability value. Sum the products of the observed probability value and the log ratio to calculate the KL divergence between the observed label distribution and the counterfactual label distribution.
[0025] When the KL divergence exceeds a preset stability threshold, the priority of the missing behavior node is calculated by jointly using the causal strength value of the causal edge corresponding to the missing behavior node and the probability of behavior missing, and the target sequence for missing behavior completion is determined to include:
[0026] When the KL divergence exceeds the preset stability threshold, extract all missing behavior nodes from the user behavior data.
[0027] For each missing behavior node, backtrack in the behavior-label causal graph to identify the observed behavior nodes that reach the missing behavior node, extract the causal transmission path from the observed behavior node to the missing behavior node, and evaluate the causal recoverability of the missing behavior node based on the causal strength value of the causal edge on the causal transmission path.
[0028] For each missing behavior node, identify the label nodes connected to the missing behavior node, extract the probability values of the label nodes in the observed label distribution and the counterfactual label distribution, and assess the degree of local influence of the missing behavior node on the label distribution based on the difference in probability values.
[0029] Count the number of missing samples for each missing behavior node in the user behavior data, and determine the probability of missing behavior based on the number of missing samples and the total number of users.
[0030] The priority value of each missing behavior node is determined based on causal recoverability, degree of local influence and probability of behavior missing. The missing behavior completion target sequence is generated by sorting according to the priority value. The missing behavior nodes are extracted from the missing behavior completion target sequence as missing behavior completion targets.
[0031] Assessing the causal recoverability of missing behavior nodes based on the causal strength values of causal edges along the causal transmission path includes:
[0032] For each missing behavior node, extract all observed behavior nodes pointing to the missing behavior node from the behavior-label causal graph as predecessor behavior nodes;
[0033] For each causal propagation path from the predecessor behavior node to the missing behavior node, the causal strength value of the continuous causal edges on the causal propagation path is extracted, and the path propagation strength of the causal propagation path is obtained by multiplying the causal strength values of the continuous causal edges.
[0034] In user behavior data, samples with both preceding behavior node observations and missing behavior node observations are retrieved as validation samples. The observed behavior feature vectors of the preceding behavior nodes and the true behavior feature vectors of the missing behavior nodes are extracted from the validation samples.
[0035] The observed behavior feature vector of the predecessor behavior node is weighted and mapped with the path transmission strength to generate the inferred behavior feature vector of the missing behavior node. The vector similarity between the inferred behavior feature vector and the real behavior feature vector is calculated as the transmission accuracy of the causal transmission path.
[0036] The causal transmission path with the highest transmission accuracy is selected as the optimal recovery path. The path transmission strength and transmission accuracy of the optimal recovery path are extracted. The causal recoverability of the missing behavior node is determined based on the weighted combination of path transmission strength and transmission accuracy.
[0037] Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix including:
[0038] Extract each missing behavior completion target sequentially from the missing behavior completion target sequence as the current completion target node;
[0039] For the current completion target node, all observed behavior nodes that can reach the current completion target node are identified in the behavior-label causal graph as predecessor observation nodes. The causal edge path between each predecessor observation node and the current completion target node is extracted, and all causal edge paths are used to form the predecessor causal edge path set of the current completion target node.
[0040] For each causal edge path in the set of predecessor causal edge paths, extract the causal strength value of the continuous causal edges on the causal edge path, and multiply the causal strength values of the continuous causal edges to obtain the path causal contribution value of the causal edge path.
[0041] For all missing behavior completion target nodes in the missing behavior completion target sequence, the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node are organized into a matrix to generate a causal path contribution matrix, where the row index is the missing behavior completion target node, the column index is the causal edge path, and the matrix element is the path causal contribution value.
[0042] Based on the causal path contribution matrix and the observed behavioral feature values of behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data, including:
[0043] Extract the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node from the causal path contribution matrix;
[0044] For each causal edge path, the behavioral feature values of each observed behavioral node on the causal edge path are extracted. A feature transmission chain is constructed according to the transmission order of the causal edge. Based on the causal strength value between adjacent nodes in the feature transmission chain, the behavioral feature values are transmitted layer by layer to obtain candidate recovery feature values.
[0045] For all causal edge paths of the target node for completing the current missing behavior, calculate the contribution ratio of the causal contribution value of each path to the total, and obtain the recovery behavior feature value by weighted summing of each candidate recovery feature value and its corresponding contribution ratio.
[0046] Fill the missing behavior feature values of each missing behavior completion target node into the corresponding missing positions in the user behavior data to generate the completed user behavior data;
[0047] Extract the causal precursor behavior nodes pointing to each label node from the behavior-label causal graph, and extract the causal strength value from the causal precursor behavior node to the label node as the behavior-label causal weight.
[0048] The behavioral feature values of each causal precursor behavior node are extracted from the completed user behavior data. The user label is obtained by multiplying the behavioral feature values with the behavior-label causal weights and then summing them.
[0049] A second aspect of this invention provides a user tag generation system based on cross-platform behavioral data analysis, comprising:
[0050] The data acquisition unit is used to acquire user behavior data from multiple business platforms;
[0051] The causal graph building unit is used to build a behavior-label causal graph containing behavior nodes, label nodes, and causal edges from user behavior data. It calculates the causal strength value of the causal edges by intervening in the behavior nodes and observing the changes in the distribution of label nodes.
[0052] The counterfactual unit is used to generate a counterfactual label distribution based on the causal strength value for users with missing behavioral data, generate an observation label distribution based on the existing behavioral data, and calculate the KL divergence between the observation label distribution and the counterfactual label distribution.
[0053] The target unit for completion is used to determine the target sequence for completing missing behaviors by jointly calculating the priority of missing behavior nodes based on the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior when the KL divergence exceeds the preset stability threshold.
[0054] The path contribution unit is used to extract causal edge paths that end with each missing behavior completion target in the missing behavior completion target sequence and construct a causal path contribution matrix.
[0055] The tag completion unit is used to recover the behavior feature values of each missing behavior completion target based on the causal path contribution matrix and the behavior feature values of the observed behavior nodes on the causal edge path, fill them into the user behavior data to obtain the completed user behavior data, and generate user tags based on the completed user behavior data.
[0056] A third aspect of the present invention provides an electronic device, comprising:
[0057] processor;
[0058] Memory used to store processor-executable instructions;
[0059] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0061] This invention utilizes behavior-label causal graphs and causal strength value calculations to eliminate confounding factors in cross-platform user behavior data, obtaining stable causal relationships between behaviors and labels. Label generation is shifted from superficial correlation to causal consistency, significantly improving accuracy. Counterfactual inference is performed on users with missing data, generating a counterfactual label distribution and comparing it with the observed label distribution. KL divergence is used to quantify the perturbation of missing behaviors on label stability, ensuring precise measurement of the impact of missing data and providing a reliable basis for completion. When the KL divergence exceeds a stability threshold, the priority of missing behavior nodes is calculated by fusing causal strength values and behavior missing probability. This avoids the bias of ranking solely based on missing proportions or correlation, ensuring that the completion target sequence prioritizes behaviors that significantly impact label generation and are prone to missing data, improving the efficiency of completion resource utilization. This method extracts causal paths ending at the completion target, constructs a causal path contribution matrix, explicitly expresses the multi-level transmission relationship between missing behaviors and observed behaviors, restores the weight of each path on the feature values of the missing behavior, and recovers the features of the missing behavior by combining the observed behavior feature values. This ensures that the completion result takes into account both the global causal structure and local observation data, making the completed data closer to the true complete data in terms of statistical distribution and causal dependencies. User tags are generated based on the completed user behavior data, avoiding tag bias caused by missing data. The coverage completeness and consistency of tags are enhanced in cross-platform scenarios, with a particularly significant improvement in the tag generation quality for users with sparse behavior. The above mechanism makes the tag generation results interpretable; causal strength values, KL divergence, priority ranking, and contribution matrix are all traceable, substantially improving the reliability and credibility of the tag generation process. Attached Figure Description
[0062] Figure 1 This is a flowchart illustrating a method for generating user tags based on cross-platform behavioral data analysis.
[0063] Figure 2 This is a schematic diagram comparing the observed and counterfactual label distributions of this invention;
[0064] Figure 3 Heatmap of the path contribution matrix of this invention;
[0065] Figure 4 Flowchart for user missing behavior completion and tag prediction operations. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0067] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0068] Figure 1 This is a flowchart illustrating the user tag generation method based on cross-platform behavioral data analysis according to an embodiment of the present invention.
[0069] Methods for generating user tags based on cross-platform behavioral data analysis include:
[0070] Acquire user behavior data from multiple business platforms;
[0071] A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength value of the causal edges is calculated by intervening in the behavior nodes and observing the changes in the distribution of label nodes.
[0072] For users with missing behavioral data, a counterfactual label distribution is generated based on the causal strength value, an observation label distribution is generated based on the existing behavioral data, and the KL divergence between the observation label distribution and the counterfactual label distribution is calculated.
[0073] When the KL divergence exceeds the preset stability threshold, the priority of the missing behavior node is calculated by jointly calculating the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior, and the target sequence for missing behavior completion is determined.
[0074] Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix;
[0075] Based on the causal path contribution matrix and the behavioral feature values of the observed behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data.
[0076] A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength values of the causal edges are calculated by observing changes in the distribution of label nodes after intervention in behavior nodes.
[0077] Extract behavior types from user behavior data, instantiate each behavior type as a behavior node, extract tag types from a predefined tag set, and instantiate each tag type as a tag node;
[0078] For each behavior node, an intervention dataset and an observation dataset are constructed. The intervention dataset is generated by forcibly removing the behavior records of the corresponding behavior node from the user behavior data, and the observation dataset is generated by retaining the behavior records of the corresponding behavior node.
[0079] The intervention label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the intervention dataset, and the observation label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the observation dataset.
[0080] Calculate the KL divergence between the intervention label distribution and the observation label distribution, and use the KL divergence as the causal strength value of the causal edge from the corresponding behavior node to the label node;
[0081] When the causal strength value exceeds the causal association threshold, a causal edge is established in the behavior-label causal graph, pointing from the corresponding behavior node to the label node, and the causal strength value is assigned as the weight of the causal edge.
[0082] When extracting behavior types from user behavior data, it is necessary to uniformly parse the raw logs from multiple business platforms and map the behavior events from different platforms to a unified behavior type system. For example, "product browsing," "adding to cart," and "placing an order" on e-commerce platforms, and "video playback," "article collection," and "comment posting" on content platforms are all abstracted into independent behavior types. Each behavior type is instantiated as a behavior node in a behavior-tag causal graph. The node attributes contain the statistical characteristics of the behavior type, such as behavior frequency, behavior duration, and behavior time distribution. Simultaneously, tag types are extracted from a predefined tag set. This tag set is typically predefined by the business side and covers user profile dimensions, such as "price-sensitive users," "heavy content consumers," and "highly active users." Each tag type is instantiated as a tag node, and the node attributes contain prior information about the tag's distribution among all users. After node instantiation, the node set in the behavior-tag causal graph consists of all behavior nodes and tag nodes. The directed causal edges between nodes are subsequently determined through causal strength calculation.
[0083] For each behavior node, separate intervention and observation datasets are constructed to simulate the counterfactual problem of "how user labels would change if the behavior did not exist." The intervention dataset is constructed by forcibly removing all behavior records containing the behavior type corresponding to the current behavior node from the complete user behavior data. This involves performing a "do" operation on the behavior node, severing its association with its upstream factors, thus placing it in an intervened state in the causal graph. The observation dataset retains all behavior records for the corresponding behavior node, reflecting the association between user behavior and labels under natural conditions. Both datasets are organized at the user level, with each record containing the user's behavior feature vector and known label attribution information. The user scope of the intervention and observation datasets is kept consistent to ensure comparability in subsequent distribution comparisons and avoid introducing additional noise due to differences in user groups.
[0084] Based on the behavioral characteristics of users in the intervention dataset, the label attribution probability distribution of each label node is calculated using a label attribution probability estimation model, thus obtaining the intervention label distribution. Specifically, the behavioral feature vector of each user in the intervention dataset is input into the label attribution probability estimation model, which outputs the user's attribution probability for each label type. The attribution probabilities of all users are then aggregated to obtain the overall probability distribution of label nodes under the intervention conditions. Similarly, based on the behavioral characteristics of users in the observation dataset, the label attribution probability distribution is calculated in the same way to obtain the observation label distribution. The label attribution probability estimation model can be implemented using logistic regression, gradient boosting trees, or lightweight neural networks. The model is pre-trained on the full set of labeled user data, and the parameters are fixed during inference, reflecting the distribution differences between intervention and observation conditions only based on the differences in input features.
[0085] Calculate the KL divergence between the intervention label distribution and the observed label distribution to quantify the causal influence of the behavior node on the label node. Let the observed label distribution be... The distribution of intervention labels is as follows The KL divergence is defined as:
[0086]
[0087] in Index representing the tag category, Indicates the user's assigned label category under the observation conditions. The probability, Indicates the user's affiliation label category under intervention conditions. The probability of. The larger the value, the more significant the shift in label distribution after removing the behavior node, indicating a stronger causal influence of the behavior node on the label nodes. The calculated KL divergence value is used as the causal strength value of the causal edge from the corresponding behavior node to the label node, denoted as . ,in Indicates the number of the behavior node. Indicates the number of the tag node.
[0088] When the causal strength value Exceeding the preset causal association threshold At that time, a cause-effect graph is established from the behavior nodes in the behavior-label cause-effect graph. Pointing to the tag node The directed causal edge, and will Assign the weight to this causal edge. Causal correlation threshold. Setting the threshold requires comprehensive consideration of the granularity of the tagging system and business needs. A threshold that is too low will introduce a large number of weak causal relationships, resulting in an overly dense causal graph and increasing the computational burden of subsequent counterfactual inferences. A threshold that is too high may miss some causal relationships with practical business significance, affecting the coverage of user tags. In actual engineering implementation, a suitable quantile can be selected as the adaptive threshold by performing quantile statistics on the causal strength values of all behavior nodes and tag node combinations. Alternatively, business experts can manually specify the threshold based on domain knowledge. For behavior node and tag node combinations that do not exceed the threshold, no causal edge is established in the causal graph, as they are considered to have no significant causal relationship.
[0089] After the behavior-label causal graph is constructed, the set of directed causal edges in the graph fully describes the causal influence structure of each behavior type on each label type. The weight of each causal edge, i.e., the causal strength value, reflects the shift in label distribution after the removal of the corresponding behavior, and has interpretable statistical meaning. In multi-platform scenarios, behavior nodes contributed by different business platforms may have a causal influence on the same label node. The causal graph can naturally integrate the complex relationships between cross-platform behaviors and labels, providing a structured causal basis for subsequent counterfactual inferences on missing behavior data. In addition, due to the asymmetry of KL divergence, and They are not equal in numerical value, and adopt... The form of [the method] can more sensitively capture the shift of the observed distribution relative to the intervention distribution, which is consistent with the semantics of causal analysis that "measures the impact of intervention based on observations". During the calculation, the probability values need to be smoothed to avoid KL divergence caused by some label categories having zero probability in the intervention dataset. A common smoothing method is to add a small amount of Laplace smoothing term to the probability values.
[0090] For users with missing behavioral data, a counterfactual label distribution is generated based on causal strength values, and an observed label distribution is generated based on existing behavioral data. The KL divergence between the observed label distribution and the counterfactual label distribution is calculated, including:
[0091] Identify users with missing behavioral data and retrieve the missing behavioral nodes from the user's behavioral data;
[0092] Extract the causal strength value of the causal edge connected to the missing behavior node in the behavior-label causal graph, and extract the observed behavior node connected by the causal edge and its behavior feature value in the user's existing behavior data;
[0093] Counterfactual inference is performed based on causal strength values. The behavioral feature values of observed behavioral nodes are weighted and summed with the causal strength values of the corresponding causal edges to obtain the simulated behavioral feature values of missing behavioral nodes. The simulated behavioral feature values are then filled into the missing positions to construct a hypothesis to complete the dataset.
[0094] Based on the hypothesis completion dataset, a counterfactual label distribution is generated by the behavioral feature values of all behavioral nodes in the dataset.
[0095] Generate an observation label distribution based on the behavioral feature values of observed behavioral nodes in existing user behavior data;
[0096] Extract the probability values of each label node in the observed label distribution and the counterfactual label distribution. For each label node, calculate the log ratio of the observed probability value to the counterfactual probability value. Sum the products of the observed probability value and the log ratio to calculate the KL divergence between the observed label distribution and the counterfactual label distribution.
[0097] After constructing the behavior-label causal graph and calculating the causal strength of each causal edge for user behavior data, for users with missing behavior data, it is necessary to assess the impact of their missing behaviors on the label generation results to determine whether subsequent missing behavior completion operations are necessary. The core of this assessment process is to simulate the hypothetical scenario after the missing behaviors are completed using counterfactual inference, and then compare the label distribution generated under the hypothetical scenario with the label distribution generated solely based on existing observation data, using KL divergence to quantify the deviation between the two.
[0098] When identifying users with missing behavioral data, the system iterates through user behavior data records aggregated from multiple platforms to check for gaps in the behavioral feature values corresponding to each behavioral node. For a given user, if one or more behavioral nodes in the behavior-label causal graph have not yielded valid behavioral feature values, the user is marked as a user with missing behavior data, and the set of all missing behavior nodes is recorded. The identification of missing behavior nodes relies not only on null value detection in the original data but also on the data reporting specifications of each business platform to eliminate discrepancies between temporary missing data due to platform data delays and the actual absence of the behavior, ensuring the accuracy of subsequent processing.
[0099] After identifying the missing behavior node, causal edges directly connected to it are extracted from the behavior-label causal graph, and the causal strength values corresponding to these edges are read. Simultaneously, the observed behavior nodes connected by these causal edges are extracted from the graph, and their corresponding behavioral feature values are read from the user's existing behavior data. Here, "observed behavior nodes" refer to behavior nodes that have valid behavioral feature values in the current user's behavior records, and these feature values can directly participate in subsequent simulation calculations. Establishing the association between the missing behavior node and the observed behavior node through causal edges is the foundation of counterfactual inference.
[0100] Based on the information extracted above, counterfactual inference is performed on the missing behavior nodes. Specifically, the behavioral feature values of all observed behavior nodes connected to the missing behavior node are weighted and summed with the causal strength values of the corresponding causal edges to obtain the simulated behavioral feature value of the missing behavior node. Let the missing behavior node be... With the set of observed behavior nodes Nodes in There exists a causal edge, and the causal strength value of this causal edge is denoted as . ,node The behavioral characteristic value is denoted as Then the behavior node is missing. Simulated behavioral feature values The calculation is as follows:
[0101]
[0102] in, Reflects the observed behavior nodes For missing behavior nodes The weight of causal influence For nodes The actual observed behavioral characteristic values, These are the simulated behavioral feature values obtained through causal weighted inference. The simulated behavioral feature values of all missing behavioral nodes are filled into the corresponding missing positions in the user behavior data to construct a hypothesis completion dataset. This dataset is not actually collected data, but rather a reasonable inference of missing behaviors under the constraints of the causal graph structure, used for the subsequent generation of counterfactual label distributions.
[0103] Based on the hypothetical completion of the behavioral feature values of all behavioral nodes in the dataset (including originally observed behavioral nodes and simulated imputation of missing behavioral nodes), a label generation model or label inference rule is used to output the probability distribution of each label node, i.e., the counterfactual label distribution. The counterfactual label distribution describes the probability of a user's affiliation to each label category assuming all behavioral data is complete. Correspondingly, based on the behavioral feature values of observed behavioral nodes in the user's existing behavioral data (excluding any simulated imputation values), a label generation model or label inference rule is also used to output the probability distribution of each label node, i.e., the observed label distribution. The observed label distribution describes the probability of a user's affiliation to each label category relying only on currently available behavioral data.
[0104] After obtaining the observed label distribution and the counterfactual label distribution, for each label node in the behavior-label causal graph, its probability value under the observed label distribution and its probability value under the counterfactual label distribution are extracted. Let the index of the label node be... Its probability value under the observed label distribution is denoted as The probability value under the counterfactual label distribution is denoted as Then for the tag node The logarithm ratio of the observed probability value to the counterfactual probability value is calculated as follows: and the observed probability value The product of this logarithmic ratio and the value of the logarithmic ratio is taken as the contribution of that label node to the KL divergence. The sum of the contributions of all label nodes yields the KL divergence between the observed label distribution and the counterfactual label distribution. :
[0105]
[0106] in, For tag nodes The probability value under the observed label distribution For tag nodes The probability value under the counterfactual label distribution. For the index of the tag node, To observe the KL divergence of the label distribution relative to the counterfactual label distribution.
[0107] The physical meaning is: when When the value is large, it indicates that missing behavioral data has a significant impact on the label distribution. The label distribution generated solely based on existing observation data deviates significantly from the label distribution assumed to have complete behavioral data. In this case, it is necessary to complete the missing behaviors. When the value is small, it indicates that the missing behavior has a limited impact on the label distribution, and the existing observational data can already accurately characterize the user labels, so no completion operation is needed. By... By comparing with a preset stability threshold, users who truly need behavior completion can be efficiently screened out, avoiding the waste of computing resources caused by performing completion processing on all missing users.
[0108] In practical applications, behavioral feature values reported by different business platforms may have different dimensions; for example, the numerical ranges of purchase amount and browsing duration may differ significantly. To ensure the comparability of each behavioral feature value when calculating the weighted sum of simulated behavioral feature values, each behavioral feature value needs to be normalized before extracting the behavioral feature values of observed behavioral nodes, so that they are uniformly mapped to the same numerical range. Normalization can be performed using methods such as min-max normalization or z-score standardization, and the specific choice depends on the distribution characteristics of behavioral data on each platform. Using normalized behavioral feature values in the weighted summation can effectively improve the rationality of the simulated behavioral feature values, thereby ensuring the accuracy of the counterfactual label distribution calculation.
[0109] Furthermore, when calculating the KL divergence, to avoid the influence of the counterfactual probability value of a certain label node... The approach to zero can cause numerical overflow in logarithmic operations. In practical implementations, this is usually addressed by... Smoothing is performed by adding a very small smoothing constant to the counterfactual probability values of all labeled nodes before calculation. This ensures the numerical stability of the calculation process. Smoothing does not significantly affect the overall magnitude of the KL divergence, but it effectively avoids numerical anomalies under boundary conditions, ensuring the robustness of the entire evaluation process.
[0110] like Figure 2 As shown, Figure 2 This diagram illustrates the comparison between observed and counterfactual label distributions in this invention. The blue bars represent the probability of observed labels generated solely based on existing observed behaviors (browsing, adding to cart, favorites), while the orange bars represent the probability of counterfactual labels after simulating and completing missing behaviors (placing an order, sharing) through counterfactual inference. The difference reflects the degree to which missing behaviors perturb label attribution. The KL divergence (0.117 in this example) quantifies this difference. When it exceeds a preset stability threshold (0.15), it indicates that the missing behavior has a significant impact on the labels, requiring the triggering of a subsequent completion process.
[0111] When the KL divergence exceeds a preset stability threshold, the priority of the missing behavior node is calculated by jointly using the causal strength value of the causal edge corresponding to the missing behavior node and the probability of behavior missing, and the target sequence for missing behavior completion is determined to include:
[0112] When the KL divergence exceeds the preset stability threshold, extract all missing behavior nodes from the user behavior data.
[0113] For each missing behavior node, backtrack in the behavior-label causal graph to identify the observed behavior nodes that reach the missing behavior node, extract the causal transmission path from the observed behavior node to the missing behavior node, and evaluate the causal recoverability of the missing behavior node based on the causal strength value of the causal edge on the causal transmission path.
[0114] For each missing behavior node, identify the label nodes connected to the missing behavior node, extract the probability values of the label nodes in the observed label distribution and the counterfactual label distribution, and assess the degree of local influence of the missing behavior node on the label distribution based on the difference in probability values.
[0115] Count the number of missing samples for each missing behavior node in the user behavior data, and determine the probability of missing behavior based on the number of missing samples and the total number of users.
[0116] The priority value of each missing behavior node is determined based on causal recoverability, degree of local influence and probability of behavior missing. The missing behavior completion target sequence is generated by sorting according to the priority value. The missing behavior nodes are extracted from the missing behavior completion target sequence as missing behavior completion targets.
[0117] When the KL divergence exceeds a preset stability threshold, it indicates a significant deviation between the current user's observed label distribution and the counterfactual label distribution. This suggests that missing behavioral data has a substantial impact on the label generation results, necessitating targeted completion of missing behavioral nodes. Under this premise, all missing behavioral nodes are extracted from user behavior data. Specifically, this involves identifying the set of behavioral nodes with empty or unrecorded behavioral feature values from user behavior records across multiple business platforms, forming a list of missing nodes to be processed. This extraction process requires traversing all behavioral nodes in the behavior-label causal graph, comparing each node against the actual user behavior data, and verifying the existence of valid observations for each node. Nodes without valid observations are marked as missing behavioral nodes.
[0118] For each missing behavior node, a backtracking identification process is performed in the behavior-label causal graph, tracing backwards along the causal edges to find the observed behavior nodes that can reach the missing behavior node. Specifically, starting from the missing behavior node, the predecessor nodes are traversed layer by layer along the reverse direction of the causal edges until all behavior nodes with valid observations are found, and the causal propagation paths between these observed behavior nodes and the missing behavior node are recorded. Causal propagation paths may contain multi-hop causal edges, and each path consists of several intermediate nodes and corresponding causal edges. For each causal propagation path, the causal strength values of each causal edge on the path are multiplied together to obtain the end-to-end causal propagation strength of the path. If multiple causal propagation paths exist, the end-to-end causal propagation strengths of all paths are summed to obtain the causal recoverability score of the missing behavior node. The calculation method is as follows:
[0119]
[0120] in, Indicates reaching the missing behavior node The set of all causal transmission paths, This indicates one of the specific paths. Representing a path Upper The causal strength value of a causal edge. The larger the value, the more or stronger the observed behavioral nodes that can support the recovery of the missing behavioral node, and the higher the causal recoverability.
[0121] When assessing the degree of local influence, the set of label nodes directly connected to each missing behavior node in the behavior-label causal graph is identified. For each associated label node, its probability value in the observed label distribution and the counterfactual label distribution is extracted, and the absolute difference between the two is calculated. The probability differences on all label nodes connected to the missing behavior node are weighted and summed, with the weights taken as the causal strength values of the corresponding causal edges, to obtain the score of the degree of local influence of the missing behavior node on the label distribution. The calculation method is as follows:
[0122]
[0123] in, Indicates missing behavior nodes A collection of directly connected tag nodes. For the tag node's index, Indicates missing behavior nodes Pointing to the tag node The causal strength value of the causal edge. Represents label node The probability value under the observed label distribution Represents label node The probability value under the counterfactual label distribution. The larger the value, the more significant the local perturbation of the label distribution caused by the missing behavior node, and the more obvious the improvement effect of completing the node on the final label generation result.
[0124] The number of missing samples for each missing behavior node in the full user behavior data is counted; that is, the number of users whose behavior node is missing in all user records is denoted as . The total number of users is recorded as Then the probability of missing behavior for:
[0125]
[0126] The probability of missing behavior reflects the prevalence of the missing behavior node in the overall user group. A higher probability means that the missing behavior node is more common, and the greater the overall impact on group-level tag generation, so the priority of completion should be increased accordingly.
[0127] Comprehensive causal recoverability score Local impact level score and probability of missing behavior Calculate the priority value of each missing behavior node based on three dimensions. The calculation method is as follows:
[0128]
[0129] in, , , These are the weighting coefficients for causal recoverability, the degree of local impact, and the probability of behavioral omission, respectively. The sum of these three is 1, and their specific values can be configured according to the needs of the business scenario. For example, in scenarios where the core objective is tag accuracy, the weighting coefficient can be appropriately increased. The weighting of local impact is adjusted to prioritize data integrity in the priority calculation; in scenarios where data integrity is the primary objective, the weighting can be appropriately increased. The weight of the missing behavior nodes is prioritized to fill in the missing nodes with a wider range of values.
[0130] according to The missing behavior nodes are sorted in descending order of their values to obtain the missing behavior completion target sequence. The missing behavior nodes ranked higher in this sequence have higher causal recoverability, greater impact on label distribution, and a wider range of missing values. Prioritizing their completion allows for the greatest improvement in label quality with minimal completion cost. During subsequent behavior data completion, missing behavior nodes are extracted sequentially from the sequence according to the order of the missing behavior completion target sequence. The causal path contribution matrix is constructed and behavior feature value recovery is performed one by one until all missing behavior completion targets in the sequence are completed or the preset completion termination condition is met.
[0131] This multi-dimensional joint scoring mechanism effectively avoids the bias in completion order caused by a single indicator. Sorting solely by causal strength may lead to prioritizing nodes with weak impact on tags but complete causal paths, while ignoring critical missing nodes with a more significant impact on tag distribution; sorting solely by missing probability may place a large number of low-impact nodes at the top, wasting completion resources. By weighted and fused scores from the three dimensions, the completion order considers both the feasibility of data recovery and the actual benefits of improving tag quality, while also taking into account the prevalence of missing data. This allows the missing behavior completion target sequence to achieve optimal improvement in user tag generation quality with limited completion resources.
[0132] Assessing the causal recoverability of missing behavior nodes based on the causal strength values of causal edges along the causal transmission path includes:
[0133] For each missing behavior node, extract all observed behavior nodes pointing to the missing behavior node from the behavior-label causal graph as predecessor behavior nodes;
[0134] For each causal propagation path from the predecessor behavior node to the missing behavior node, the causal strength value of the continuous causal edges on the causal propagation path is extracted, and the path propagation strength of the causal propagation path is obtained by multiplying the causal strength values of the continuous causal edges.
[0135] In user behavior data, samples with both preceding behavior node observations and missing behavior node observations are retrieved as validation samples. The observed behavior feature vectors of the preceding behavior nodes and the true behavior feature vectors of the missing behavior nodes are extracted from the validation samples.
[0136] The observed behavior feature vector of the predecessor behavior node is weighted and mapped with the path transmission strength to generate the inferred behavior feature vector of the missing behavior node. The vector similarity between the inferred behavior feature vector and the real behavior feature vector is calculated as the transmission accuracy of the causal transmission path.
[0137] The causal transmission path with the highest transmission accuracy is selected as the optimal recovery path. The path transmission strength and transmission accuracy of the optimal recovery path are extracted. The causal recoverability of the missing behavior node is determined based on the weighted combination of path transmission strength and transmission accuracy.
[0138] When evaluating the causal recoverability of missing behavior nodes, it is necessary to fully utilize the structural information in the behavior-label causal graph and quantify the ability of each causal transmission path to recover the missing behavior through actual validation samples. For each missing behavior node, all observed behavior nodes pointing to the missing behavior node are traversed in the constructed behavior-label causal graph, and these observed behavior nodes are marked as predecessor behavior nodes. Predecessor behavior nodes not only include first-order neighbor nodes directly connected to the missing behavior node, but also higher-order predecessor nodes indirectly transmitted to the missing behavior node through multi-hop causal edges, thus ensuring the completeness of path extraction.
[0139] For each causal propagation path originating from the predecessor behavior node and extending along the causal edge to the missing behavior node, the causal strength value corresponding to each consecutive causal edge on the path is extracted sequentially. Let a certain causal propagation path... The above contains The first continuous causal edge, The causal strength value of a causal edge is denoted as (in For path The sequential numbering of the causal edges above, with a value range of 1. arrive ), then the path Path conduction strength The causality strength values of all causal edges on the path are multiplied together to obtain the following:
[0140]
[0141] The physical meaning of this product operation is that as a causal signal propagates along a path, it attenuates to some extent after passing through each causal edge. The cascading effect of multiple causal edges, through multiplication, characterizes the overall propagation capacity of the entire path. The longer the path and the weaker the causal edges along it, the stronger the path's propagation. The lower the value, the more limited the contribution of this path to the recovery of missing behaviors.
[0142] After calculating the path propagation strength, the accuracy of path recovery needs to be verified using actual data. Samples that simultaneously meet the following conditions are retrieved from user behavior data: the sample has valid observations at the predecessor behavior node and also has true observations at the missing behavior node (i.e., the sample does not experience data loss at that behavior node). These samples are called validation samples. The existence of validation samples makes it possible to evaluate path recovery capability given the true answer. The observed behavior feature vectors of the predecessor behavior nodes are extracted from the validation samples, denoted as... Simultaneously, the true behavioral feature vector of the missing behavioral node in the validation sample is extracted, denoted as... .
[0143] The observed behavior feature vector of the predecessor behavior node Path transmission strength of the corresponding causal transmission path Perform weighted mapping to generate inferred behavior feature vectors for missing behavior nodes. Specifically, Multiply the eigenvalues of each dimension by the path propagation strength As weighting coefficients, and combined with the feature dimension alignment relationships of each node in the path structure, the predecessor feature space is mapped to the feature space where the missing behavior node is located, resulting in... When there are multiple causal transmission paths originating from different precursor behavior nodes, the inference vectors generated by each path are normalized and weighted according to their respective transmission strengths to form a comprehensive inference behavior feature vector.
[0144] In obtaining the inferred behavior feature vector Compared with the real behavior feature vector Then, the accuracy of the causal transmission path is measured by calculating the cosine similarity between the two. :
[0145]
[0146] The range of values for cosine similarity is: The closer the value is The closer the direction of the inferred behavior feature vector is to the actual behavior feature vector, the stronger the ability of the causal transmission path to reconstruct the missing behavior. In actual calculations, to avoid numerical anomalies caused by zero vector magnitude, a minimal smoothing term can be added to the denominator. Transmission accuracy It comprehensively reflects the effectiveness of path transmission strength and the degree to which the causal graph structure supports the path's recovery ability, and is the core basis for path selection.
[0147] All extracted causal transmission paths were sorted by transmission accuracy. Sort the paths in descending order and select the path with the highest propagation accuracy as the optimal recovery path, denoted as path . Extract the path conduction strength of the optimal recovery path. With transmission accuracy The causal recoverability score of the missing behavioral node is determined by a weighted combination of the two factors. :
[0148]
[0149] in, The weighting coefficients for path transmission strength. The weighting coefficients for transmission accuracy satisfy the following conditions: And all of them are positive. and The value of can be adjusted according to the actual business scenario: when the causal graph structure is of high quality and the causal edge strength calculation is relatively reliable, it can be appropriately increased. The proportion can be appropriately increased when the number of validation samples is sufficient and the propagation accuracy estimate is relatively stable. The weighting of the two dimensions. The causal recoverability score is calculated by weighting and fusing the two dimensions. It can reflect the transmission potential at the structural level of the causal graph, and can also correct the theoretical transmission strength by verifying the results with actual data, so as to more objectively and accurately assess whether missing behavioral nodes can be effectively recovered through causal inference paths.
[0150] In real-world applications of multi-platform user behavior data, differences in data collection mechanisms across different business platforms often result in long causal transmission paths and weak transmission strength between these nodes. Relatively low. At this point, the transmission accuracy is... The correction function is particularly crucial, as it can identify paths with low path conduction strength but good actual recovery accuracy, avoiding the omission of effective recovery paths due to relying solely on path conduction strength. Simultaneously, the selection strategy for validation samples also affects the estimation quality of conduction accuracy. When the number of validation samples is insufficient, cross-validation or bootstrapping sampling methods can be used to expand the validation set, improving the stability of the conduction accuracy estimation. The final causal recoverability score is obtained. This will serve as the core input for subsequent calculations of missing behavior node priorities, and together with the local impact score and the probability of missing behavior, it will determine the priority order for completing missing behaviors.
[0151] Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix including:
[0152] Extract each missing behavior completion target sequentially from the missing behavior completion target sequence as the current completion target node;
[0153] For the current completion target node, all observed behavior nodes that can reach the current completion target node are identified in the behavior-label causal graph as predecessor observation nodes. The causal edge path between each predecessor observation node and the current completion target node is extracted, and all causal edge paths are used to form the predecessor causal edge path set of the current completion target node.
[0154] For each causal edge path in the set of predecessor causal edge paths, extract the causal strength value of the continuous causal edges on the causal edge path, and multiply the causal strength values of the continuous causal edges to obtain the path causal contribution value of the causal edge path.
[0155] For all missing behavior completion target nodes in the missing behavior completion target sequence, the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node are organized into a matrix to generate a causal path contribution matrix, where the row index is the missing behavior completion target node, the column index is the causal edge path, and the matrix element is the path causal contribution value.
[0156] In constructing the causal path contribution matrix, each missing behavior completion target is sequentially extracted from the missing behavior completion target sequence as the current completion target node. This sequence is already sorted by priority; therefore, processing in order ensures that high-priority missing behavior nodes complete path tracing and matrix filling first, avoiding interference from the path information of low-priority nodes with the feature recovery process of high-priority nodes. For each current completion target node, a reverse tracing operation is performed in the behavior-label causal graph. That is, starting from the current completion target node in the opposite direction of the causal edges, all observed behavior nodes that can reach this node are traversed layer by layer upwards, and these nodes are marked as predecessor observation nodes.
[0157] The specific implementation of the reverse tracing is as follows: Starting from the current completion target node, a reverse search is performed along the directed edges in the causal graph, traversing all behavior nodes with directed paths pointing to that node. During the traversal, only nodes that actually have observed behavior feature values are retained as valid predecessor observation nodes, and intermediate nodes that are also in a missing state are skipped. This filtering mechanism ensures that the calculation of the causal contribution value of subsequent paths has actually usable feature inputs, avoiding the breakage of the inference chain due to the existence of consecutive missing nodes in the path. For each identified predecessor observation node, the complete path from that predecessor observation node to the current completion target node along the causal edge is extracted, that is, all sequentially connected directed causal edges on the path are recorded to form a complete causal edge path. All causal edge paths corresponding to the current completion target node are summarized to form the predecessor causal edge path set of that node.
[0158] For each causal edge path in the set of predecessor causal edge paths, extract the causal strength value of each continuous causal edge on that path. Let a certain causal edge path... The above passed in sequence Causal edge, the first The causal strength value of a causal edge is denoted as Then the path causality contribution value of this path It is obtained by multiplying the causal strength values of all consecutive causal edges, that is:
[0159]
[0160] The physical meaning of this product operation is that as a causal signal propagates along a path, it attenuates to a certain extent with each causal edge it passes through. The longer the path and the lower the strength of a single causal edge, the smaller the causal contribution to the final target node. The product form of the calculation naturally reflects the cumulative attenuation effect of causal propagation in multi-hop paths, making the contribution values of long paths and weakly connected paths significantly lower than those of short paths and strongly connected paths. This provides a basis for assigning reasonable weights to each path in the subsequent feature recovery stage.
[0161] Once the set of predecessor causal edge paths and their corresponding causal contribution values for all missing behavior completion target nodes have been calculated, all path information is organized into a matrix to generate a causal path contribution matrix. The row indices of the matrix correspond to the missing action completion target nodes in the missing action completion target sequence. Let there be a total of... The matrix contains several target nodes for completing missing actions; the column indices of the matrix correspond to all causal edge paths appearing in the set of predecessor causal edge paths of all target nodes for completing missing actions, assuming the total number of paths is 1. ,but for The matrix. The first element in the matrix. Line 1 Column elements Indicates the first The causal path to the first The path causal contribution value of the missing behavior to complete the target node; if the first... The path does not exist in the first If the set of predecessor causal edge paths of a node is filled with 0, then the corresponding matrix element is filled with 0, indicating that the path does not contribute to the node.
[0162] During the matrix organization phase, it is necessary to perform global path deduplication and unified numbering on the path sets of all missing behavior completion target nodes. Different missing behavior completion target nodes may share some of the same predecessor observation nodes, so there may be overlapping paths between their predecessor causal edge path sets. After uniformly numbering the overlapping paths, the number of columns in the matrix is the total number of all paths after deduplication. The same column in the matrix corresponds to the contribution value of the same path on different missing behavior completion target nodes, which facilitates subsequent cross-node path contribution comparison and weight normalization operations.
[0163] To further improve the numerical stability of the causal path contribution matrix, the non-zero elements in each row of the matrix can be normalized, so that the sum of the causal contribution values of all paths corresponding to the target node for the same missing behavior is normalized to 1. After normalization, the matrix elements... Transform into the first The path is in the recovery of the first The relative contribution weights of each missing behavior when filling in the target node are directly used to weight and fuse the behavioral feature values of each predecessor observation node, thereby achieving effective recovery of missing behavioral features.
[0164] In the actual construction process, if a missing behavior completion target node has no reachable observed predecessor nodes in the behavior-label causal graph (i.e., its predecessor causal edge path set is empty), then all rows of the matrix corresponding to that node are filled with 0, and it is marked as a node that cannot be recovered through causal paths. Subsequent filling can be done using statistical averages or platform-wide distribution as a fallback to ensure the completeness of the completion process. Furthermore, a maximum tracing depth limit needs to be set during path tracing to avoid generating excessively long paths in complex causal graphs that cause the path's causal contribution value to approach zero and lose its practical significance. Simultaneously, computational complexity needs to be controlled to ensure processing efficiency in large-scale cross-platform user behavior data scenarios.
[0165] The causal path contribution matrix generated through the above steps is the final result. The contribution relationship between each missing behavior completion target node and all its available predecessor causal edge paths is fully recorded in a structured matrix form. This provides a core quantitative basis for subsequent recovery of missing behavior features based on the causal path contribution matrix and the feature values of observed behavior nodes, ensuring that the feature recovery process makes full use of the structural information in the behavior-label causal graph, rather than relying on simple statistical interpolation methods.
[0166] like Figure 3 As shown, Figure 3This is a heatmap of the path contribution matrix for this invention, where the row index represents the missing behavior completion target (O, S, C, F), and the column index represents the preceding causal edge path (P1~P8). Matrix elements are the path causal contribution values (products of causal strengths along the path). Darker colors indicate a greater contribution of the path to the recovery of the target node.
[0167] like Figure 4 As shown, Figure 4 This is a flowchart of the user missing behavior completion and tag prediction operation of the present invention.
[0168] Based on the causal path contribution matrix and the observed behavioral feature values of behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data, including:
[0169] Extract the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node from the causal path contribution matrix;
[0170] For each causal edge path, the behavioral feature values of each observed behavioral node on the causal edge path are extracted. A feature transmission chain is constructed according to the transmission order of the causal edge. Based on the causal strength value between adjacent nodes in the feature transmission chain, the behavioral feature values are transmitted layer by layer to obtain candidate recovery feature values.
[0171] For all causal edge paths of the target node for completing the current missing behavior, calculate the contribution ratio of the causal contribution value of each path to the total, and obtain the recovery behavior feature value by weighted summing of each candidate recovery feature value and its corresponding contribution ratio.
[0172] Fill the missing behavior feature values of each missing behavior completion target node into the corresponding missing positions in the user behavior data to generate the completed user behavior data;
[0173] Extract the causal precursor behavior nodes pointing to each label node from the behavior-label causal graph, and extract the causal strength value from the causal precursor behavior node to the label node as the behavior-label causal weight.
[0174] The behavioral feature values of each causal precursor behavior node are extracted from the completed user behavior data. The user label is obtained by multiplying the behavioral feature values with the behavior-label causal weights and then summing them.
[0175] From the causal path contribution matrix Extract the row vector corresponding to each missing behavior completion target node. This row vector contains the path causality contribution values of all predecessor causal edge paths to that node. For the ... For each missing behavior, the target node is filled in, and all non-zero column indices corresponding to it are extracted, thus determining the set of predecessor causal edge paths that have a causal relationship with that node. Each predecessor causal edge path... Corresponding path causal contribution value The causal path contribution matrix was already calculated by multiplying the strength values of each causal edge along the path during the causal path contribution matrix construction phase; here, we directly read the matrix elements. You can get the first The missing behavior completion target node and the first The contribution relationships between the paths are determined. By traversing the matrix row vectors, the column indices of paths with contribution values greater than zero are selected, thereby completely determining the set of predecessor causal edge paths and their corresponding contribution values for each missing behavior to complete the target node, providing input for subsequent feature propagation calculations.
[0176] For each determined predecessor causal edge path The behavioral feature values of each observed behavioral node along the path are extracted sequentially according to the propagation order of the causal edges. The nodes on the path are arranged according to the causal propagation direction, forming a feature propagation chain from the source observed behavioral node to the target missing behavioral completion node. A directed causal edge exists between every two adjacent nodes in the feature propagation chain, and this causal edge has a corresponding causal strength value. ,in For path The sequential numbering of the causal edges above, with a value range of 1. arrive , For path The total number of consecutive causal edges. Layer-by-layer propagation calculation starts from the first observed behavior node in the propagation chain. The behavior feature value of this node is multiplied by the causal strength value of the first causal edge to obtain the intermediate feature value propagated to the next layer node. If the next layer node is an observed node, the intermediate feature value is weighted and fused with the actual behavior feature value of that node, with the fusion weight determined by the causal strength value of the layer in which the node belongs. If the next layer node is an unobserved node, the intermediate feature value is directly used as the propagation feature value for that layer and propagated further. Following the above layer-by-layer propagation rules, the process proceeds step by step along the feature propagation chain until the missing behavior completion target node is reached, ultimately obtaining the candidate recovery feature value for the target node along this path. ,in Indicates the first The path to the first Candidate recovery feature values for completing the target node with missing behaviors.
[0177] Complete the target node for the currently missing behavior. For all preceding causal edge paths, calculate the proportion of each path's causal contribution to the total. Let the first path be... There are a total of [number] predecessor causal edge paths corresponding to the target node for the missing behavior completion. Article, No. The path causality contribution value of each path is Then the first Contribution ratio of each path The calculation method is as follows: By normalizing, the sum of the contribution proportions of all paths is ensured to be equal. This ensures that the weighted summation result is within a reasonable range of eigenvalues. The candidate recovery eigenvalues for each path are then calculated. and corresponding contribution ratio Perform a weighted summation to obtain the first... The recovery behavior feature value of the target node for missing behavior completion. The calculation formula is: This weighted summation mechanism ensures that the stronger the contribution of the causal transmission path, the greater its influence on the final recovered feature value, effectively utilizing the structured causal information encoded in the causal path contribution matrix.
[0178] The recovery behavior feature value of the target node is filled in by completing the missing behaviors. The missing values are filled into the corresponding positions in the user behavior data. In the original user behavior data, the feature value positions corresponding to missing behavior nodes are empty or placeholders. By writing the restored behavior feature values into the corresponding positions, the missing data is completed. After performing the above filling operation on all missing behavior completion target nodes, all the missing positions in the original user behavior data that were identified as completion targets have been covered by the restored behavior feature values, thus generating the completed user behavior data. The completed user behavior data is structurally consistent with the complete user behavior data, and each behavior node has a valid behavior feature value, which can be directly used for subsequent user tag generation calculations.
[0179] Extract the set of causal predecessor behavior nodes pointing to each label node from the behavior-label causal graph. Each label node in the behavior-label causal graph may have multiple behavior nodes directly pointing to it via directed causal edges; these direct predecessor behavior nodes have a direct causal influence on the label value of that label node. For label nodes... Extract all data that meet the causal association threshold. The preceding behavior node of the condition is identified, and the causal strength value of the corresponding causal edge is read. This is used as the behavior-label causal weight. This causal weight reflects the behavior node. For tag nodes The causal influence strength is calculated through intervention experiments during the behavior-label causal graph construction phase. It has clear causal semantics and is different from ordinary correlation weights.
[0180] Extract each causal precursor behavior node from the completed user behavior data. For behavior nodes whose observations already exist in the original data, their original behavior feature values are used directly; for missing behavior nodes that have been imputed, the restored behavior feature values are used. The behavioral feature value of each causal precursor behavior node is matched with its corresponding behavior-label causal weight. Perform the product operation, then apply it to the label node. The sum of the products of all causal precursor behavior nodes yields the user tag value corresponding to that tag node. The calculation formula is: ,in For tag nodes The set of causal precursor behavior nodes, For behavior nodes The behavioral feature values are calculated (for completed nodes, the recovered feature values are taken). This calculation is performed on all label nodes in the behavior-label causal graph to generate a complete set of user labels, thus completing the user label generation based on the completed user behavior data. This method fully utilizes the causal weight information in the causal graph structure to ensure that the user label generation process has an interpretable causal basis, while eliminating the negative impact of missing data on label accuracy through behavioral data completion.
[0181] A second aspect of this invention provides a user tag generation system based on cross-platform behavioral data analysis, comprising:
[0182] The data acquisition unit is used to acquire user behavior data from multiple business platforms;
[0183] The causal graph building unit is used to build a behavior-label causal graph containing behavior nodes, label nodes, and causal edges from user behavior data. It calculates the causal strength value of the causal edges by intervening in the behavior nodes and observing the changes in the distribution of label nodes.
[0184] The counterfactual unit is used to generate a counterfactual label distribution based on the causal strength value for users with missing behavioral data, generate an observation label distribution based on the existing behavioral data, and calculate the KL divergence between the observation label distribution and the counterfactual label distribution.
[0185] The target unit for completion is used to determine the target sequence for completing missing behaviors by jointly calculating the priority of missing behavior nodes based on the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior when the KL divergence exceeds the preset stability threshold.
[0186] The path contribution unit is used to extract causal edge paths that end with each missing behavior completion target in the missing behavior completion target sequence and construct a causal path contribution matrix.
[0187] The tag completion unit is used to recover the behavior feature values of each missing behavior completion target based on the causal path contribution matrix and the behavior feature values of the observed behavior nodes on the causal edge path, fill them into the user behavior data to obtain the completed user behavior data, and generate user tags based on the completed user behavior data.
[0188] A third aspect of the present invention provides an electronic device, comprising:
[0189] processor;
[0190] Memory used to store processor-executable instructions;
[0191] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0192] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0193] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A user tag generation method based on cross-platform behavioral data analysis, characterized in that, include: Acquire user behavior data from multiple business platforms; A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength value of the causal edges is calculated by intervening in the behavior nodes and observing the changes in the distribution of label nodes. For users with missing behavioral data, a counterfactual label distribution is generated based on the causal strength value, an observation label distribution is generated based on the existing behavioral data, and the KL divergence between the observation label distribution and the counterfactual label distribution is calculated. When the KL divergence exceeds the preset stability threshold, the priority of the missing behavior node is calculated by jointly calculating the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior, and the target sequence for missing behavior completion is determined. Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix; Based on the causal path contribution matrix and the behavioral feature values of the observed behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data.
2. The method according to claim 1, characterized in that, A behavior-label causal graph containing behavior nodes, label nodes, and causal edges is constructed based on user behavior data. The causal strength values of the causal edges are calculated by observing changes in the distribution of label nodes after intervention in behavior nodes. Extract behavior types from user behavior data, instantiate each behavior type as a behavior node, extract tag types from a predefined tag set, and instantiate each tag type as a tag node; For each behavior node, an intervention dataset and an observation dataset are constructed. The intervention dataset is generated by forcibly removing the behavior records of the corresponding behavior node from the user behavior data, and the observation dataset is generated by retaining the behavior records of the corresponding behavior node. The intervention label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the intervention dataset, and the observation label distribution is obtained by calculating the label attribution probability distribution based on the behavioral characteristics of users in the observation dataset. Calculate the KL divergence between the intervention label distribution and the observation label distribution, and use the KL divergence as the causal strength value of the causal edge from the corresponding behavior node to the label node; When the causal strength value exceeds the causal association threshold, a causal edge is established in the behavior-label causal graph, pointing from the corresponding behavior node to the label node, and the causal strength value is assigned as the weight of the causal edge.
3. The method according to claim 1, characterized in that, For users with missing behavioral data, a counterfactual label distribution is generated based on causal strength values, and an observed label distribution is generated based on existing behavioral data. The KL divergence between the observed label distribution and the counterfactual label distribution is calculated, including: Identify users with missing behavioral data and retrieve the missing behavioral nodes from the user's behavioral data; Extract the causal strength value of the causal edge connected to the missing behavior node in the behavior-label causal graph, and extract the observed behavior node connected by the causal edge and its behavior feature value in the user's existing behavior data; Counterfactual inference is performed based on causal strength values. The behavioral feature values of observed behavioral nodes are weighted and summed with the causal strength values of the corresponding causal edges to obtain the simulated behavioral feature values of missing behavioral nodes. The simulated behavioral feature values are then filled into the missing positions to construct a hypothesis-complete dataset. A counterfactual label distribution is generated based on the behavioral feature values of all behavioral nodes in the hypothesis completion dataset; an observation label distribution is generated based on the behavioral feature values of observed behavioral nodes in the existing user behavior data. Extract the probability values of each label node in the observed label distribution and the counterfactual label distribution. For each label node, calculate the log ratio of the observed probability value to the counterfactual probability value. Sum the products of the observed probability value and the log ratio to calculate the KL divergence between the observed label distribution and the counterfactual label distribution.
4. The method according to claim 1, characterized in that, When the KL divergence exceeds a preset stability threshold, the priority of the missing behavior node is calculated by jointly using the causal strength value of the causal edge corresponding to the missing behavior node and the probability of behavior missing, and the target sequence for missing behavior completion is determined to include: When the KL divergence exceeds the preset stability threshold, extract all missing behavior nodes from the user behavior data. For each missing behavior node, backtrack in the behavior-label causal graph to identify the observed behavior nodes that reach the missing behavior node, extract the causal transmission path from the observed behavior node to the missing behavior node, and evaluate the causal recoverability of the missing behavior node based on the causal strength value of the causal edge on the causal transmission path. For each missing behavior node, identify the label nodes connected to the missing behavior node, extract the probability values of the label nodes in the observed label distribution and the counterfactual label distribution, and assess the degree of local influence of the missing behavior node on the label distribution based on the difference in probability values. Count the number of missing samples for each missing behavior node in the user behavior data, and determine the probability of missing behavior based on the number of missing samples and the total number of users. The priority value of each missing behavior node is determined based on causal recoverability, degree of local influence and probability of behavior missing. The missing behavior completion target sequence is generated by sorting according to the priority value. The missing behavior nodes are extracted from the missing behavior completion target sequence as missing behavior completion targets.
5. The method according to claim 4, characterized in that, Assessing the causal recoverability of missing behavior nodes based on the causal strength values of causal edges along the causal transmission path includes: For each missing behavior node, extract all observed behavior nodes pointing to the missing behavior node from the behavior-label causal graph as predecessor behavior nodes; For each causal propagation path from the predecessor behavior node to the missing behavior node, the causal strength value of the continuous causal edges on the causal propagation path is extracted, and the path propagation strength of the causal propagation path is obtained by multiplying the causal strength values of the continuous causal edges. In user behavior data, samples with both preceding behavior node observations and missing behavior node observations are retrieved as validation samples. The observed behavior feature vectors of the preceding behavior nodes and the true behavior feature vectors of the missing behavior nodes are extracted from the validation samples. The observed behavior feature vector of the predecessor behavior node is weighted and mapped with the path transmission strength to generate the inferred behavior feature vector of the missing behavior node. The vector similarity between the inferred behavior feature vector and the real behavior feature vector is calculated as the transmission accuracy of the causal transmission path. The causal transmission path with the highest transmission accuracy is selected as the optimal recovery path. The path transmission strength and transmission accuracy of the optimal recovery path are extracted. The causal recoverability of the missing behavior node is determined based on the weighted combination of path transmission strength and transmission accuracy.
6. The method according to claim 1, characterized in that, Extract causal edge paths that terminate at each missing behavior completion target in the missing behavior completion target sequence, and construct a causal path contribution matrix including: Extract each missing behavior completion target sequentially from the missing behavior completion target sequence as the current completion target node; For the current completion target node, all observed behavior nodes that can reach the current completion target node are identified in the behavior-label causal graph as predecessor observation nodes. The causal edge path between each predecessor observation node and the current completion target node is extracted, and all causal edge paths are used to form the predecessor causal edge path set of the current completion target node. For each causal edge path in the set of predecessor causal edge paths, extract the causal strength value of the continuous causal edges on the causal edge path, and multiply the causal strength values of the continuous causal edges to obtain the path causal contribution value of the causal edge path. For all missing behavior completion target nodes in the missing behavior completion target sequence, the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node are organized into a matrix to generate a causal path contribution matrix, where the row index is the missing behavior completion target node, the column index is the causal edge path, and the matrix element is the path causal contribution value.
7. The method according to claim 1, characterized in that, Based on the causal path contribution matrix and the observed behavioral feature values of behavioral nodes on the causal edge path, the behavioral feature values of each missing behavior completion target are recovered and filled into the user behavior data to obtain the completed user behavior data. User tags are generated based on the completed user behavior data, including: Extract the set of predecessor causal edge paths and path causal contribution values corresponding to each missing behavior completion target node from the causal path contribution matrix; For each causal edge path, the behavioral feature values of each observed behavioral node on the causal edge path are extracted. A feature transmission chain is constructed according to the transmission order of the causal edge. Based on the causal strength value between adjacent nodes in the feature transmission chain, the behavioral feature values are transmitted layer by layer to obtain candidate recovery feature values. For all causal edge paths of the target node for completing the current missing behavior, calculate the contribution ratio of the causal contribution value of each path to the total, and obtain the recovery behavior feature value by weighted summing of each candidate recovery feature value and its corresponding contribution ratio. Fill the missing behavior feature values of each missing behavior completion target node into the corresponding missing positions in the user behavior data to generate the completed user behavior data; Extract the causal precursor behavior nodes pointing to each label node from the behavior-label causal graph, and extract the causal strength value from the causal precursor behavior node to the label node as the behavior-label causal weight. The behavioral feature values of each causal precursor behavior node are extracted from the completed user behavior data. The user label is obtained by multiplying the behavioral feature values with the behavior-label causal weights and then summing them.
8. A user tag generation system based on cross-platform behavioral data analysis, used to implement the method as described in any one of claims 1-7, characterized in that, include: The data acquisition unit is used to acquire user behavior data from multiple business platforms; The causal graph building unit is used to build a behavior-label causal graph containing behavior nodes, label nodes, and causal edges from user behavior data. It calculates the causal strength value of the causal edges by intervening in the behavior nodes and observing the changes in the distribution of label nodes. The counterfactual unit is used to generate a counterfactual label distribution based on the causal strength value for users with missing behavioral data, generate an observation label distribution based on the existing behavioral data, and calculate the KL divergence between the observation label distribution and the counterfactual label distribution. The target unit for completion is used to determine the target sequence for completing missing behaviors by jointly calculating the priority of missing behavior nodes based on the causal strength value of the causal edge corresponding to the missing behavior node and the probability of missing behavior when the KL divergence exceeds the preset stability threshold. The path contribution unit is used to extract causal edge paths that end with each missing behavior completion target in the missing behavior completion target sequence and construct a causal path contribution matrix. The tag completion unit is used to recover the behavior feature values of each missing behavior completion target based on the causal path contribution matrix and the behavior feature values of the observed behavior nodes on the causal edge path, fill them into the user behavior data to obtain the completed user behavior data, and generate user tags based on the completed user behavior data.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.