# Accurate Digital Marketing Communication Based on Intelligent Data Analysis

Authors: ZhuoJun Li
Journal: Scientific Programming
 (2022)

---

## Abstract

In digital marketing, the core advantages of scientific and technological means such as artificial intelligence and big data analysis gradually appear and pay attention to them. This paper studies the accuracy of digital marketing and proposes an intelligent algorithm based on data analysis, which improves the effect of marketing communication. Through the combination of intelligent algorithms and big data analysis, the data are convincing. Through the comparison and improvement of intelligent algorithm logistic regression and XGBoost, this paper puts forward an improved algorithm of XGBoost based on Bayesian optimization parameters, which can improve the efficiency of digital marketing communication and enhance the social influence of digital marketing.


---

## Body

## 1. Introduction

In recent years, the purchasing power of the former Millennium baby has gradually appeared in the market. Major businesses are also actively formulating marketing strategies. At present, major Internet platforms are also competing for this market cake and actively applying digital marketing communication strategies to influence the purchasing behavior of this generation and actively communicate with consumers through digital media interactions such as short videos and social media [1]. By adding chat robots and introducing platform intelligent algorithms, each platform actively communicates with target consumers, designs the company’s marketing strategy, and collects and analyzes data with consumers before and after purchase to assist the platform to formulate reasonable and effective digital marketing plans and assist decision-making and support [2].The research on digital marketing has been gradually deepened. Some researchers have incorporated consumer identity into purchase decision support, created consumer demand unconsciously through social platforms, and formed the intervention of social psychological mechanism, which can tap the potential consumption of consumers and provide targeted sales suggestions for manufacturers [3].In the process of digital marketing, integrating computer and communication technology, innovatively adopting digital tools, carrying out interactive digital marketing research, and providing market decision support for manufacturers through data-driven marketing are a new direction of future development [4].In the industrial market, some studies put forward the method of evaluating the marketing performance of industrial enterprises through correlation analysis, optimizing the communication efficiency by using digital marketing, and increasing the sales opportunities in the industrial market through statistical analysis of data [5].In the process of brand marketing communication, through artificial intelligence algorithm, a large number of data are collected based on consumers’ personal emotions, and the empathy mechanism in the network environment is to build a communication bridge between consumers and producers and improve brand communication awareness through consumer emotion subdivision. [6] In the development process of digital marketing, artificial intelligence, and big data technology, it is the development trend of digital marketing to effectively evaluate the marketing effect and customize the marketing for you. Compared with the traditional mode, digital marketing embodies high efficiency, measurability, and flexibility [7].With the prevalence of digitalization, combined with AI algorithm analysis and big data environment, the strategic decision-making of enterprises can be enhanced, and the risks and opportunities of business operations can be discovered early. Through structural equation technology modeling of the questionnaire survey, it is found that big data and AI algorithm have a positive impact on the marketing activities of digital marketing [8].Network marketing and digital marketing complement each other in modern enterprise marketing, and the current fashion market is gradually migrating from offline to online, establishing corporate brand image online and offline [9]. In the digital marketing environment, this paper combines the common artificial intelligence algorithm logistic regression algorithm and XGBoost algorithm to improve and proposes Bayesian optimization algorithm to improve the parameter optimization process of XGBoost algorithm.


## 2. Digital Marketing Communication Mode

