Prediction of web services reliability based on decision tree classification method

With the development of the service-oriented computing (SOC), web service has an important and popular solution for the design of the application system to various enterprises. Nowadays, the numerous web services are provided by the service providers on the network, it becomes difficult for users to select the best reliable one from a large number of services with the same function. So it is necessary to design feasible selection strategies to provide users with the reliable services. Most existing methods attempt to select services according to accurate predictions for the quality of service (QoS) values. However, because the network and user needs are dynamic, it is almost impossible to accurately predict the QoS values. Furthermore, accurate prediction is generally timeconsuming. This paper proposes a service decision tree based post-pruning prediction approach. This paper first defines the five reliability levels for measuring the reliability of services. By analyzing the quality data of service from the network, the proposed method can generate the training set and convert them into the service decision tree model. Using the generated model and the given predicted services, the proposed method classifies the service to the corresponding reliability level after discretizing the continuous attribute of service. Moreover, this paper applies the post-pruning strategy to optimize the generated model for avoiding the over-fitting. Experimental results show that the proposed method is effective in predicting the service reliability.


Introduction
Web services provide a standard means of communication among the different software applications on Internet. With the increasing number of web services with the same function, the application process requires qualitative selection of automatic service candidates [Yu, Zhang and Lin (2007)]. The reliable running of service process depends on both functional and nonfunctional service attributes, which are highly influenced by the quality of the selected web service [Silic, Delac and Srbljic (2013)]. To get an efficient service application, the service selection process should evaluate the reliability of web services according to both functional and nonfunctional service attributes [Avizienis, Laprie, Randell et al. (2004)]. The real relia bility of web service is affected by many service attributes, such as response time, availability and throughput. Using the different evaluating attributes may result in a totally different reliability to the same web service, even in the same evaluating method. In addition, adopting mass attributes in the evaluating process results in the increasing of the computing time, which eventually is bound to reduce the effectiveness of evaluating results. Hence, how to quickly predict the service reliability before or during the application execution becomes a big challenge. The researchers have proposed some definitions about the service reliability. The traditional definition of the service reliability is system-centric, such as availability, successability [Lyu (1996)]. Some literatures present the user-centric definitions, such as user-perceived reliability [Wang and Trivedi (2009)], or reliability on demand [Cortellessa and Grassi (2007)]. However, it should be noted that the service invocations are discrete and relatively sparse events. So the user-centric definition is more suitable for web services. Based on the above analysis, we focus on the prediction for the user-centric reliability in this paper. We define service reliability as the probability that the service invocation is successfully received under the specified conditions and time constraints. At present, there are a variety of different prediction methods for web services quality [Wang, Wang and Ding (2013) ;Silic, Delac, Krka et al. (2014);Wu, Xu, Lu et al. (2015); Xu, Zheng and Lyu (2015); Zheng, Trivedi, Qiu et al. (2015); Honamore, Dev and Honmore (2016); Wang, Wang, Yu et al. (2016); Yu and Huang (2016); Kumar and Sureka (2017); Thinh (2017); Wang, Yang and Yu (2017); White, Palade and Clarke (2017); Chen and Ha (2018)]. The most popular methods for predicting reliability of web services are mainly based on the collaborative filtering technology [Zheng and Lyu (2010) ;Zheng, Ma, Lyu et al. (2010); Yu and Huang (2016); Wu, Zhang, Luo et al. (2018); Wang, Chen, Shang et al. (2019)]. The advantage of this technology is the service reliability can be predicted, even if we cannot get some important prediction data. However, many other technologies are also used in the service prediction, such as kmeans clustering [Su and Khoshgoftaar (2009);Maamar and Benahmed (2019) ;Yang, Zhou and Yang (2019)], Markov [Almulla, Almatori and Yahyaoui (2011);Zheng, Trivedi, Qiu et al. (2015)], HMM [Rahnavard, Najjar and Taherifar (2010) ;Honamore, Dev and Honmore (2016)], graph reduction [Cardoso, Sheth, Miller et al. (2004)], and fuzzy logic [Almulla, Almatori and Yahyaoui (2011);Honamore and Rath (2016)]. In this paper, we present a reliability prediction model based on the decision tree, and propose a prediction algorithm. The advantage of the decision tree technology is we can get the minimal and optimal attribute set for evaluating the reliability of web service by selection of the optimal split attributes and pruning process, and reduce the evaluating time. Our method applies the quality of web services to construct the service classification tree. By discretizing the continuous attribute of service, an optimum reliability model for web services is built and can quickly predict the reliability level of the given service. The rest of paper is organized as follows. In Section 2, we describe the basic construction process of the decision tree. In Section 3, we present our reliability prediction process for web services by extracting the service data from the net-work. In Section 4, we propose our reliability prediction model for web services. In Section 5, we evaluate the proposed method by QWS database and show our experimental results. Finally, we present our conclusions in Section 6.

