A User Behavior Prediction Method Based on Causal Propensity Score
By constructing a user behavior prediction method based on causal tendency scores, this method addresses the problem of neglecting causal relationships in existing technologies, enabling in-depth mining and quantitative evaluation of causal relationships, and improving the interpretability of the model and the accuracy of optimization strategy formulation.
Patent Information
- Application Number
- CN202510920118.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-07-04
AI Technical Summary
Existing user behavior prediction methods mainly focus on the correlation between behaviors, while ignoring causal relationships, which makes it difficult to explain prediction errors and formulate optimization strategies.
By constructing a feature association network, screening causal candidate pairs, quantifying causal effects and calculating causal tendency scores, and combining with a behavioral prediction model, the causal relationships are revealed and the model parameters are optimized, thus achieving in-depth mining and quantitative evaluation of causal relationships.
It significantly improves the interpretability and decision support capabilities of the model, enabling it to accurately predict user behavior and formulate personalized optimization strategies, thus achieving a closed loop from prediction to optimization.
Smart Images

Figure CN120494210B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of user behavior prediction technology, specifically a user behavior prediction method based on causal tendency scores. Background Technology
[0002] With the widespread adoption of the internet, mobile devices, and the Internet of Things (IoT), user behavioral data generated across different platforms exhibits multimodal, high-dimensional, and dynamic characteristics, including clickstreams, browsing history, transaction information, social media interactions, and location tracking. This data provides a foundation for uncovering potential behavioral patterns.
[0003] Traditional statistical methods such as regression analysis and time series modeling (such as the ARIMA model) were once widely used in user behavior analysis, but their linear assumptions and static characteristics make them difficult to adapt to complex and ever-changing real-world scenarios. With the rise of machine learning technology, supervised learning, unsupervised learning, and reinforcement learning methods have been gradually introduced to handle tasks such as classification, clustering, and sequence prediction.
[0004] Most current user behavior prediction methods focus only on the correlation between behaviors, neglecting the potential causal relationships between them. While this approach can reflect behavioral patterns to some extent, it fails to delve into the driving mechanisms behind the behaviors, leading to unexplained prediction errors and hindering the development of scientifically effective optimization strategies based on the prediction results. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a user behavior prediction method based on causal tendency scores, aiming to solve the problems in the background technology.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a user behavior prediction method based on causal tendency scores, comprising:
[0007] Step S1: Collect users' historical behavior information from the historical database;
[0008] Step S2: Extract behavioral features from historical behavioral information, normalize the extracted behavioral features, and output a normalized feature matrix;
[0009] Step S3: Based on the normalized feature matrix, establish a behavior prediction model; adjust the parameters of the behavior prediction model through the backpropagation algorithm and optimizer, and output the prediction error results;
[0010] Step S4: Based on the historical behavior information, analyze the causal relationship between the behavioral characteristics and calculate the causal tendency score;
[0011] Step S5: Analyze the reasons for the prediction error results of the behavior prediction model based on the causal tendency score; when some causal relationships are not captured by the behavior prediction model, adjust the corresponding behavioral features; update the behavior prediction model based on the adjusted behavioral features to obtain the optimized behavior prediction model.
[0012] Step S6: Use the optimized behavior prediction model to predict user behavior and formulate optimization strategies based on the causal relationships revealed by the causal tendency score.
[0013] Furthermore, the specific process of step S4 is as follows:
[0014] Step S4.1: Based on historical behavioral information, sort out the specific manifestations and occurrence sequence of each corresponding behavioral feature, map the behavioral features with temporal sequence and logical relationship to nodes, and construct a feature association network;
[0015] Step S4.2: Based on the feature association network and in accordance with the basic principles of causal inference, candidate pairs with causal relationships are selected from all node pairs of behavioral features;
[0016] Step S4.3: Use a causal inference algorithm to quantify the causal relationship strength of the candidate pairs to obtain standardized causal effect values;
[0017] Step S4.4: Convert the standardized causal effect values into causal tendency scores within a set interval.
[0018] Furthermore, the specific process of step S4.1 is as follows:
[0019] Step S4.11: Extract the timestamps and behavior types of user behaviors from historical behavior information, and construct a behavior sequence sorted by time;
[0020] Step S4.12: Based on the time-ordered behavior sequence, identify the recurring patterns in user behavior, i.e., frequent patterns, and output a set of frequent behavior patterns.
[0021] Step S4.13: Based on the temporal distribution characteristics of the behavior sequence sorted by time, and referring to the concentrated period pattern of high-frequency behavior in the frequent behavior pattern set, divide the time window and output the time window matrix;
[0022] Step S4.14: Using an association rule mining algorithm, based on the time-sorted behavior sequence and the divided time window matrix, and focusing on high-frequency behavior combinations in the frequent behavior pattern set, the association relationship between user behaviors is mined, and a set of behavior association rules is output.
[0023] Step S4.15: Transform the set of behavior association rules into a graph structure to obtain a feature association network.
[0024] Furthermore, the specific process of step S4.2 is as follows:
[0025] Step S4.21: Verify whether the connection behavior of each directed edge in the feature association network satisfies temporal ordering, filter out the association pairs that conform to the temporal order, and output the set of temporally ordered association pairs.
[0026] Step S4.22: Perform a statistical significance test on the time-ordered association pair set, calculate the Pearson correlation coefficient to measure the association strength, filter out behavior pairs with no significant statistical association, and output the set of significantly related behavior pairs;
[0027] Step S4.23: Calculate the co-occurrence frequency of each behavior pair in the significantly related behavior pair set in historical data, filter out the high-frequency co-occurrence behavior combinations, and output the high-frequency co-occurrence behavior pair set;
[0028] Step S4.24: For each subset of the high-frequency co-occurring behavior pairs, i.e., behavior pairs, analyze the time interval distribution of their occurrence, fit a probability distribution model, and calculate the average time interval and confidence interval;
[0029] Step S4.25: Combining the average time interval, confidence interval, and the temporal orderliness of the time-ordered association pair set in step S4.21, the significant correlation of the significantly related behavior pair set in step S4.22, the co-occurrence frequency in step S4.23, and the time interval distribution in step S4.24, comprehensively determine the causal probability of the behavior pair and generate candidate pairs with causal relationship.
[0030] Furthermore, the specific process of step S4.3 is as follows:
[0031] Step S4.31: Based on the normalized feature matrix, identify confounding variables that affect the causal relationship of candidate pairs; through feature importance analysis, screen out potential confounding factors related to causal and outcome variables, and output a confounding variable mapping table;
[0032] Step S4.32: For each candidate pair, construct a logistic regression model using the variables in the confounding variable mapping table as input features, train the logistic regression model to predict the probability of the user performing the causal behavior, and obtain the propensity score calculation model;
[0033] Step S4.33: Based on the propensity score calculation model, apply the matching algorithm to generate matching samples for the treatment group and the control group;
[0034] Step S4.34: Estimate the causal effect on the matched samples, calculate the difference in outcome variables between the treatment group and the control group, and obtain the average treatment effect and the individual treatment effect;
[0035] Step S4.35: Standardize the values of the average treatment effect and the individual treatment effect to output the standardized causal effect value.
[0036] Furthermore, the specific process of step S4.4 is as follows:
[0037] Step S4.41: Normalize the standardized causal effect values and output the normalized causal effect vector;
[0038] Step S4.42: Estimate the standard error and confidence interval of the normalized causal effect vector using statistical methods; convert the confidence interval width into a confidence index to form a causal relationship confidence matrix that includes causal relationships;
[0039] Step S4.43: Combine the causal confidence matrix and use a weighted average method to generate an integrated causal score vector;
[0040] Step S4.44: Transform the integrated causal scoring vector into structured knowledge and construct a causal tendency score knowledge graph;
[0041] Step S4.45: Use cross-validation to validate the causal tendency score knowledge graph and output the causal tendency score.
[0042] Furthermore, the specific process of step S2 is as follows:
[0043] Step S2.1: Perform structured parsing on the historical behavior information to extract a set of basic behavioral features;
[0044] Step S2.2: Based on the aforementioned set of basic behavioral features, construct behavioral sequence samples using the sliding window technique;
[0045] Step S2.3: Based on the behavioral sequence samples and combined with the historical behavioral information, construct multi-dimensional association features;
[0046] Step S2.4: Perform nonlinear feature transformation on the multi-dimensional correlation features to output a high-order feature set;
[0047] Step S2.5: Normalize the higher-order feature set to obtain a normalized feature matrix.
[0048] Furthermore, the specific process of step S2.5 is as follows:
[0049] Step S2.51: Use the chi-square test and mutual information method to screen out the strongly correlated features related to the target behavior in the high-order feature set;
[0050] Step S2.52: Rank the strongly correlated features based on the importance of the random forest features;
[0051] Step S2.53: Perform continuous feature scaling on the strongly correlated features, perform one-hot encoding on the categorical features, and output a normalized feature matrix; the categorical features are directly extracted from the user's historical behavior information.
[0052] Furthermore, the specific process of establishing a behavior prediction model based on the normalized feature matrix is as follows:
[0053] Step S3.11: Divide the normalized feature matrix into a training set, a validation set, and a test set;
[0054] Step S3.12: Construct a multilayer perceptron containing an input layer, a hidden layer, and an output layer;
[0055] Step S3.13: Configure the output layer of the multilayer perceptron, including classification and regression tasks;
[0056] Step S3.14: Set the loss functions for the classification task and the regression task respectively, and use the Adam optimizer and L2 regularization to optimize the multilayer perceptron to obtain the initial behavior prediction model;
[0057] Step S3.15: Train the initial behavior prediction model using the training set; optimize the hyperparameters of the initial behavior prediction model during training using random search; evaluate the initial behavior prediction model with different parameter combinations on the validation set, select the model parameter configuration with the lowest loss, and output the staged behavior prediction model; test the staged behavior prediction model using the test set to obtain the behavior prediction model.
[0058] Furthermore, the specific process of adjusting the behavior prediction model parameters through the backpropagation algorithm and optimizer, and outputting the prediction error results, is as follows:
[0059] Step S3.21: Input the normalized feature matrix of the current batch into the behavior prediction model, and process it through linear transformation and nonlinear activation function to obtain the final predicted output value of the normalized feature matrix of the current batch;
[0060] Step S3.22: Use the loss function to calculate the difference between the final predicted output value and the true label to obtain the normalized feature matrix loss value for the current batch;
[0061] Step S3.23: Based on the normalized feature matrix loss value of the current batch, apply the chain rule to back-derive layer by layer, calculate the gradient of the influence of the behavior prediction model parameters on the loss, and generate a trainable parameter gradient matrix;
[0062] Step S3.24: Update the parameters of the behavior prediction model using the Adam optimizer based on the trainable parameter gradient matrix and the preset learning rate;
[0063] Step S3.25: After each training batch, calculate and record the updated behavior prediction model parameters; when the preset training rounds are completed, use the validation set to evaluate the performance of the prediction model and select the best prediction model parameters.
[0064] Step S3.26: Based on the selected optimal prediction model parameters, calculate the final prediction error index using the test set and output the prediction error result.
[0065] Compared with existing technologies, this invention has the following advantages: By constructing a feature association network, screening causal candidate pairs, quantifying causal effects, and calculating causal tendency scores, this invention achieves in-depth mining and quantitative evaluation of the causal relationships behind user behavior. This not only helps to reveal the root causes of behavior prediction errors but also provides a clear direction for model optimization, significantly improving the model's interpretability and decision support capabilities. By combining causal tendency scores with the behavior prediction model, it is possible not only to accurately predict user behavior but also to formulate personalized optimization strategies based on causal relationships, achieving a closed loop from prediction to optimization and effectively improving the effect of user behavior guidance. Attached Figure Description
[0066] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0067] like Figure 1 As shown, the present invention provides a technical solution: a user behavior prediction method based on causal tendency scores, comprising the following steps:
[0068] Step S1: Collect users' historical behavior information from the historical database.
[0069] The historical database stores a wealth of user behavior data, and the collection process must adhere to the principles of comprehensiveness, accuracy, and completeness. Specifically, the collected data covers the following categories: Basic attribute information: This includes static characteristics such as the user's age, gender, region, occupation, education level, registration time, and account level. This information forms the basis for understanding the user's basic background. Interaction behavior information: This records various user interactions on the platform, such as browsing history (including page URLs, dwell time, and access order), click behavior (the location and content of clicked buttons, links, advertisements, etc.), search behavior (search keywords, search frequency, and search time), and comments and feedback (comment content, ratings, and feedback opinions). Transaction behavior information: For platforms involving transactions, user purchase behavior data needs to be collected, such as the name, specifications, price, purchase time, quantity, payment method, delivery address, and return records of purchased goods or services. In addition, it includes auxiliary information related to transactions, such as shopping cart information and coupon usage. Social behavior information: If the platform has social functions, it needs to collect users' social interaction data, such as the content and recipients of their follows, likes, shares, and forwards, the content of private messages, and participation in social groups.
[0070] During the data collection process, the system first performs precise location and data filtering in the historical database based on the user's unique identifier (such as user ID, device ID, etc.). Then, using database queries or data interfaces, it extracts all relevant user behavior data within a specific timeframe (such as the last 3 months, 6 months, or 1 year) in chronological order. Simultaneously, the collected data undergoes preliminary cleaning to remove duplicate data, abnormal data (such as data with obviously illogical browsing times that are too short or too long), and records with too many missing values, ensuring the data quality for subsequent processing.
[0071] Step S2: Extract behavioral features from historical behavioral information, normalize the extracted behavioral features, and output a normalized feature matrix.
[0072] The specific process of step S2 is as follows:
[0073] Step S2.1: Perform structured parsing on the historical behavior information to extract a set of basic behavior features.
[0074] The extracted basic behavioral feature set includes: behavioral type features: mapping user operations to standardized behavioral type codes (such as click=001, purchase=010, etc. binary identifiers); interactive object features: vectorizing entity identifiers such as product ID and page URL (one-hot encoding / embedded vector); and time series features: extracting timestamps, time differences between adjacent behaviors, and behavior frequency statistically analyzed by period.
[0075] Step S2.2: Based on the set of basic behavioral features, construct behavioral sequence samples using the sliding window technique.
[0076] Step S2.3: Based on the behavioral sequence samples and the historical behavioral information, construct multi-dimensional association features.
[0077] Step S2.4: Perform nonlinear feature transformation on the multi-dimensional associated features to output a high-order feature set.
[0078] Step S2.5: Normalize the higher-order feature set to obtain a normalized feature matrix.
[0079] The specific process of step S2.5 is as follows:
[0080] Step S2.51: Use the chi-square test and mutual information method to screen out the highly correlated features in the set of high-order features that are strongly correlated with the target behavior; highly correlated features refer to high-order features that are screened out through statistical tests and feature importance assessments and have a significant association with the target behavior (such as whether the user makes a purchase, clicks, etc.).
[0081] Step S2.52: Rank the strongly correlated features based on the importance of the random forest features.
[0082] Step S2.53: Use Z-score to continuously scale the strongly correlated features, perform one-hot encoding on the categorical features, and output a normalized feature matrix.
[0083] Methods for obtaining categorical features typically include:
[0084] Defined category features can be directly extracted from users' historical behavior information, such as product category codes, page section IDs, and operating terminal types. These features are usually in the form of string or integer labels.
[0085] User historical behavior information is transformed into category features according to pre-defined rules; for example, the sequence "clicking on product details page → adding to cart → successful payment" is mapped to a "conversion funnel stage." The conversion funnel stage is a path decomposition of users from initial behavior to target behavior, used to quantitatively analyze conversion efficiency in key processes. The continuous sequence of user behavior is divided into several key node stages, each representing a necessary step for the user to move towards the final goal (such as successful payment). Stage division must meet the following requirements: the next stage can only be triggered after the previous stage is completed (e.g., "adding to cart" must precede "payment"), each stage must have clear behavior log markers (such as button click events, API calls), and each stage corresponds to core business metrics (such as details page UV → add-to-cart rate → payment rate).
[0086] Step S3: Based on the normalized feature matrix, establish a behavior prediction model; adjust the parameters of the behavior prediction model through the backpropagation algorithm and optimizer, and output the prediction error results.
[0087] The specific process of establishing a behavior prediction model based on the normalized feature matrix is as follows:
[0088] Step S3.11: Divide the normalized feature matrix into training, validation, and test sets; specifically, divide the normalized feature matrix into training, validation, and test sets in an 8:1:1 ratio. The training set is used for model learning, the validation set is used for hyperparameter tuning, and the test set is used for final evaluation. Maintain a consistent distribution of samples across all categories during the partitioning process to ensure data independence.
[0089] Step S3.12: Construct a multilayer perceptron containing an input layer, hidden layers, and an output layer. The number of neurons in the input layer is the same as the feature dimension, and the number of neurons in the output layer is determined according to the prediction task (e.g., 1 neuron for binary classification, the number of classes for multi-class classification). Set 2-3 hidden layers, with the number of neurons in each layer decreasing in a pyramid shape (e.g., 128→64→32). Use the ReLU activation function. The output layer uses either the Sigmoid function (for binary classification) or the Softmax function (for multi-class classification).
[0090] Step S3.13: Configure the output layer of the multilayer perceptron, including classification and regression tasks.
[0091] Step S3.14: Set the loss functions for the classification and regression tasks respectively, and use the Adam optimizer and L2 regularization to optimize the multilayer perceptron to obtain the initial behavior prediction model; set the learning rate of the Adam optimizer to 0.001, and use an early stopping strategy to prevent overfitting. The early stopping threshold is set to the validation set loss not decreasing for 10 consecutive rounds.
[0092] Step S3.15: Train the initial behavior prediction model using the training set; optimize the hyperparameters of the initial behavior prediction model during training using random search; evaluate the initial behavior prediction model with different parameter combinations on the validation set, select the model parameter configuration with the lowest loss, and output the staged behavior prediction model; test the staged behavior prediction model using the test set to obtain the behavior prediction model.
[0093] The specific process of adjusting the parameters of the behavior prediction model through the backpropagation algorithm and optimizer, and outputting the prediction error results, is as follows:
[0094] Step S3.21: Input the normalized feature matrix of the current batch into the behavior prediction model, and process it through linear transformation and nonlinear activation function to obtain the final predicted output value of the normalized feature matrix of the current batch.
[0095] Step S3.22: Use the loss function to calculate the difference between the final predicted output value and the true label to obtain the normalized feature matrix loss value for the current batch.
[0096] Step S3.23: Based on the loss value of the normalized feature matrix of the current batch, apply the chain rule to deduce layer by layer in reverse, calculate the gradient of the influence of the behavior prediction model parameters on the loss, and generate a trainable parameter gradient matrix.
[0097] Step S3.24: Update the parameters of the behavior prediction model using the Adam optimizer based on the trainable parameter gradient matrix and the preset learning rate.
[0098] Step S3.25: After each training batch, calculate and record the updated behavior prediction model parameters; when the preset training rounds are completed, use the validation set to evaluate the performance of the prediction model and select the best prediction model parameters (this process is based on the comprehensive performance after multiple training batches and can be indirectly related to the loss optimization effect of each batch).
[0099] Step S3.26: Based on the selected optimal prediction model parameters, calculate the final prediction error index using the test set and output the prediction error result.
[0100] Step S4: Based on the historical behavior information, analyze the causal relationship between the behavioral characteristics and calculate the causal tendency score.
[0101] The specific process of step S4 is as follows:
[0102] Step S4.1: Based on historical behavioral information, analyze the specific manifestations and timing of each corresponding behavioral feature, map the behavioral features with temporal sequence and logical correlation to nodes, and construct a feature association network. For example, if a user's "browse product details" behavior often precedes the "add to cart" behavior, then establish a directed edge connection between these two feature nodes in the network to form a topology that reflects the potential associations between features.
[0103] Step S4.2: Based on the feature association network and according to the basic principles of causal inference, candidate pairs with causal relationships are selected from all node pairs of behavioral features. By statistically analyzing the co-occurrence frequency and time interval distribution of feature pairs in historical data, feature combinations that only have a correlation but no temporal sequence can be excluded. For example, if "clicking on a promotional ad" and "placing an order" show a cause-and-effect temporal sequence in 80% of cases, they are listed as candidate causal pairs.
[0104] The basic principles of causal inference include: time priority, statistical correlation, and exclusion of confounding factors. Time priority means that the cause must precede the effect, which is the basis for eliminating spurious correlations. Statistical correlation means that the cause and effect must have a significant co-occurrence or statistical dependence, such as high co-occurrence frequency or correlation tests. Excluding confounding factors means that the observed association cannot be explained by other confounding variables, and confounding factors need to be controlled or adjusted, such as user preferences or promotional intensity.
[0105] Step S4.3: Employ a causal inference algorithm to quantify the causal relationship strength of the candidate pairs, obtaining standardized causal effect values. By controlling for the influence of other confounding variables, calculate the difference between the conditional probability of the outcome feature occurring when the causal feature occurs and the probability under non-causal feature conditions. For example, use a propensity score model to estimate the influence of the causal feature "user favorites items" on the outcome feature "final purchase," obtaining standardized causal effect values.
[0106] Step S4.4: Convert the standardized causal effect values into causal propensity scores within the [0,1] interval. Higher scores indicate a more significant causal influence of the causal feature on the outcome feature. Simultaneously, label each causal pair with its directionality (e.g., the causal direction of A→B) and confidence level, forming structured data containing the causal relationships of the features and their corresponding scores. For example, the causal propensity score for "Browse Details → Add to Cart" is 0.78 with a confidence level of 92%, serving as the basis for subsequent model error analysis.
[0107] The specific process of step S4.1 is as follows:
[0108] Step S4.11: Extract the timestamps and behavior types of user behaviors from historical behavior information to construct a behavior sequence ordered by time. Identify key attributes of behavioral events (such as user ID, behavior type, and behavior object) to form a structured time-series dataset, providing a foundation for subsequent time-series analysis.
[0109] Step S4.12: Based on the time-ordered behavior sequence, identify the recurring patterns (frequent patterns) in user behavior and output a set of frequent behavior patterns.
[0110] Step S4.13: Based on the temporal distribution characteristics of the behavior sequence sorted by time, and referring to the concentrated period pattern of high-frequency behavior in the set of frequent behavior patterns (such as a certain type of frequent pattern often erupting in a fixed period), divide the time window (for example, adjust the window size or start and end points for the concentrated period of high-frequency patterns) and output the time window matrix; to facilitate subsequent time series correlation analysis.
[0111] Step S4.14: Use association rule mining algorithms (such as the Apriori algorithm) to mine the association relationships between user behaviors based on time-sorted behavior sequences and pre-divided time window matrices, and focus on high-frequency behavior combinations in the set of frequent behavior patterns, and output a set of behavior association rules; for example, the rule "Browse details ∧ View comments → Add to cart".
[0112] Step S4.15: Transform the set of behavior association rules into a graph structure to obtain a feature association network; specifically, use the behavior types in the set of association rules as nodes and the association rules in the set of association rules as directed edges to obtain the feature association network.
[0113] The specific process of step S4.2 is as follows:
[0114] Step S4.21: Verify whether the connection behavior of each directed edge in the feature association network satisfies temporal order (cause behavior occurs before result behavior), filter out association pairs that meet the temporal order (action pairs where the cause behavior occurs strictly earlier than the result behavior), and output the set of temporally ordered association pairs.
[0115] Step S4.22: Perform statistical significance tests (such as hypothesis testing) on the time-ordered association pair set, calculate the Pearson correlation coefficient to measure the association strength, filter out behavior pairs with no significant statistical association, and output the set of significantly related behavior pairs.
[0116] Step S4.23: Calculate the co-occurrence frequency of each behavior pair in the significantly related behavior pair set in historical data, filter out the high-frequency co-occurrence behavior combinations (i.e. behavior pairs that often appear together and have stable associations), and output the high-frequency co-occurrence behavior pair set.
[0117] Step S4.24: For each subset (behavior pair) in the set of high-frequency co-occurring behavior pairs, analyze the distribution of their occurrence time intervals, fit a probability distribution model (such as exponential distribution, normal distribution, etc.), and calculate the average time interval and confidence interval.
[0118] Step S4.25: Combining the average time interval, confidence interval, and the temporal orderliness of the time-ordered association pair set in step S4.21, the significant correlation of the significantly related behavior pair set in step S4.22, the co-occurrence frequency in step S4.23, and the time interval distribution in step S4.24, comprehensively determine the causal probability of the behavior pair and generate candidate pairs with causal relationship.
[0119] The specific process of step S4.3 is as follows:
[0120] Step S4.31: Based on the normalized feature matrix, identify confounding variables that may affect the causal relationship of candidate pairs; through feature importance analysis (such as random forest importance score), screen out potential confounding factors that are significantly related to both causal and outcome variables, and output a confounding variable mapping table (including variable name, importance score, and correlation direction).
[0121] Among them, causal variables and outcome variables are the core elements that constitute a causal relationship.
[0122] Step S4.32: For each candidate pair, construct a logistic regression model using the variables in the confounding variable mapping table as input features, train the logistic regression model to predict the probability of the user performing the causal behavior, and obtain the propensity score calculation model.
[0123] Step S4.33: Based on the propensity score calculation model, apply a matching algorithm (such as nearest neighbor matching, kernel matching) to generate matching samples for the processing group (users who performed the causal behavior) and the control group (users who did not perform but had similar propensity scores).
[0124] Step S4.34: Estimate the causal effect on the matched sample, calculate the difference in outcome variables between the treatment group and the control group, and obtain the average treatment effect and the individual treatment effect.
[0125] Step S4.35: Standardize the values of the average treatment effect and the individual treatment effect to eliminate the influence of dimensions and output the standardized causal effect value.
[0126] The specific process of step S4.4 is as follows:
[0127] Step S4.41: Normalize the standardized causal effect values using the Z-score, mapping them to the [0,1] interval, and output the normalized causal effect vector; represented as:
[0128] ;
[0129] ;
[0130] In the formula, This represents the standardized causal effect value; express The score; This represents the mean of the standardized causal effect values; This represents the mean difference of standardized causal effect values; This represents the normalized causal effect vector of the output; express The maximum value in; express The minimum value in.
[0131] Step S4.42: Estimate the standard error and confidence interval of the normalized causal effect vector using statistical methods; convert the confidence interval width into a confidence index to form a causal relationship confidence matrix that includes causal relationships.
[0132] The confidence interval can be calculated as follows:
[0133] ;
[0134] In the formula, This represents the confidence interval of the normalized causal effect vector; This represents the original estimate of the normalized causal effect vector; The standard error of the original estimate of the normalized causal effect vector; This represents the critical value of the 95% confidence interval under a standard normal distribution.
[0135] The confidence interval width can be converted into a confidence index, which can be expressed as:
[0136] ;
[0137] In the formula, Indicates the confidence level index; Represents an exponential function; Indicates the adjustment parameter; This indicates the width of the confidence interval.
[0138] Step S4.43: Combine the causal confidence matrix and use a weighted average method to generate an integrated causal score vector.
[0139] The causal confidence matrix C is represented as follows: , This indicates the first confidence level indicator. This indicates the second confidence level. This represents the nth confidence index, where each element in the causal confidence matrix C corresponds to the reliability of a causal pair.
[0140] Calculate the integrated score for each causal pair. :
[0141] ;
[0142] right Normalization is performed to ensure that the final score is in the [0,1] interval, resulting in the integrated causal score vector F.
[0143] Step S4.44: Transform the integrated causal scoring vector into structured knowledge and construct a causal tendency score knowledge graph.
[0144] Step S4.45: Use cross-validation to validate the causal tendency score knowledge graph and output the causal tendency score.
[0145] Step S5: Analyze the reasons for the prediction error results of the behavior prediction model based on the causal tendency score; when some causal relationships are not captured by the behavior prediction model, adjust the corresponding behavioral features; update the behavior prediction model based on the adjusted behavioral features to obtain the optimized behavior prediction model.
[0146] Specifically, SHAP values or LIME are used to interpret the dependence of the behavior prediction model on causal variables, identifying causal paths that have not been adequately learned. If certain causal variables are found to have a significant impact but are not covered by the original behavioral features, derived features (such as "operation interval time entropy") are introduced through feature engineering. For user groups with high propensity scores but low prediction accuracy, targeted transfer learning or adversarial training is used to improve the robustness of the behavior prediction model.
[0147] Causal variables are variables that may influence the outcome, typically interventions or behavioral characteristics, including user behavior and system interventions. User behavior includes clicking on promotional ads, browsing product detail pages, and adding items to the shopping cart. System interventions include sending promotional text messages and issuing coupons.
[0148] Step S6: Use the optimized behavior prediction model to predict user behavior and formulate optimization strategies based on the causal relationships revealed by the causal tendency score.
[0149] For users with high propensity scores (e.g., those "susceptible to promotions"), develop precise marketing strategies (e.g., optimizing coupon distribution timing). For users with broken causal paths (e.g., "highly active but low-conversion"), validate intervention effects through A / B testing (e.g., adjusting recommendation algorithm weights). Predict user lifetime value (LTV) using causal effect decomposition (e.g., Do-Calculus) and prioritize resource allocation to high-potential users. Feedback the results of optimized strategy execution (e.g., user response rate) to step S1 in real time, forming a closed loop of "data collection → causal analysis → strategy iteration".
[0150] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A user behavior prediction method based on causal tendency scores, characterized in that, include: Step S1: Collect users' historical behavior information from the historical database; The collected data covers the following categories: Transaction behavior information: For platforms involving transactions, user purchase behavior data is collected, including the name, specifications, price, purchase time, quantity, payment method, delivery address, return records, shopping cart information, and coupon usage of the purchased goods or services; Step S2: Extract behavioral features from historical behavioral information, normalize the extracted behavioral features, and output a normalized feature matrix; Step S3: Based on the normalized feature matrix, establish a behavior prediction model; adjust the parameters of the behavior prediction model through the backpropagation algorithm and optimizer, and output the prediction error results; Step S4: Based on the historical behavior information, analyze the causal relationship between the behavioral characteristics and calculate the causal tendency score; Step S5: Analyze the reasons for the prediction error results produced by the behavior prediction model based on the causal tendency score; when some causal relationships are not captured by the behavior prediction model, adjust the corresponding behavioral features. The behavior prediction model is updated based on the adjusted behavior characteristics to obtain an optimized behavior prediction model. Step S6: Use the optimized behavior prediction model to predict user behavior and formulate optimization strategies based on the causal relationships revealed by the causal tendency scores; The specific process of step S2 is as follows: Step S2.1: Perform structured parsing on the historical behavior information to extract a set of basic behavioral features; Step S2.2: Based on the aforementioned set of basic behavioral features, construct behavioral sequence samples using the sliding window technique; Step S2.3: Based on the behavioral sequence samples and combined with the historical behavioral information, construct multi-dimensional association features; Step S2.4: Perform nonlinear feature transformation on the multi-dimensional correlation features to output a high-order feature set; Step S2.5: Normalize the higher-order feature set to obtain a normalized feature matrix; The specific process of step S2.5 is as follows: Step S2.51: Use the chi-square test and mutual information method to screen out the strongly correlated features related to the target behavior in the high-order feature set; Step S2.52: Rank the strongly correlated features based on the importance of the random forest features; Step S2.53: Perform continuous feature scaling on the strongly correlated features, perform one-hot encoding on the categorical features, and output a normalized feature matrix; The methods for obtaining category features include: directly extracting defined category features from users' historical behavior information, such as product category codes, page section IDs, and operating terminal types. These features exist in the form of string or integer labels. Users' historical behavior information is then converted into category features according to pre-defined rules. Specifically, the sequence "clicking on product details page → adding to cart → successful payment" is mapped to a "conversion funnel stage." The conversion funnel stage is a path decomposition of the user from initial behavior to target behavior, used to quantitatively analyze conversion efficiency in key processes. The continuous sequence of user behavior is divided into several key node stages, each stage representing the steps the user takes towards the final goal, successful payment. Each stage must have clear behavior log markers. The specific process of step S4 is as follows: Step S4.1: Based on historical behavioral information, sort out the specific manifestations and occurrence sequence of each corresponding behavioral feature, map the behavioral features with temporal sequence and logical relationship to nodes, and construct a feature association network; Step S4.2: Based on the feature association network and in accordance with the basic principles of causal inference, candidate pairs with causal relationships are selected from all node pairs of behavioral features; Step S4.3: Use a causal inference algorithm to quantify the causal relationship strength of the candidate pairs to obtain standardized causal effect values; Step S4.4: Convert the standardized causal effect values into causal tendency scores within a set interval; The specific process of step S6 is as follows: For users with high propensity scores, formulate precise marketing strategies; for users with broken causal paths, verify the intervention effect through A / B testing; combine causal effect decomposition to predict user lifetime value and prioritize resource allocation to high-potential users; and feed back the optimization strategy execution results, i.e., user response rate, to step S1 in real time.
2. The user behavior prediction method based on causal tendency score according to claim 1, characterized in that: The specific process of step S4.1 is as follows: Step S4.11: Extract the timestamps and behavior types of user behaviors from historical behavior information, and construct a behavior sequence sorted by time; Step S4.12: Based on the time-ordered behavior sequence, identify the recurring patterns in user behavior, i.e., frequent patterns, and output a set of frequent behavior patterns. Step S4.13: Based on the temporal distribution characteristics of the behavior sequence sorted by time, and referring to the concentrated period pattern of high-frequency behavior in the frequent behavior pattern set, divide the time window and output the time window matrix; Step S4.14: Using an association rule mining algorithm, based on the time-sorted behavior sequence and the divided time window matrix, and focusing on high-frequency behavior combinations in the frequent behavior pattern set, the association relationship between user behaviors is mined, and a set of behavior association rules is output. Step S4.15: Transform the set of behavior association rules into a graph structure. The feature association network is obtained.
3. The user behavior prediction method based on causal tendency score according to claim 2, characterized in that: The specific process of step S4.2 is as follows: Step S4.21: Verify whether the connection behavior of each directed edge in the feature association network satisfies temporal ordering, filter out the association pairs that conform to the temporal order, and output the set of temporally ordered association pairs. Step S4.22: Perform a statistical significance test on the time-ordered association pair set, calculate the Pearson correlation coefficient to measure the association strength, filter out behavior pairs with no significant statistical association, and output the set of significantly related behavior pairs; Step S4.23: Calculate the co-occurrence frequency of each behavior pair in the significantly related behavior pair set in historical data, filter out the high-frequency co-occurrence behavior combinations, and output the high-frequency co-occurrence behavior pair set; Step S4.24: For each subset of the high-frequency co-occurring behavior pairs, i.e., behavior pairs, analyze the time interval distribution of their occurrence, fit a probability distribution model, and calculate the average time interval and confidence interval; Step S4.25: Combining the average time interval, confidence interval, and the temporal orderliness of the time-ordered association pair set in step S4.21, the significant correlation of the significantly related behavior pair set in step S4.22, the co-occurrence frequency in step S4.23, and the time interval distribution in step S4.24, comprehensively determine the causal probability of the behavior pair and generate candidate pairs with causal relationship.
4. The user behavior prediction method based on causal tendency score according to claim 3, characterized in that: The specific process of step S4.3 is as follows: Step S4.31: Based on the normalized feature matrix, identify confounding variables that affect the causal relationship of candidate pairs; through feature importance analysis, screen out potential confounding factors related to causal and outcome variables, and output a confounding variable mapping table; Step S4.32: For each candidate pair, construct a logistic regression model using the variables in the confounding variable mapping table as input features, train the logistic regression model to predict the probability of the user performing the causal behavior, and obtain the propensity score calculation model; Step S4.33: Based on the propensity score calculation model, apply the matching algorithm to generate matching samples for the treatment group and the control group; Step S4.34: Estimate the causal effect on the matched samples, calculate the difference in outcome variables between the treatment group and the control group, and obtain the average treatment effect and the individual treatment effect; Step S4.35: Standardize the values of the average treatment effect and the individual treatment effect to output the standardized causal effect value.
5. The user behavior prediction method based on causal tendency score according to claim 4, characterized in that: The specific process of step S4.4 is as follows: Step S4.41: Normalize the standardized causal effect values and output the normalized causal effect vector; Step S4.42: Estimate the standard error and confidence interval of the normalized causal effect vector using statistical methods; convert the confidence interval width into a confidence index to form a causal relationship confidence matrix that includes causal relationships; Step S4.43: Combine the causal confidence matrix and use a weighted average method to generate an integrated causal score vector; Step S4.44: Transform the integrated causal scoring vector into structured knowledge and construct a causal tendency score knowledge graph; Step S4.45: Use cross-validation to validate the causal tendency score knowledge graph and output the causal tendency score.
6. The user behavior prediction method based on causal tendency score according to claim 5, characterized in that: The specific process of establishing a behavior prediction model based on the normalized feature matrix is as follows: Step S3.11: Divide the normalized feature matrix into a training set, a validation set, and a test set; Step S3.12: Construct a multilayer perceptron containing an input layer, a hidden layer, and an output layer; Step S3.13: Configure the output layer of the multilayer perceptron, including classification and regression tasks; Step S3.14: Set the loss functions for the classification task and the regression task respectively, and use the Adam optimizer and L2 regularization to optimize the multilayer perceptron to obtain the initial behavior prediction model; Step S3.15: Train the initial behavior prediction model using the training set; optimize the hyperparameters of the initial behavior prediction model during training using random search; evaluate the initial behavior prediction model with different parameter combinations on the validation set, select the model parameter configuration with the lowest loss, and output the staged behavior prediction model; test the staged behavior prediction model using the test set to obtain the behavior prediction model.
7. The user behavior prediction method based on causal tendency score according to claim 6, characterized in that: The specific process of adjusting the parameters of the behavior prediction model and outputting the prediction error results through the backpropagation algorithm and optimizer is as follows: Step S3.21: Input the normalized feature matrix of the current batch into the behavior prediction model, and process it through linear transformation and nonlinear activation function to obtain the final predicted output value of the normalized feature matrix of the current batch; Step S3.22: Use the loss function to calculate the difference between the final predicted output value and the true label to obtain the normalized feature matrix loss value for the current batch; Step S3.23: Based on the normalized feature matrix loss value of the current batch, apply the chain rule to back-derive layer by layer, calculate the gradient of the influence of the behavior prediction model parameters on the loss, and generate a trainable parameter gradient matrix; Step S3.24: Update the parameters of the behavior prediction model using the Adam optimizer based on the trainable parameter gradient matrix and the preset learning rate; Step S3.25: After each training batch, calculate and record the updated behavior prediction model parameters; when the preset training rounds are completed, use the validation set to evaluate the performance of the prediction model and select the best prediction model parameters. Step S3.26: Based on the selected optimal prediction model parameters, calculate the final prediction error index using the test set and output the prediction error result.
Citation Information
Patent Citations
Causal inference-based online shopping behavior analysis method and system
CN110245984A
Learning effect optimization method based on user behavior causal relationship in MOOC log data
CN111723973A