Marketing model [10] has experienced three historical times, namely, traditional marketing model, network marketing model, and digital marketing model. Fundamentally speaking, the three marketing methods are distinguished based on route, category, and methodology. The changes in each stage are brought about by the changes in consumers’ shopping technology and the results of scientific and technological progress.Digital marketing is a combination of computer, communication, digital multimedia, and other technologies to achieve the purpose of traditional marketing, and its essence is a marketing method derived from traditional marketing methods or replaced by tools [11]. The pursuit of digital marketing is to effectively extract the target customer information from the massive data information and to maximize the use of computer technology to efficiently open up the market and tap the needs of consumers to meet the needs. Digital marketing through marketing matrix [12]: using popular interactive digital multimedia means, such as Douyin short video, Aauto Quicker, Weibo, forum, WeChat circle of friends, select effective targets in the database for targeted marketing to achieve a high conversion rate. Digital marketing acts as a bridge, reduces marketing costs, and embodies customized, targeted, and efficient communication. Through the multichannel cooperation of digital marketing communication, it can effectively interact with consumers, improve the communication efficiency between consumers and manufacturers, and enhance the digital transformation of enterprises. The specific marketing system model is shown in Figure 1.Figure 1
Marketing system model.A product is alive, and this problem should be fully considered in the process of digital marketing. From entering the market, a product will enter the market from 0 blank (opening period, introduction period) to 1 market recognition (growth period, maturity period), and to 0 exit from the market (recession period). This life cycle mainly includes four stages. Marketing strategies and algorithms are combined with the life cycle of different products, so as to enhance the activity of products in the life cycle and, at the same time, make consumers resonate and have a high sense of identity with products. The following is a comparison of product life cycle and product sales curve, as shown in Figure2.Figure 2
Product life cycle and product sales curve.


## 3. Intelligent Algorithm

By understanding the needs of consumers, Peter Drucker, a famous management guru, pointed out that the ultimate goal of marketing is to gain business insight and understand users’ needs. With the development of artificial intelligence and big data technology [13], enterprises can understand the actual needs of users, improve the service quality of enterprises, and establish the brand image of enterprises through technical means. Through big data technology, we analyze the consumption and purchase behavior of each user, compile the “portrait” of users, distinguish customers, and provide differentiated and valuable targeted services [14]. For example, Xiao Li bought a pair of running shoes online, and his purchase records were recorded in the database. Then, he would push all kinds of socks, sportswear, running-related items, and fitness knowledge for Xiao Li. Through the data recorded by users’ daily online consumption, purchase, and browsing, combined with artificial intelligence algorithms and other technologies, the consumption logic of consumers’ purchase behavior is excavated, which provides decision-making basis for digital marketing and promotes market transactions. [15] The daily behavior data of users through technical means are analyzed, predicted the future behavior consumption path, gradually enriched the “portraits” of characters, spread the company’s cultural values, aroused consumers’ recognition, improved marketing efficiency, and achieved marketing effects. Figure 3 shows a digital marketing feedback training model for consumer demand, forming a closed-loop effect of interactive feedback.Figure 3
Consumer demand feedback training.Mobile Internet makes digital marketing grow rapidly. The massive data generated by major Internet platforms every day are the real content of public actual participation. Enterprises are closely concerned about making good use of the data of major Internet platforms and carrying out targeted marketing communication. Nowadays, short videos and online dramas are very popular with the younger generation [16], and most of these videos are entertaining. By recording users’ usage habits and combining with corresponding artificial intelligence algorithms, the platform makes targeted recommendations to target customers, creating fan product economy, achieving accurate marketing, and realizing traffic realization while harvesting large traffic [17]. In order to achieve accurate marketing, decision-making will be more and more based on data and analysis, and enterprises will optimize their operations based on data analysis [18]. The essence of machine learning is to count and find similar data with certain statistical laws, and its goal is to find an optimized model from the regular data space [19]. The framework of digital marketing design by machine learning algorithm is shown in Figure 4. Evaluation criteria and marketing communication performance are important basis for measuring the quality of a model. Combined with specific needs, the evaluation indicators and communication performance reference parameters suitable for this problem are selected. Intelligent algorithm can improve the accuracy of digital marketing, improve personalization and recommendation system, optimize paid advertising, optimize the time and channel of marketing promotion, improve the automation of marketing process, and understand and predict user behavior, etc.Figure 4
Machine learning metrics framework.In this paper, several classification algorithms which are relatively frequently used in real life are selected, and the optimal combination method suitable for digital marketing is found by modeling, comparative analysis, and comparison results, and quantitative and qualitative indicators are distinguished [20]. The selection algorithm and improved algorithm are introduced below.


### 3.1. Multivariate Logistic Regression