Construction of decision trees
A decision tree is a representation of a decision procedure for determining the class of a given instance [Utgoff (1989)]. Generally, a decision tree consists of three kinds of node: root node, child node and leaf node. Each node of the tree specifies either a class name or a specific test that partitions the space of instances at the node according to the possible outcomes of the test [Kaur and Kaur (2019)]. A root node includes the universal set of instances. A leaf node denotes a classification result. Each child node represents a test for one attribute. Each subset of the partition corresponds to a classification sub-problem for that subspace of the instances, which is solved by a sub-tree. A decision tree can be seen as a divide-and-conquer strategy for object classification [Utgoff (1989)]. The decision tree is built recursively according to a given training set. In each recursion step, an instance is divided into a sub-tree with maximum similarity. And the current node is expanded recursively on each of all subsets of the training set which are defined by the instance attributes. A basic construction algorithm of decision tree is described in Tab. 1.
Output: a decision tree CDTree and N which is the root node 01: to generate a node N; 02: if ,1 ∀ ∈ ≤ ≤ i y C i n then 03: to mark N as a leaf node of C; 04: return; 05: end if 06: if = ∅ A or any attribute of any two x had the same value then 07: to mark N as a leaf node of the class with maximum number in D; 08: return; 09: end if 10: select the optimal split attribute * a from A; 11: for each value * v a in * a do 12: to generate a sub-tree of N; to mark the sub-tree of N as a leaf node of the class with maximum number in 16: return; 17: else 18: to mark as a sub-tree; 19: end if 20: end for In Tab. 1. The D is the training set, and each training instance is denoted by a set of attribute-value pairs i x and a class label i y . The A is a set of attributes which describes CDTree is a decision tree function, and it returns a decision tree according to the given training set.
In the construction algorithm of decision tree, the most critical issue is how to get the goodness of split measure. Generally, there are three measure to be used in selecting the optimal split attributes. They include the information gain, gain ratio and Gini index [Mingers (1989)]. In this paper, we use the Gini index to measure the optimal split attribute.

Reliability prediction process
As mentioned before, we focus on the prediction of web service reliability according to the given training set. In Fig. 1, we present the prediction process of service reliability.  Figure 1: Prediction process for the web service reliability As can be seen in Fig. 1, reliability prediction process is consisted of three phases: data extracting phase, constructing decision tree phase and prediction phase. Prior to construct decision tree, we perform collecting the quality data of web services from the network. Then, we use the generated training set and the given generation strategy of decision tree to construct the decision tree for web services. Finally, when the user sends a reliability prediction request, the prediction result of the reliability can be generated by the decision tree for web services and return to the user.

Prediction model
This section describes each step of constructing the service decision tree and defines how reliability prediction are calculated from the reliability level. A service training set is formally defined as follows: where i s is a web service and 1 ≤ ≤ i n, and i r is the reliability level of the service i s .
A service attribute set is formally defined as follows: where j qs is a service attribute of web services, such as response time, availability.

Reliability levels
In here, we define five reliability levels in this paper, which are shown in Tab. 2.

Select the optimal split attribute
In this paper, we use the Gini index to select the optimal split attribute, and the services are partitioned into subset according to the values of that attribute. The Gini index is proposed by Breiman et al. [Breiman, Friedman, Stone et al. (1984)] in 1984. The Gini function measures the 'impurity' of an attribute with respect to the classes [Mingers (1989)]. The Gini function is formally defined as follows: where R is the number of reliability levels, k p is the probability of the kth reliability level services in the set S. The Gini Index method was used to split off the largest category into a separate group, with the default split size set to enable growing the tree. In this case, we estimate the reliability level probabilities with the actual relative frequencies. Thus the impurity of the attribute j qs is as follows: Gini index S qs (5)

Dealing with continuous value
In the quality of web service, many attributes are the continuous attributes. Thus we use the bi-partition method to deal with them in this paper.
For each value v, the Gini index is computed by considering the splitting above. The value ′ v for which _ ( , , ) ′ j Gini index S qs v is minimum is set to be the classification threshold of the attribute j qs .

Prediction algorithm
According to the above description, we present our prediction process in Tabs. 3 and 4. The service construction algorithm is a construction procedure of classification way for the service reliability level according to the given service set. In Tab. 3, the S is the service set, and each service is marked by a reliability level sign. The QoS is a set of attributes which describes a service in S. The ST is a service decision tree, and it returns a service decision tree according to the given service set S and attribute set QoS. The function ComputeClassFrequence() counts the service number of each reliability level in the service set S. The OneReliabilityLevel denotes that there is one reliability level in the service set S. The FewServices means that the service set S is a null set. The level prediction algorithm is a prediction process to the given service using above generated service decision tree in the service construction algorithm. In Tab. 4, the ST is a service decision tree, and the level prediction algorithm can classify the given service ′ s by the function ClassficationService () and ST.

Pruning
In order to avoid the over-fitting of the service decision tree, we use the service tree pruning algorithm in Tab. 5 to obtain a right sized tree. Firstly, we build a complete service decision tree by the service construction algorithm in Tab. 3. Then, we remove sub-trees that are not contributing significantly towards generalization accuracy. In the first stage, a sequence of increasingly smaller trees is built on the training data. In the second stage, one of these trees is chosen as the pruned tree, based on its classification accuracy on a pruning set.

Experiments
In this section, we present the evaluate results that supports our claims that our reliability prediction model improves the prediction accuracy. To prove our claims, we use the QWS database [Al-Masri and Mahmoud (2007)] to conduct the experiments and analyze the results. The QWS database collects 2507 real web services, and each service is described by 11 parameters including service name, description, operation name, description, message name, and message description tags. Tab. 6 shows 8 attributes of web service we used in the experiments. The extent to which a WSDL document follows WSDL specification Best Practices The extent to which a Web service follows WS-I Basic Profile Latency Time taken for the server to process a given request Documentation Measure of documentation (i.e., description tags) in WSDL To evaluate prediction accuracy for web service, we use the standard error measures: mean absolute error MAE. The MAE represents the average magnitude of errors for the predicted reliability values: where N is the cardinal number of the prediction set, j p real reliability level is from QWS, while ˆj p is the predicted reliability level.
In our experiments, we select 1500 web services from QWS as the training set, 500 services as the pruning set, and 500 services left are used as test set. Firstly, we separately use the 500, 1000 and 1500 training data to generate the service decision trees. Then, we use 500 pruning data to separately prune the three service decision trees, and get the pruned service trees. The pruned service tree by 500 training data includes three split attributes: best practices, compliance and availability. The pruned service tree by 1000 training data includes three split attributes: best practices, availability, documentation and response time. The pruned service tree by 1500 training data includes the same attributes with the second pruned service tree. Next, we use the above two split attribute sets ('best practices, compliance, availability' & 'best practices, availability, documentation, response time') to generate the service decision trees and pruned service trees. At the same time, we get two split attribute sets ('best practices, availability' & 'best practices') according to the pruned trees. We use the two split attribute sets again to generate the new service decision trees. Finally, we compare the accuracy, MAE and running time of the five groups with different split attribute sets and the number of training data.

Figure 2:
Accuracy comparison with the different split attributes Fig. 2 shows the comparison results of the prediction accuracy with different split attribute sets and the number of training data. In Fig. 2, 'all' denotes that the split attribute set includes all attributes in Tab. 2; 'split1' denotes that the split attribute set includes best practices, compliance and availability; 'split2' denotes that the split attribute set includes best practices and availability; 'split3' denotes that the split attribute set includes best practices, availability, documentation and response time; 'split4' denotes that the split attribute set includes best practices. When we consider all attributes as the split attribute set, the prediction accuracies are the lowest in three groups of test sets. The prediction accuracies of 'split1' are the highest in the second and third groups. As shown in the figure, when the training data is above certain level, the split attribute set 'split1' can get the higher prediction accuracy. This is because best practices, compliance and availability contain more useful information for evaluating the reliability of web service. Without the attribute 'compliance', this leads to the worse performance when adopting the split attribute set 'split2' to predict the service reliability. Moreover, the execution results of 'all', 'split3' and 'split4' are not ideal due to the lack of useful attributes or the adoption of disturbed attributes.  Fig. 3 shows the comparison results of the mean absolute error with different split attribute sets and the number of training data. The MAE of 'split1' are the lowest in the second and third groups. Consequently, when the training data is above certain level, the split attribute set 'split1' can get the lower mean absolute error. This result again demonstrates that, the attributes 'best practices, compliance and availability' are closely related with the reliability of service.  Fig. 4 shows the comparison results of the mean absolute error with different split attribute sets and the number of training data. The running time of 'all' is the longest in three groups. The running time of 'split4' is the shortest. Consequently, the number of attributes in the split set is positively related to the running time. The more the attribute number is, the longer the running time is. By contrast, the less the attribute number is, the shorter the running time is.  Fig. 5(a) shows the accuracy comparison result of the un-pruning and post-pruning with 'all' split attribute set. Fig. 5(b) shows the MAE comparison result of the un-pruning and post-pruning with 'all' split attribute set. We can see that the accuracy is increased appreciably from Fig. 5(a), and the MAE is reduced appreciably from Fig. 5(b). Fig. 5(c) shows the running time comparison result of the un-pruning and post-pruning with 'all' split attribute set. We can see that the running time has a rapid growth with the increasing number of training data. Fig. 5 explains the significance of pruning. We can achieve the closely related attribute set, improve the performance result, and reducing the running time. We can see that the running time of 'split1' is shortest from Fig. 6(c). As the figures show, our method is effective for the reliability prediction of web services. Our experimental results show that we can get the higher prediction accuracy and the shorter running time when we use the attributes 'best practices, compliance and availability' as the split attribute set.

Conclusions
Aiming at the dynamic of the network and user needs, this paper proposes a prediction approach of the service reliability level by constructing the service decision tree. We utilize the decision tree method to derive a reliability prediction model that classifies services into the corresponding reliability level according to the related attribute values. A selection method of optimal split attribute and a bi-partition method for dealing with the continuous attribute are presented to support the reliability prediction model. To solve the over-fitting problem of the model and improve the prediction accuracy, we exploit a service tree post-pruning method. The experiments based on a real-world dataset reveal that the proposed method provide a high accuracy of prediction without noticeably increased running time. The proposed method contributes to reliability prediction in a high-dynamic computing environment.