This paper is based on the classification of digital marketing user categories. If there are N categories, they can be expressed as {1, 2, ...,k}. Suppose the dataset D=xi,yii=1n=1, xi=1,xi1,…,xipT∈Rp+1; yi∈1,…,k, i = 1, ..., n.The binary logistic regression [21] model assumes that the logarithm of the ratio of posterior probabilities belonging to two categories 0 and 1 is linear, as shown by the following formula:(1)logPry=1|xPry=0|x=βTx.By the logic of the above formula, the logistic regression model can also be called the logarithmic probability model [22]. It is a model with Class 0 as the base class. By analogy, extending to multiple classes, and setting class K as the base class, the logarithmic probability of K−1 is also as follows:(2)logPry=1|xPry=1|xy=K|x=β1Tx,logPry=2|xPry=K|x=β2Tx,…logPry=K−1|xPry=K|x=βK−1Tx,where β1,β2,…,βK−1∈Rp+1.(3)Pry=1|x=eβ1TxPry=K|x,Pry=2|x=eβ2TxPry=K|x,…Pry=K−1|x=eβK−1TxPry=K|x.Formulas (4) and (5) are derived from formula (3) as follows:(4)∑K=1KPry=K|x=1,(5)plx,β=Pry=l|x=expβlTx∑j=1KexpβjTx.From the above derivation, we can know that logarithmic probability can be reflected by the prediction results of the linear regression model in multivariate logistic regression. This model is called “logarithmic probability regression,” also known as logistic regression [23], and the logistic regression function will not be affected by wrong assumptions, so data modeling can be carried out directly.


### 3.2. XGBoost

XGBoost algorithm [24], whose full name is the limit gradient lifting algorithm, is an improved learning algorithm of the decision tree. It was proposed by Dr. Chen Tianqi of Washington University in 2014. This algorithm has excellent ability and is widely used in industry, medicine, aviation, economy, and other fields. The algorithm is characterized by parallel computing, giving full play to the advantages of CPU multithreading, and improving the efficiency of data propagation through the improved algorithm.Givenn data samples D=xI,yiD=n,Xi∈Rm,yi∈R, with m characteristic attributes, the additive model is used to predict the output.(6)yi^=∑k=1Kfkxi,fk∈ℱ,where the regression tree space is represented by F=fx=wqxq:Rm⟶T,w∈RT which represents all trees, and the structure of each tree is denoted by Q, and the total number of leaves on the tree is denoted by T. Each learner fk corresponds to an independent tree structure q and leaf weight w, and it is determined whether the selection algorithm parameters are the best effect [25] by using an objective function defined as follows:(7)Objθ=∑i=1nlyi,yi^+∑i=1nΩfk.As can be seen from the above formula, it contains two parts. The left part of the plus sign is the loss functionΩf=γT+1/2λw2, also known as the differentiable loss function, and it is used to measure the difference between the predicted value yi^ and actual value yi. This result is also called training error. The right part of the plus sign is represented as a regular term, which punishes the weight of leaf nodes and achieves the purpose of optimizing the objective function through addition training [26] to avoid the influence of overfitting.Incorporating the predicted valueyi^t into the following formula minimizes the loss function:(8)ℒt=∑i=1nlyi,yi^t−1++fixi+Ωfi.Put the loss term atyi^t−1 [27], as shown in the following formula:(9)ℒt=∑i=1nlyi,yi^t−1++gifixi+12hifi2xi+Ωfi.Heregi=∂yi^t−1lyi,yi^t−1,hi=∂yi^t−12lyi,yi^t−1 are the first and second partial derivatives of the loss function L, respectively [28]. The constant term is removed and changed it to the following formula:(10)ℒt=∑i=1ngifixi+12hifi2xi+Ωfi.Through the function defined above, the regularization term is defined as(11)Ωf=γT+12λ∑j=1Tωj2.In formula (9), the smaller the values of γ and λ, the more complex the model is. Let Ij=i|qxi=j be the sample of leaf node j, and the formula can be changed as follows:(12)ℒt≈∑i=1ngifixi+12hifi2xi+γT+12λ∑j=1Tωj2=∑j=1T∑i∈Ijgiwj+12∑i∈IjhI+λwj2+γT.The weightwj∗ of j in the value corresponding to the objective function is as follows:(13)wj∗=−GjΗj+λ.The optimal solution can be obtained by bringing the above formula into the objective function as follows:(14)ℒtq=−12∑j=1TGj2Hj+λ+γT.


### 3.3. Algorithm Improvement

Through the idea of optimizing model parameters, we can choose Bayesian optimization algorithm to improve parameter optimization. By setting good values, we train the model for Bayesian optimization and finally form the results for classification evaluation. The optimal parameters are substituted into XGBoost algorithm [29]. Specific steps are as follows:(1)
Lett = 0, the parameter initial population p (0).(2)
Select the candidate solutionS(T) from P(T) is selected.(3)
The Bayesian mesh is constructed according to the following formula:(15)xt=argmaxx∈Dμt−1x+βt1/2σt−1x.(4)
A new solutionO(T) is generated according to the above formula.(5)
A new populationP(T + 1) is deduced from O(T).(6)
Cycle calculation terminates when the calculation is over and outputs the final optimization result. If it is not finished, jump to (2) and continue to execute in sequence until the optimal result is found at the end of the calculation. By optimizing the XGBoost algorithm model with the above Bayesian optimization parameter method, literature [30] can increase the prediction accuracy of the final result.


## 3.1. Multivariate Logistic Regression

This paper is based on the classification of digital marketing user categories. If there are N categories, they can be expressed as {1, 2, ...,k}. Suppose the dataset D=xi,yii=1n=1, xi=1,xi1,…,xipT∈Rp+1; yi∈1,…,k, i = 1, ..., n.The binary logistic regression [21] model assumes that the logarithm of the ratio of posterior probabilities belonging to two categories 0 and 1 is linear, as shown by the following formula:(1)logPry=1|xPry=0|x=βTx.By the logic of the above formula, the logistic regression model can also be called the logarithmic probability model [22]. It is a model with Class 0 as the base class. By analogy, extending to multiple classes, and setting class K as the base class, the logarithmic probability of K−1 is also as follows:(2)logPry=1|xPry=1|xy=K|x=β1Tx,logPry=2|xPry=K|x=β2Tx,…logPry=K−1|xPry=K|x=βK−1Tx,where β1,β2,…,βK−1∈Rp+1.(3)Pry=1|x=eβ1TxPry=K|x,Pry=2|x=eβ2TxPry=K|x,…Pry=K−1|x=eβK−1TxPry=K|x.Formulas (4) and (5) are derived from formula (3) as follows:(4)∑K=1KPry=K|x=1,(5)plx,β=Pry=l|x=expβlTx∑j=1KexpβjTx.From the above derivation, we can know that logarithmic probability can be reflected by the prediction results of the linear regression model in multivariate logistic regression. This model is called “logarithmic probability regression,” also known as logistic regression [23], and the logistic regression function will not be affected by wrong assumptions, so data modeling can be carried out directly.


## 3.2. XGBoost

XGBoost algorithm [24], whose full name is the limit gradient lifting algorithm, is an improved learning algorithm of the decision tree. It was proposed by Dr. Chen Tianqi of Washington University in 2014. This algorithm has excellent ability and is widely used in industry, medicine, aviation, economy, and other fields. The algorithm is characterized by parallel computing, giving full play to the advantages of CPU multithreading, and improving the efficiency of data propagation through the improved algorithm.Givenn data samples D=xI,yiD=n,Xi∈Rm,yi∈R, with m characteristic attributes, the additive model is used to predict the output.(6)yi^=∑k=1Kfkxi,fk∈ℱ,where the regression tree space is represented by F=fx=wqxq:Rm⟶T,w∈RT which represents all trees, and the structure of each tree is denoted by Q, and the total number of leaves on the tree is denoted by T. Each learner fk corresponds to an independent tree structure q and leaf weight w, and it is determined whether the selection algorithm parameters are the best effect [25] by using an objective function defined as follows:(7)Objθ=∑i=1nlyi,yi^+∑i=1nΩfk.As can be seen from the above formula, it contains two parts. The left part of the plus sign is the loss functionΩf=γT+1/2λw2, also known as the differentiable loss function, and it is used to measure the difference between the predicted value yi^ and actual value yi. This result is also called training error. The right part of the plus sign is represented as a regular term, which punishes the weight of leaf nodes and achieves the purpose of optimizing the objective function through addition training [26] to avoid the influence of overfitting.Incorporating the predicted valueyi^t into the following formula minimizes the loss function:(8)ℒt=∑i=1nlyi,yi^t−1++fixi+Ωfi.Put the loss term atyi^t−1 [27], as shown in the following formula:(9)ℒt=∑i=1nlyi,yi^t−1++gifixi+12hifi2xi+Ωfi.Heregi=∂yi^t−1lyi,yi^t−1,hi=∂yi^t−12lyi,yi^t−1 are the first and second partial derivatives of the loss function L, respectively [28]. The constant term is removed and changed it to the following formula:(10)ℒt=∑i=1ngifixi+12hifi2xi+Ωfi.Through the function defined above, the regularization term is defined as(11)Ωf=γT+12λ∑j=1Tωj2.In formula (9), the smaller the values of γ and λ, the more complex the model is. Let Ij=i|qxi=j be the sample of leaf node j, and the formula can be changed as follows:(12)ℒt≈∑i=1ngifixi+12hifi2xi+γT+12λ∑j=1Tωj2=∑j=1T∑i∈Ijgiwj+12∑i∈IjhI+λwj2+γT.The weightwj∗ of j in the value corresponding to the objective function is as follows:(13)wj∗=−GjΗj+λ.The optimal solution can be obtained by bringing the above formula into the objective function as follows:(14)ℒtq=−12∑j=1TGj2Hj+λ+γT.


## 3.3. Algorithm Improvement

Through the idea of optimizing model parameters, we can choose Bayesian optimization algorithm to improve parameter optimization. By setting good values, we train the model for Bayesian optimization and finally form the results for classification evaluation. The optimal parameters are substituted into XGBoost algorithm [29]. Specific steps are as follows:(1)
Lett = 0, the parameter initial population p (0).(2)
Select the candidate solutionS(T) from P(T) is selected.(3)
The Bayesian mesh is constructed according to the following formula:(15)xt=argmaxx∈Dμt−1x+βt1/2σt−1x.(4)
A new solutionO(T) is generated according to the above formula.(5)
A new populationP(T + 1) is deduced from O(T).(6)
Cycle calculation terminates when the calculation is over and outputs the final optimization result. If it is not finished, jump to (2) and continue to execute in sequence until the optimal result is found at the end of the calculation. By optimizing the XGBoost algorithm model with the above Bayesian optimization parameter method, literature [30] can increase the prediction accuracy of the final result.


## 4. Data Modeling

The data acquisition model is shown in Figure5.Figure 5
Online data acquisition model.Through network data crawling and data modeling, according to descriptive statistics, we screened out key indicators as follows: category browsing times, purchase times, brand browsing times, brand last stay viewing time, and last viewing time of this category, and user’s gender, level, age, marriage, education level, occupation, unit price, and purchasing power of each customer in the latest month, including 13 indicators and predicted valueγ [31].


### 4.1. Logistic Regression Modeling

Through data processing and cleaning, the program is executed byR language software, and 33 variables of parameter estimated value are obtained, as shown in Table 1. From the table, it can be found that 23 variables with significant changes are retained in the table, for example, category browsing times x1, additional purchase times x4, purchase times x5, etc.; consider removing insignificant variables, such as brand purchase times x2, age x13, unit price per customer x17 in the latest month, etc., which are not significant, so as to test whether the new model fits better. In the new fitting results obtained by experiments, it is found that every regression coefficient in the new model is very significant (P < 0.5) [32].Table 1
Estimated values of parameters.
EstimateStd. errorZ valuePr> (z)(Intercept)−6.12E + 003.13E − 01−19.716<2e − 16∗∗∗x11.11E − 011.83E − 025.8046.11E − 09∗∗∗x21.67E − 05.4.41E − 040.0380.968183x39.66E − 032.52E − 033.8330.000128∗∗∗x58.43E − 012.48E − 013.4390.000586∗∗∗x61.43E − 015.78E − 0324.506<2e − 16∗∗∗x73.03E − 021.86E − 0316.302<2e − 16∗∗∗x104.32E − 012.13E − 0220.433<2e − 16∗∗∗x11−5.83E − 014.45E − 02−13.15<2e − 16∗∗∗x12−9.39E − 024.38E − 02−2.160.031549∗x13−9.15E − 031.08E − 01−0.8410.399845x14−7.48E − 013.59E − 01−2.0880.036693∗x15−8.15E − 013.59E − 01−2.2860.022199∗x164.83E − 012.56E − 0218.645<2e − 16∗∗∗x171.94E − 016.43E − 023.0230.002508∗∗x18−3.53E − 015.58E − 02−6.303.19E − 10∗∗∗x195.83E − 025.23E − 021.110.267071x20−1.23E − 017.41E − 02−1.6150.106332x21−4.19E − 024.71E − 02−0.8860.374191x221.63E − 017.19E − 022.2810.022343∗x232.02E − 021.02E − 010.1950.843986x248.34E − 021.01E − 010.8120.415882x25−6.61E − 011.25E − 01−5.2151.84E − 07x26−7.31E − 011.31E − 01−5.5013.76E − 08x27−9.20E − 011.42E − 01−6.4819.02E − 11x28−1.01E + 002.71E − 01−3.7760.000156x29−1.81E − 053.52E − 05−0.520.603296x305.32E − 015.19E − 011.0210.306568x315.40E − 013.40E − 011.5860.112511x321.08E + 002.64E − 014.1483.37E − 05∗∗∗x331.12E + 002.64E − 014.2552.08E − 05∗∗∗x347.53E − 012.68E − 012.8060.004987∗∗x353.75E − 035.51E − 046.8219.05E − 12∗∗∗x363.21E − 011.55E − 0220.535<2e − 16∗∗∗According to the results of variance analysis in Table2, the chi-square value is not significant (p = 0.28), which shows that the fitting effect of the new model with 23 independent variables is basically consistent with that of the model with 33 complete variables. Therefore, we can choose a simple model to calculate.Table 2
Analysis of variance values.
Model 1y ∼x1 + x2 + x3 + x5 + x6 + x7 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36Model 2y ∼x1 + x3 + x5 + x6 + x7 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 +  x23 +  x24 + x25 + x26 + x27Resid. DfResid. DevDfDeviancePr (>Chi)1323582568423237325702−15−17.660.2819The comparison diagram of the two models is shown in Figure6. Under different standards of all independent variables, the important values of independent variables corresponding to different independent variables are selected.Figure 6
Comparison diagram of models 1 and 2.The corresponding relationship between algorithm and error evolved from decision tree is shown in Figure7.Figure 7
Relationship between decision tree and error mapping.The probability prediction value is obtained by logistic regression model, the probability prediction value of counterexample is less than or equal to 0.5, and the probability prediction value of positive example is greater than 0.5, and the training set error matrix is obtained, as shown in Table3.Table 3
Error matrix of logistic regression training set.
Real situationPositive exampleNegative examplePositive example131283015Negative example313513138Using this model in the test set, the error matrix of the test set is obtained, as shown in Table4.Table 4
Error matrix of logistic regression test set.
Real situationPositive exampleNegative examplePositive example56781335Negative example12985596The logistic regression model was analyzed and calculated, and the results are shown in Figure8.Figure 8
Logistic regression model training set and test set.


### 4.2. XGBoost Modeling

The training set is also modeled and used in the XGBoost algorithm, and the error matrix is shown in Table5.Table 5
Error matrix of XGBoost model training set.
Positive exampleNegative examplePositive example15239906Negative example144814816Similarly, when the XGBoost model is used for the test set, the resulting error matrix is shown in Table6.Table 6
Error matrix of XGBoost model test set.
Positive example positive examplePositive example58561155Negative example13925494The model accuracy and recall on the training set and test set are calculated by analyzing the data in Table6 as shown in Figure 9.Figure 9
XGBoost model training set and test set.The method proposed in this paper solves the classification accuracy of digital marketing. The XGBoost takes into account the case that the training data are sparse, which can improve the efficiency of the algorithm. The XGBoost algorithm model is simpler and prevents overfitting. The XGBoost uses not only the first derivative but also the second derivative.


### 4.3. Improved Bayesian Optimization Algorithm XGBoost

Through Bayesian optimization parameters, XGBoost is improved, and some important attribute parameters are selected as shown in Figure10.Figure 10
Comparison of feature importance of improved algorithm.From Figure10, the importance of algorithm features is improved and compared according to the selection of optimized parameters.The training set is also modeled and used in the improved XGBoost algorithm, and the error matrix is shown in Table7.Table 7
Error matrix of training set of improved algorithm model.
Positive exampleNegative examplePositive example16235980Negative example151315818Similarly, using the XGBoost model for the test set, the resulting error matrix is shown in Table8.Table 8
Error matrix of improved algorithm model test set.
Positive exampleNegative examplePositive example59561320Negative example13765898The data are compared as shown in Figure11.Figure 11
Improved algorithm model training set and test set.


## 4.1. Logistic Regression Modeling

Through data processing and cleaning, the program is executed byR language software, and 33 variables of parameter estimated value are obtained, as shown in Table 1. From the table, it can be found that 23 variables with significant changes are retained in the table, for example, category browsing times x1, additional purchase times x4, purchase times x5, etc.; consider removing insignificant variables, such as brand purchase times x2, age x13, unit price per customer x17 in the latest month, etc., which are not significant, so as to test whether the new model fits better. In the new fitting results obtained by experiments, it is found that every regression coefficient in the new model is very significant (P < 0.5) [32].Table 1
Estimated values of parameters.
EstimateStd. errorZ valuePr> (z)(Intercept)−6.12E + 003.13E − 01−19.716<2e − 16∗∗∗x11.11E − 011.83E − 025.8046.11E − 09∗∗∗x21.67E − 05.4.41E − 040.0380.968183x39.66E − 032.52E − 033.8330.000128∗∗∗x58.43E − 012.48E − 013.4390.000586∗∗∗x61.43E − 015.78E − 0324.506<2e − 16∗∗∗x73.03E − 021.86E − 0316.302<2e − 16∗∗∗x104.32E − 012.13E − 0220.433<2e − 16∗∗∗x11−5.83E − 014.45E − 02−13.15<2e − 16∗∗∗x12−9.39E − 024.38E − 02−2.160.031549∗x13−9.15E − 031.08E − 01−0.8410.399845x14−7.48E − 013.59E − 01−2.0880.036693∗x15−8.15E − 013.59E − 01−2.2860.022199∗x164.83E − 012.56E − 0218.645<2e − 16∗∗∗x171.94E − 016.43E − 023.0230.002508∗∗x18−3.53E − 015.58E − 02−6.303.19E − 10∗∗∗x195.83E − 025.23E − 021.110.267071x20−1.23E − 017.41E − 02−1.6150.106332x21−4.19E − 024.71E − 02−0.8860.374191x221.63E − 017.19E − 022.2810.022343∗x232.02E − 021.02E − 010.1950.843986x248.34E − 021.01E − 010.8120.415882x25−6.61E − 011.25E − 01−5.2151.84E − 07x26−7.31E − 011.31E − 01−5.5013.76E − 08x27−9.20E − 011.42E − 01−6.4819.02E − 11x28−1.01E + 002.71E − 01−3.7760.000156x29−1.81E − 053.52E − 05−0.520.603296x305.32E − 015.19E − 011.0210.306568x315.40E − 013.40E − 011.5860.112511x321.08E + 002.64E − 014.1483.37E − 05∗∗∗x331.12E + 002.64E − 014.2552.08E − 05∗∗∗x347.53E − 012.68E − 012.8060.004987∗∗x353.75E − 035.51E − 046.8219.05E − 12∗∗∗x363.21E − 011.55E − 0220.535<2e − 16∗∗∗According to the results of variance analysis in Table2, the chi-square value is not significant (p = 0.28), which shows that the fitting effect of the new model with 23 independent variables is basically consistent with that of the model with 33 complete variables. Therefore, we can choose a simple model to calculate.Table 2
Analysis of variance values.
Model 1y ∼x1 + x2 + x3 + x5 + x6 + x7 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36Model 2y ∼x1 + x3 + x5 + x6 + x7 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 +  x23 +  x24 + x25 + x26 + x27Resid. DfResid. DevDfDeviancePr (>Chi)1323582568423237325702−15−17.660.2819The comparison diagram of the two models is shown in Figure6. Under different standards of all independent variables, the important values of independent variables corresponding to different independent variables are selected.Figure 6
Comparison diagram of models 1 and 2.The corresponding relationship between algorithm and error evolved from decision tree is shown in Figure7.Figure 7
Relationship between decision tree and error mapping.The probability prediction value is obtained by logistic regression model, the probability prediction value of counterexample is less than or equal to 0.5, and the probability prediction value of positive example is greater than 0.5, and the training set error matrix is obtained, as shown in Table3.Table 3
Error matrix of logistic regression training set.
Real situationPositive exampleNegative examplePositive example131283015Negative example313513138Using this model in the test set, the error matrix of the test set is obtained, as shown in Table4.Table 4
Error matrix of logistic regression test set.
Real situationPositive exampleNegative examplePositive example56781335Negative example12985596The logistic regression model was analyzed and calculated, and the results are shown in Figure8.Figure 8
Logistic regression model training set and test set.


## 4.2. XGBoost Modeling

The training set is also modeled and used in the XGBoost algorithm, and the error matrix is shown in Table5.Table 5
Error matrix of XGBoost model training set.
Positive exampleNegative examplePositive example15239906Negative example144814816Similarly, when the XGBoost model is used for the test set, the resulting error matrix is shown in Table6.Table 6
Error matrix of XGBoost model test set.
Positive example positive examplePositive example58561155Negative example13925494The model accuracy and recall on the training set and test set are calculated by analyzing the data in Table6 as shown in Figure 9.Figure 9
XGBoost model training set and test set.The method proposed in this paper solves the classification accuracy of digital marketing. The XGBoost takes into account the case that the training data are sparse, which can improve the efficiency of the algorithm. The XGBoost algorithm model is simpler and prevents overfitting. The XGBoost uses not only the first derivative but also the second derivative.


## 4.3. Improved Bayesian Optimization Algorithm XGBoost

Through Bayesian optimization parameters, XGBoost is improved, and some important attribute parameters are selected as shown in Figure10.Figure 10
Comparison of feature importance of improved algorithm.From Figure10, the importance of algorithm features is improved and compared according to the selection of optimized parameters.The training set is also modeled and used in the improved XGBoost algorithm, and the error matrix is shown in Table7.Table 7
Error matrix of training set of improved algorithm model.
Positive exampleNegative examplePositive example16235980Negative example151315818Similarly, using the XGBoost model for the test set, the resulting error matrix is shown in Table8.Table 8
Error matrix of improved algorithm model test set.
Positive exampleNegative examplePositive example59561320Negative example13765898The data are compared as shown in Figure11.Figure 11
Improved algorithm model training set and test set.


## 5. Conclusion

In this paper, the intelligent data analysis algorithm logistic regression and XGBoost algorithm, and the improved Bayesian optimization parameter XGBoost algorithm are integrated into digital marketing. Combined with the product life cycle, the data that have been crawled through the network are processed, and the data set is modeled, in which 60% of the data are randomly selected as training sets, 40% as test sets, and accuracy and recall are used as performance measurement methods of the model. Through verification, the improved XGBoost algorithm based on Bayesian parameter selection is obviously superior to logistic regression in accuracy and recall, and its computational efficiency is also obviously superior to logistic regression, which shows certain advantages in data processing and analysis.



---

*Source: 8294891-2022-01-04.xml*