# Predicting Quality of Service via Leveraging Location Information

Authors: Liang Chen; Fenfang Xie; Zibin Zheng; Yaoming Wu
Journal: Complexity
 (2019)

---

## Abstract

QoS (Quality of Service) (our approach can be applied to a wide variety of services; in this paper, we focus on Web services) performance is intensively relevant to locations due to the network distance and the Internet connection between users and services. Thus, considering the location information of services and users is necessary. However, the location information has been ignored by most previous work. In this paper, we take both services’ and users’ location information into account. Specifically, we propose a location-aware QoS prediction approach, called LANFM, by exploiting neural network techniques and factorization machine to improve user-perceived experience. First of all, the information (e.g., id and location) of services and users is expressed as embedding vectors by leveraging neural network techniques. Then, the inner product of various embedding vectors, along with the weighted sum of feature vectors, is used to predict the QoS values. It should be noted that the inner product operation could capture the interactions between services and users, which is helpful to predict QoS values of services that have not been invoked by users. A collection of extensive experiments have been carried out on a real-world dataset to validate the effectiveness of the LANFM model.


---

## Body

## 1. Introduction

Web services are service-oriented architecture technologies that provide services through standard Web protocols to support the interactive operation of different machines on the network [1]. With the exponential growth of Web services on the Internet, there emerge lots of Web services that have identical or similar functionalities. These Web services have different QoS performance. The nonfunctional attributes of Web services are extensively depicted by QoS [2]. Generally speaking, QoS is a list of nonfunctional performance criteria of Web services, including popularity, response time, throughput, failure probability, and availability. The user-perceived QoS associates closely with network status, geographical location, and service runtime environment.In reality, only a part of Web services have been invoked by users. As a result, the invocation matrix between Web services and users is considerably sparse, since most of the entries in the user-service matrix are null. Evaluating Web service is a good way to get accurate QoS for service users. However, there are a lot of challenges in invoking the Web services for evaluation purpose from the client user’s perspective. Firstly, it is time-consuming and impractical for users to invoke every single Web service for evaluation purpose, due to the massive Web services on the Internet. Secondly, most Web service providers are commercial companies. These companies allow users to acquire QoS information by invoking Web services, while they can be prohibitively expensive for users. Thirdly, it is not professional enough for inexperienced users to conduct evaluation on Web services. Lastly, conducting service invocations periodically brings a heavy workload to users to observe the services’ QoS performance constantly. Therefore, how to accurately predict the QoS values is becoming an urgent problem to enhance the user-perceived experience.To alleviate these critical challenges, much work [3–6] has been done on QoS prediction, while, in most cases, only the information of user id and service id is utilized and the location information of users and services is largely ignored. It should be noted that QoS performance of Web services is inextricably linked with locations. The reason is that the network distance and the Internet connections between users and services have impact on user-perceived QoS performance to a large extent. Thus, taking location factors into account is useful to improve the QoS prediction results. Recently, a few works [7–12] have noticed the effect of users’ location on QoS values. These investigations are mainly based on the observation that when invoking the same Web service, users in different places may go through distinct experience due to the diverse physical infrastructure. However, these existing QoS prediction methods have the drawbacks of high dimension, high time complexity, and high expense, due to utilizing traditional user-based/item-based collaborative filtering and matrix factorization techniques. The dimensions of the feature vectors used in previous work are relatively high, with a time complexity basically in O(N2), and it requires a lot of artificial feature engineering. More innovative and effective methods are required to employ the service information and the user information. These methods promote solving the above drawbacks and further enhancing the accuracy of QoS prediction.To overcome the above-mentioned drawbacks of existing QoS prediction methods, we prefer to exploit the neural network and factorization machine technique. Specifically, the time complexity of factorization machine is linear. In addition, factorization machine only relies on a linear number of parameters [13]. Embedding techniques in neural networks can project data from high-order source space to low-order target space and can maintain good structural invariance. The problem of high dimension can be well solved by embedding technique. The interactions between Web services and users can be captured by factorization machine via learning cross features, even if the Web services have never been invoked by the users. Factorization machine can be applied to dispose the drawbacks of data sparsity and high time complexity.Based on the characteristics of our QoS prediction problem and the significance of embedding and factorization machine, in this paper, we propose aLocation-Aware QoS prediction approach, by exploitingNeural network andFactorizationMachine (called LANFM), to improve the user-perceived experience. This paper is extended from its preliminary conference version [14], which mainly takes advantage of users’ id feature and services’ id feature for QoS prediction. Moreover, we only consider impact parameters like matrix density and dimension of embedding vector (matrix density is set as 10%) in the conference paper.Particularly, the significant contributions of this paper could be summed up as three-fold:(1)
Both services’ and users’ location information is taken into consideration. The embedded form of services’ and users’ location information can be used to capture the interactions between services and users(2)
Based on the additional location information, the interactions between users and services can be enhanced. Namely, the proposed approach is an enhanced neural factorization machine model for QoS prediction(3)
A real-world dataset is used to validate the effectiveness of our LANFM model. Empirical study shows that considering users’ and services’ location information is indeed helpful to improve the accuracy of QoS prediction. Impacts of the matrix density, the dimension of the embedding vector, and the batch size are evaluated, respectivelyThe remaining part of the paper is arranged as follows. Section2 highlights some related work on collaborative filtering and location-aware QoS prediction. Section 3 describes the QoS prediction problem, motivation, and the framework of our LANFM model. Section 4 presents the details of our LANFM model for predicting QoS values. Section 5 introduces some empirical studies and analyzes the experimental results. Section 6 makes a conclusion of the paper.


## 2. Related Work and Discussion

In this section, we present some investigations associated with the research problem of QoS prediction.


### 2.1. Collaborative Filtering Based QoS Prediction

Currently, collaborative filtering technique is widely applied to QoS prediction. These collaborative filtering based methods are mainly classified into three categories: memory-based, model-based, and hybrid. We will introduce them individually in the following paragraphs.Memory-Based Approach. This kind of approach measures the similarity between users or services by exploiting the historical invocation logs between users and services. It involves user-based approaches [15, 16], item-based approaches [17, 18], and the hybrid of them [4, 19]. For instance, Sun et al. [20] presented a novel method to measure the similarity between Web services. Further, they proposed to predict QoS by introducing normal recovery collaborative filtering. Xiong et al. [21] exploited the historical usage experience and proposed a collaborative approach. They aimed to address the QoS prediction problem on unbalanced data. Ma et al. [22] mined several significant characteristics on some QoS datasets that had never been found before. They put forward a powerful prediction method to realize these characteristics to help predict QoS.Model-Based Approach. This type of approach predicts QoS for service users by utilizing machine learning techniques. Some representative approaches of this type are presented in the following. Zheng et al. [5] proposed a neighborhood integrated matrix factorization approach to predict QoS for users by considering the historical invocation records between users and services. Xu et al. [23] took the users’ reputation into consideration and presented a reputation-based matrix factorization approach to predict QoS values. Luo et al. [24] proposed a matrix-factorization model with Tikhonov regularization terms and under a nonnegativity constraint for QoS prediction. Wu et al. [14] embedded the user id and the service id to vectors and employed factorization machine to predict QoS for users.Hybrid Approach. This style of approach integrates memory-based and model-based approaches. The hybrid methods usually unify the power of similarity measurement and matrix factorization. For example, Chen et al. [25] assembled the neighborhood relations of users and services. Then, they predicted QoS values by applying a neighborhood regularized matrix factorization approach. Su et al. [6] firstly combined the direct similarity and the transitive indirect similarity of services. Further, they proposed a hybrid algorithm to perform QoS prediction by integrating the nonnegative matrix factorization model and the expectation-maximization. Lo et al. [26] identified neighborhoods via measuring the similarities on the user side and the service side from different aspects. Then, they proposed a relational regularized matrix factorization structure for QoS prediction.


### 2.2. Location-Aware QoS Prediction

Users’ and Web services’ location information is intensively relevant to QoS performance of Web services because of the network distance and Internet connections. Considering location information will do a great favor to enhance the QoS prediction accuracy.Some studies have taken the location information into consideration recently. Chen et al. [27] employed the characteristics of QoS by designing a region model for large-scale services’ QoS prediction. Lo et al. [28] identified neighbors by considering the local connectivity and geographical information. They proposed a novel location-based regularized matrix factorization model to predict QoS for users. He et al. [29] applied the location information of clustered user-service groups and put forward a hierarchical matrix factorization method based on the location information to achieve personalized QoS prediction. Chen et al. [11] divided users and services into several groups by employing users’ location information and services’ location information, along with the QoS values. They proposed an innovative collaborative filtering model to select services with the best QoS performance, for users. Liu et al. [9] presented a memory-based method for service QoS prediction by leveraging both users’ and services’ location information. The location information can help choose similar neighbors for the objective user or the objective service. Wu et al. [7] used the invocation record between users and services, and a generalized context-sensitive matrix factorization method was proposed to predict QoS values for services. Kuang et al. [8] took advantage of the user’s reputation and the user’s and the service’s location information, and a personalized QoS prediction method was proposed to solve the problem of data sparsity, cold start, and data incredibility.All the studies mentioned above are useful for predicting QoS value for users to a certain extent. But most of the above methods suffer from high dimension, high time complexity, and high expense. In the proposed LANFM model, we employ the embedding feature extracting techniques to represent the implicit vectors of services’ and users’ location information. By applying embedding technique, we can resolve the drawback of high dimension. In addition, embedding vectors can be utilized to mine the potential correlations between services and users, even if the user has not invoked the service yet. Moreover, the proposed LANFM model could be calculated in linear time; thus it can solve the problem of high time complexity.


## 2.1. Collaborative Filtering Based QoS Prediction

Currently, collaborative filtering technique is widely applied to QoS prediction. These collaborative filtering based methods are mainly classified into three categories: memory-based, model-based, and hybrid. We will introduce them individually in the following paragraphs.Memory-Based Approach. This kind of approach measures the similarity between users or services by exploiting the historical invocation logs between users and services. It involves user-based approaches [15, 16], item-based approaches [17, 18], and the hybrid of them [4, 19]. For instance, Sun et al. [20] presented a novel method to measure the similarity between Web services. Further, they proposed to predict QoS by introducing normal recovery collaborative filtering. Xiong et al. [21] exploited the historical usage experience and proposed a collaborative approach. They aimed to address the QoS prediction problem on unbalanced data. Ma et al. [22] mined several significant characteristics on some QoS datasets that had never been found before. They put forward a powerful prediction method to realize these characteristics to help predict QoS.Model-Based Approach. This type of approach predicts QoS for service users by utilizing machine learning techniques. Some representative approaches of this type are presented in the following. Zheng et al. [5] proposed a neighborhood integrated matrix factorization approach to predict QoS for users by considering the historical invocation records between users and services. Xu et al. [23] took the users’ reputation into consideration and presented a reputation-based matrix factorization approach to predict QoS values. Luo et al. [24] proposed a matrix-factorization model with Tikhonov regularization terms and under a nonnegativity constraint for QoS prediction. Wu et al. [14] embedded the user id and the service id to vectors and employed factorization machine to predict QoS for users.Hybrid Approach. This style of approach integrates memory-based and model-based approaches. The hybrid methods usually unify the power of similarity measurement and matrix factorization. For example, Chen et al. [25] assembled the neighborhood relations of users and services. Then, they predicted QoS values by applying a neighborhood regularized matrix factorization approach. Su et al. [6] firstly combined the direct similarity and the transitive indirect similarity of services. Further, they proposed a hybrid algorithm to perform QoS prediction by integrating the nonnegative matrix factorization model and the expectation-maximization. Lo et al. [26] identified neighborhoods via measuring the similarities on the user side and the service side from different aspects. Then, they proposed a relational regularized matrix factorization structure for QoS prediction.


## 2.2. Location-Aware QoS Prediction

Users’ and Web services’ location information is intensively relevant to QoS performance of Web services because of the network distance and Internet connections. Considering location information will do a great favor to enhance the QoS prediction accuracy.Some studies have taken the location information into consideration recently. Chen et al. [27] employed the characteristics of QoS by designing a region model for large-scale services’ QoS prediction. Lo et al. [28] identified neighbors by considering the local connectivity and geographical information. They proposed a novel location-based regularized matrix factorization model to predict QoS for users. He et al. [29] applied the location information of clustered user-service groups and put forward a hierarchical matrix factorization method based on the location information to achieve personalized QoS prediction. Chen et al. [11] divided users and services into several groups by employing users’ location information and services’ location information, along with the QoS values. They proposed an innovative collaborative filtering model to select services with the best QoS performance, for users. Liu et al. [9] presented a memory-based method for service QoS prediction by leveraging both users’ and services’ location information. The location information can help choose similar neighbors for the objective user or the objective service. Wu et al. [7] used the invocation record between users and services, and a generalized context-sensitive matrix factorization method was proposed to predict QoS values for services. Kuang et al. [8] took advantage of the user’s reputation and the user’s and the service’s location information, and a personalized QoS prediction method was proposed to solve the problem of data sparsity, cold start, and data incredibility.All the studies mentioned above are useful for predicting QoS value for users to a certain extent. But most of the above methods suffer from high dimension, high time complexity, and high expense. In the proposed LANFM model, we employ the embedding feature extracting techniques to represent the implicit vectors of services’ and users’ location information. By applying embedding technique, we can resolve the drawback of high dimension. In addition, embedding vectors can be utilized to mine the potential correlations between services and users, even if the user has not invoked the service yet. Moreover, the proposed LANFM model could be calculated in linear time; thus it can solve the problem of high time complexity.


## 3. Motivation and Framework

In this part, we define the problem to be solved in Section3.1. We present the motivation of incorporating location information in Section 3.2. We introduce the framework of the proposed LANFM model in Section 3.3.


### 3.1. Problem Description

We aim to achieve accurate QoS prediction for users by making full use of the historical QoS invocation records, services’ location information, and users’ location information in this paper. The details of the problem are described as follows.SupposeU={u1,u2,…,um} and S={s1,s2,…,sn} are a set of m users and n services, respectively. Q∈Rm×n is the matrix between m users and n services. qij is the element in Q, and many of their values are missing. Our goal is to predict the missing values in the matrix Q by exploiting the relationships between the existing elements.An example is displayed in Figure1 to help comprehend the problem of QoS prediction. The invocation matrix between users (e.g., U1, U2, U3, U4) and services (e.g., S1, S2, S3, S4, S5) is exhibited in the upper part of Figure 1. Every element in the invocation matrix stands for a QoS attribute value (e.g., response time or throughput). Then, the problem we investigate is transformed to how to accurately predict the missing elements in the invocation matrix based on the existing elements. It could be found that only a part of services have been invoked by users. For instance, U1 has invoked S1, S3, and S4. U4 has observed QoS information on S1, S2, and S5. There still exist a small amount of common services, although not every user has invoked all services. We can complete the invocation matrix by applying the idea of collaborate filtering with the help of these common services. The complete matrix is shown in the lower part.Figure 1
An example of QoS prediction.


### 3.2. Motivation

The user-perceived QoS (such as throughput, reliability, and response time) associates with network status, geographical location, and service runtime environment closely. Network performance is related to network bandwidth, network latency, and network distance intensively. Among the several network performance influence factors, the location information is one of the key factors. Location information can affect the behavior of users [30]. In general, if the Web service is deployed in the user’s network (e.g., a local area network or a subnet), then, the Web server is more likely to respond to the user in a short period of time. That is, the response time between the user and the Web server is short, when a user invokes the Web service. Conversely, if the Web service is deployed far away from the user (e.g., across multiple subnets), there will be a long time before the Web server responds to the service user. This phenomenon is the same with the fact that when a user visits local websites, the Web page will soon respond to him/her. When the user visits foreign websites, it is often relatively slow to respond to him/her. This is because long-distance requests and responses on the Internet often need to be routed and forwarded multiple times, which is time-consuming. Figure 2 shows a toy example to illustrate why considering services’ and users’ location information to predict services’ QoS is important.Figure 2
A toy example of the influence of the location information.Assuming that Alice and Jack are two different service users. They lie in two remote networks. Web servers (e.g., S1, S2, and S3) are deployed in different kinds of networks and provide similar services. When Alice requests services, server S1 will answer the requirement of Alice and provide services to her, since the network distance between Alice and S1 is closer than that of S2 and S3. However, if S1 is invalid or has high latency, it will not answer Alice in time. At the same time, Alice is in a hurry to ask for a certain service. Therefore, Alice would like to send a request to S2 and S3. She intends to send a request to S2, since the network distance between Alice and S2 is closer than that of S3. But Alice never requests services from S2; she is not sure whether S2 can be used. Thus, it is essential to predict the QoS on server S2 such that it can provide services to Alice in the condition that S1 is out-of-service and avoids wasting time. Based on the idea of collaborative filtering, if Lucy or other neighbors have requested a service on server S2 before, she/they can do a great favor for predicting the QoS on server S2. By considering users’ and services’ location information and predicting the QoS of services, we can select appropriate services for users and improve the user-perceived experience.


### 3.3. Framework of LANFM Model

This section introduces the framework of the LANFM model for predicting QoS values in Figure3. The detailed procedures are given in the following:(i)
The information of users and services is firstly collected to be stored in the local database. After a series of data processing, users’ location information, services’ location information, user-service invocation matrix (e.g., the historical QoS information that users perceive on services), and other additional requisite information can be obtained(ii)
The user information (e.g., user id, user ASN (autonomous system number) id, and user country id) and the service information (e.g., service id, service ASN id, and service country id) are expressed as one-hot encoding vectors (it is a way of encoding; for an n-dimensional vector, only one element is 1, and the others are 0. The details will be introduced in Section4). Further, these one-hot encoding vectors are concatenated as an input feature vector for every historical usage record(iii)
The one-hot encoding vectors are represented as embedding vectors by exploiting neural network techniques. Then, the inner products between users’ embedding vectors and services’ embedding vectors are used to capture the interactions between users and services(iv)
The QoS value for pairwise user-service can be predicted by summing the inner product of embedding vectors and the weighted sum of feature vectors, namely, the embedding based location-aware factorization machine modelFigure 3
Framework of our LANFM model.Note that an AS (autonomous system) is a small unit that has the authority to autonomously determine which routing protocol to use in the system. AS is an independently manageable network unit (e.g., a university, an enterprise, or a company). Every AS has an individual id. It is known as ASN. ASNs are important because the ASN uniquely identifies each network on the Internet.Figure3 gives the overall framework of our LANFM model. The core part of our approach is the location-aware factorization machine model. To better describe the model, we give an illustration as shown in Figure 4. Firstly, the user information (user id, user ASN id, and user country id) and the service information (service id, service ASN id, and service country id) are expressed as one-hot encodings (e.g., one-hot encoding vectors: (1 0), (0 1 0), (1 0 0 0 0), (0 1 0), (0 1 0 0), (1 0 0 0)). Secondly, the one-hot encoding forms of the user information and the service information are represented as various embedding vectors (e.g., V1,V4,V6,V12,V15,V18) by applying neural network technique. Thirdly, the inner products of embedding vectors (i.e., the user information embedding vectors and the service information embedding vectors (e.g., V1,V4,V4,V6,V6,V12,V12,V15,V15,V18)), along with the weighted sum of feature vectors (e.g., w1x1,w4x4,w6x6,w12x12,w18x18), are leveraged to predict the QoS values. Finally, the prediction score for pairwise user-service can be acquired (e.g., y^).Figure 4
An illustration of LANFM model.


## 3.1. Problem Description

We aim to achieve accurate QoS prediction for users by making full use of the historical QoS invocation records, services’ location information, and users’ location information in this paper. The details of the problem are described as follows.SupposeU={u1,u2,…,um} and S={s1,s2,…,sn} are a set of m users and n services, respectively. Q∈Rm×n is the matrix between m users and n services. qij is the element in Q, and many of their values are missing. Our goal is to predict the missing values in the matrix Q by exploiting the relationships between the existing elements.An example is displayed in Figure1 to help comprehend the problem of QoS prediction. The invocation matrix between users (e.g., U1, U2, U3, U4) and services (e.g., S1, S2, S3, S4, S5) is exhibited in the upper part of Figure 1. Every element in the invocation matrix stands for a QoS attribute value (e.g., response time or throughput). Then, the problem we investigate is transformed to how to accurately predict the missing elements in the invocation matrix based on the existing elements. It could be found that only a part of services have been invoked by users. For instance, U1 has invoked S1, S3, and S4. U4 has observed QoS information on S1, S2, and S5. There still exist a small amount of common services, although not every user has invoked all services. We can complete the invocation matrix by applying the idea of collaborate filtering with the help of these common services. The complete matrix is shown in the lower part.Figure 1
An example of QoS prediction.


## 3.2. Motivation

The user-perceived QoS (such as throughput, reliability, and response time) associates with network status, geographical location, and service runtime environment closely. Network performance is related to network bandwidth, network latency, and network distance intensively. Among the several network performance influence factors, the location information is one of the key factors. Location information can affect the behavior of users [30]. In general, if the Web service is deployed in the user’s network (e.g., a local area network or a subnet), then, the Web server is more likely to respond to the user in a short period of time. That is, the response time between the user and the Web server is short, when a user invokes the Web service. Conversely, if the Web service is deployed far away from the user (e.g., across multiple subnets), there will be a long time before the Web server responds to the service user. This phenomenon is the same with the fact that when a user visits local websites, the Web page will soon respond to him/her. When the user visits foreign websites, it is often relatively slow to respond to him/her. This is because long-distance requests and responses on the Internet often need to be routed and forwarded multiple times, which is time-consuming. Figure 2 shows a toy example to illustrate why considering services’ and users’ location information to predict services’ QoS is important.Figure 2
A toy example of the influence of the location information.Assuming that Alice and Jack are two different service users. They lie in two remote networks. Web servers (e.g., S1, S2, and S3) are deployed in different kinds of networks and provide similar services. When Alice requests services, server S1 will answer the requirement of Alice and provide services to her, since the network distance between Alice and S1 is closer than that of S2 and S3. However, if S1 is invalid or has high latency, it will not answer Alice in time. At the same time, Alice is in a hurry to ask for a certain service. Therefore, Alice would like to send a request to S2 and S3. She intends to send a request to S2, since the network distance between Alice and S2 is closer than that of S3. But Alice never requests services from S2; she is not sure whether S2 can be used. Thus, it is essential to predict the QoS on server S2 such that it can provide services to Alice in the condition that S1 is out-of-service and avoids wasting time. Based on the idea of collaborative filtering, if Lucy or other neighbors have requested a service on server S2 before, she/they can do a great favor for predicting the QoS on server S2. By considering users’ and services’ location information and predicting the QoS of services, we can select appropriate services for users and improve the user-perceived experience.


## 3.3. Framework of LANFM Model

This section introduces the framework of the LANFM model for predicting QoS values in Figure3. The detailed procedures are given in the following:(i)
The information of users and services is firstly collected to be stored in the local database. After a series of data processing, users’ location information, services’ location information, user-service invocation matrix (e.g., the historical QoS information that users perceive on services), and other additional requisite information can be obtained(ii)
The user information (e.g., user id, user ASN (autonomous system number) id, and user country id) and the service information (e.g., service id, service ASN id, and service country id) are expressed as one-hot encoding vectors (it is a way of encoding; for an n-dimensional vector, only one element is 1, and the others are 0. The details will be introduced in Section4). Further, these one-hot encoding vectors are concatenated as an input feature vector for every historical usage record(iii)
The one-hot encoding vectors are represented as embedding vectors by exploiting neural network techniques. Then, the inner products between users’ embedding vectors and services’ embedding vectors are used to capture the interactions between users and services(iv)
The QoS value for pairwise user-service can be predicted by summing the inner product of embedding vectors and the weighted sum of feature vectors, namely, the embedding based location-aware factorization machine modelFigure 3
Framework of our LANFM model.Note that an AS (autonomous system) is a small unit that has the authority to autonomously determine which routing protocol to use in the system. AS is an independently manageable network unit (e.g., a university, an enterprise, or a company). Every AS has an individual id. It is known as ASN. ASNs are important because the ASN uniquely identifies each network on the Internet.Figure3 gives the overall framework of our LANFM model. The core part of our approach is the location-aware factorization machine model. To better describe the model, we give an illustration as shown in Figure 4. Firstly, the user information (user id, user ASN id, and user country id) and the service information (service id, service ASN id, and service country id) are expressed as one-hot encodings (e.g., one-hot encoding vectors: (1 0), (0 1 0), (1 0 0 0 0), (0 1 0), (0 1 0 0), (1 0 0 0)). Secondly, the one-hot encoding forms of the user information and the service information are represented as various embedding vectors (e.g., V1,V4,V6,V12,V15,V18) by applying neural network technique. Thirdly, the inner products of embedding vectors (i.e., the user information embedding vectors and the service information embedding vectors (e.g., V1,V4,V4,V6,V6,V12,V12,V15,V15,V18)), along with the weighted sum of feature vectors (e.g., w1x1,w4x4,w6x6,w12x12,w18x18), are leveraged to predict the QoS values. Finally, the prediction score for pairwise user-service can be acquired (e.g., y^).Figure 4
An illustration of LANFM model.


## 4. Location-Aware Factorization Machine Model

In this section, we give the details of our location-aware factorization machine approach for predicting QoS values. Our LANFM model mainly consists of three components: location information processing, embedding based factorization machine model, and model learning. The details of these components are shown in the following subsections.


### 4.1. Location Information Processing

The processing of Web services’ and users’ location information is presented in this section, which is the basis of our location-aware factorization machine model.The original location information of Web services and users in our dataset is presented in Tables1 and 2, respectively. Web services’ location information includes Web service id, WSDL address (URL), service provider name, and service’s country name. Users’ location information consists of user id, user’s IP address, user’s country name, longitude, and latitude. To obtain the more exact services’ location information and users’ location information, we map the WSDL address and the user’s IP address to ASN (Since the WSDL address of Web service is already known, it is easy to transfer the DNS (Domain Name System) of the URL to IP address and then map the IP address to ASN). The mapping operation is done by leveraging the GeoLite Autonomous System Number Database (http://www.maxmind.com). After a series of processing, the final representations of Web services’ location information and users’ location information are correspondingly listed in Tables 3 and 4.Table 1
Original location information of Web service.
Web Service ID WSDL Address Provider Name Country Name 1 http://www.clearsale.com.br/aplicacao/entrada.asmx?WSDL clearsale.com.br United States  2 http://www.law.uni-sofia.bg/_vti_bin/People.asmx?wsdl uni-sofia.bg Bulgaria  3 http://www.etfo.ca/_vti_bin/Authentication.asmx?wsdl etfo.ca Canada  4 http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL webxml.com.cn China  5 http://www.emris.cz/_vti_bin/BusinessDataCatalog.asmx?wsdl emris.cz Czech RepublicTable 2
Original location information of users.
User ID IP Address of the User Country Longitude Latitude 1 12.108.127.138 America 40.44 -79.96  2 122.1.115.91 Japan 36 138  3 128.233.252.11 Canada 52.13 -106.67  4 129.242.19.196 Norway 69.67 18.97  5 202.38.99.68 China 39.93 116.39Table 3
Processed location information of Web services.
Web Service ID Country Name ASN 1 United States 33070  2 Bulgaria 5421  3 Canada 36031  4 China 23650  5 Czech Republic 43541Table 4
Processed location information of users.
User ID Country Name ASN 1 America 7018  2 Japan 4713  3 Canada 22950  4 Norway 224  5 China 4538Note that we utilize the ASN instead of IP address or WSDL address since close IP addresses (e.g., 4.67.68.0 and 4.67.64.0) do not necessarily belong to the same AS or country (e.g., Canada and Japan). This demonstrates that employing IP address to represent Web services’ and users’ location information is probably not enough to recognize neighbor users or neighbor Web services. Moreover, the distance between users on the Internet is usually measured by utilizing the Internet AS-level topology [31]. The above analyses give a reason for adopting AS to represent a user’s or service’s location rather than other geographic positions. By representing users’ and services’ location information as the aforementioned form, it is accurate and easy for us to measure the closeness between users and Web services.


### 4.2. Embedding Based Factorization Machine Model

We obtain the user id, user’s country name, user’s ASN, service id, service’s country name, and service’s ASN through the location information processing. Then, we transform user’s country name and ASN to user’s country id and ASN id, respectively. The service’s country name and ASN also undergo the same transformation. Further, we utilize one-hot encoding to represent user id, service id, user’s country id, user’s ASN id, service’s country id, and service’s ASN id (i.e., the ID layer in Figure5). One-hot encoding is an effective encoding method, which uses n bit state registers to encode n states. Each state has its own register bit, and at any time, only one of them is valid [32]. Table 5 presents an example to express seven continents by one-hot encoding.Table 5
One-hot encoding representation of seven continents.
Name One-hot Encoding Asia 1000000  Africa 0100000  North America 0010000  South America 0001000  Antarctica 0000100  Europe 0000010  Oceania 0000001Figure 5
The procedure of embedding vectors.The mapping of one-hot encoding to embedding is through a fully connected layer. Embedding is a very popular neural network technique in recent years. It attempts to learn feature interactions from original input data. Embedding projects the data from high-order resource space to low-order target space [33]. The LANFM model can generalize to unobserved feature combinations and preserve the structure by leveraging embedding techniques. For example, we have two types of features: goods = {watch,necklace} with gender = {male,female}, and get a new cross features set: goods_gender = {watch-male,necklace-female,necklace-male,watch-female}. The cross features (also known as combination features) in the set mean that a male (or female) buys a watch (or a necklace). Assuming that we obtain a subset which collects the information that a male buys a watch, a female buys a watch and a female buys a necklace. But we do not get the information that a male buys a necklace and need to predict the possibility of this. It is hard to deal with this kind of problem through aforementioned methods. However, our LANFM model can handle the problem by learning the distributed representation of cross features and capturing the interactions between goods and gender.The details of the mapping procedure are the following: first of all, the one-hot encoding representation of the user information and the service information is treated as the input feature of the fully connected layer (i.e., the one-hot encoding layer in Figure5). Next, the weight of each link in the fully connected layer is calculated. Finally, the embedding representation of the user information and the service information is obtained through the fully connected layer (i.e., the embedding layer in Figure 5). The problem of high dimension can be tackled by embedding techniques. Note that the red lines in Figure 5 represent each of the dimensional values of the embedding vector. This procedure is a part of the location-aware factorization model, and the final embedding vectors are learned by stochastic gradient descent during the training process. Details about the model learning will be introduced in the following subsection.LetX denote the input feature vector. It is concatenated by the one-hot encoding representation of the user information (e.g., user id, user’s ASN id, and user’s country id) and the service information (e.g., service id, service’s ASN id, and service’s country id). Then, the embedding based factorization machine model equation is defined as(1)y^X=w0+∑i=1fwixi+∑i=1f-1∑j=i+1fVi,Vjxixj,wherein f is the length of the feature vector. Vi is the ith embedding vector. Vi,Vj is the inner product of various embedding vectors (e.g., user id embedding vector, user’s country embedding vector, user’s AS embedding vector, service id embedding vector, service’s country embedding vector, and service’s AS embedding vector). w0 is the global bias, and wi is the weight of the ith variable. The first two terms in the formula express the linear regression model. The third term is the 2-way cross feature which considers the association information between any two different features.The formula of cross features is as follows:(2)Vi,Vj=∑l=1kvil·vjl,wherein k is a hyperparameter that determines the dimension of the embedding vectors. vil is the lth value in the ith embedding vector of the user information or the service information.The interactions between various embedding vectors can be reformulated as follows:(3)∑i=1f-1∑j=i+1fVi,Vjxixj=12∑l=1k∑i=1fvilxi2-∑i=1nvil2xi2.The derivation details of Eq. (3) are in [13].


### 4.3. Model Learning

To estimate the performance of our LANFM model, we conduct a loss function to evaluate the error between the estimated value and the real value. Mathematically, the loss function of the LANFM model is represented as(4)minθ⁡Ly,y^=12∑i=1m∑j=1nIijyij-y^ij2,where Iij is the indicator function. If a user ui uses a service vj, Iij is equal to 1; otherwise, it is equal to 0. Our goal is to minimize the sum of the squared errors. In this way, we can achieve the optimal loss.Stochastic gradient descent (SGD) [34] is a universal optimization method in machine learning and deep learning. It randomly extracts a sample from the sample set at a time and updates it by gradient once after training. In the case of a large sample size, a model with an acceptable loss value can be obtained without training all the samples. In addition, the final result of the loss function is often in the vicinity of the global optimal solution. The optimization of the loss function given by Eq. (4) can be worked out by executing SGD in θ:(5)∂Ly,y^∂θ=y^-y∂y^∂θ,(6)∂y^∂θ=1,xi,xi∑j=1fvjlxj-vilxi2,ifθ=w0ifθ=wiifθ=vilThe following formula is used to update the model parameters:(7)θ=θ-η·y^-y∂y^∂θwhere θ is the model parameters (e.g., wi, vil), η>0 is the learning rate, and η controls the speed of gradient descent.


### 4.4. Complexity Analysis

The main computation of our location-aware factorization machine model is the evaluation of the loss functionL and its gradients against the variables. We only need to calculate all of the l in the formula ∑j=1fvjlxj in the first time when iterating parameters, because xi∑j=1fvjlxj-vilxi2 associates with l closely. And then, all gradients of vjl can be obtained easily. Evidently, the complexity of calculating entire l in the formula ∑j=1fvjlxj is O(kf). The complexity of calculating every gradient of the parameter is O(1) when ∑j=1fvjlxj is known. After obtaining the gradient of parameters, the time complexity of updating parameters is O(1). In total, there are kf+f+1 parameters to be estimated in the LANFM model. Therefore, the time complexity of our LANFM model is O(kf). In a word, the training time complexity of our LANFM model is linear. The above analysis process indicates the efficiency and scalability of our LANFM model.


## 4.1. Location Information Processing

The processing of Web services’ and users’ location information is presented in this section, which is the basis of our location-aware factorization machine model.The original location information of Web services and users in our dataset is presented in Tables1 and 2, respectively. Web services’ location information includes Web service id, WSDL address (URL), service provider name, and service’s country name. Users’ location information consists of user id, user’s IP address, user’s country name, longitude, and latitude. To obtain the more exact services’ location information and users’ location information, we map the WSDL address and the user’s IP address to ASN (Since the WSDL address of Web service is already known, it is easy to transfer the DNS (Domain Name System) of the URL to IP address and then map the IP address to ASN). The mapping operation is done by leveraging the GeoLite Autonomous System Number Database (http://www.maxmind.com). After a series of processing, the final representations of Web services’ location information and users’ location information are correspondingly listed in Tables 3 and 4.Table 1
Original location information of Web service.
Web Service ID WSDL Address Provider Name Country Name 1 http://www.clearsale.com.br/aplicacao/entrada.asmx?WSDL clearsale.com.br United States  2 http://www.law.uni-sofia.bg/_vti_bin/People.asmx?wsdl uni-sofia.bg Bulgaria  3 http://www.etfo.ca/_vti_bin/Authentication.asmx?wsdl etfo.ca Canada  4 http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL webxml.com.cn China  5 http://www.emris.cz/_vti_bin/BusinessDataCatalog.asmx?wsdl emris.cz Czech RepublicTable 2
Original location information of users.
User ID IP Address of the User Country Longitude Latitude 1 12.108.127.138 America 40.44 -79.96  2 122.1.115.91 Japan 36 138  3 128.233.252.11 Canada 52.13 -106.67  4 129.242.19.196 Norway 69.67 18.97  5 202.38.99.68 China 39.93 116.39Table 3
Processed location information of Web services.
Web Service ID Country Name ASN 1 United States 33070  2 Bulgaria 5421  3 Canada 36031  4 China 23650  5 Czech Republic 43541Table 4
Processed location information of users.
User ID Country Name ASN 1 America 7018  2 Japan 4713  3 Canada 22950  4 Norway 224  5 China 4538Note that we utilize the ASN instead of IP address or WSDL address since close IP addresses (e.g., 4.67.68.0 and 4.67.64.0) do not necessarily belong to the same AS or country (e.g., Canada and Japan). This demonstrates that employing IP address to represent Web services’ and users’ location information is probably not enough to recognize neighbor users or neighbor Web services. Moreover, the distance between users on the Internet is usually measured by utilizing the Internet AS-level topology [31]. The above analyses give a reason for adopting AS to represent a user’s or service’s location rather than other geographic positions. By representing users’ and services’ location information as the aforementioned form, it is accurate and easy for us to measure the closeness between users and Web services.


## 4.2. Embedding Based Factorization Machine Model

We obtain the user id, user’s country name, user’s ASN, service id, service’s country name, and service’s ASN through the location information processing. Then, we transform user’s country name and ASN to user’s country id and ASN id, respectively. The service’s country name and ASN also undergo the same transformation. Further, we utilize one-hot encoding to represent user id, service id, user’s country id, user’s ASN id, service’s country id, and service’s ASN id (i.e., the ID layer in Figure5). One-hot encoding is an effective encoding method, which uses n bit state registers to encode n states. Each state has its own register bit, and at any time, only one of them is valid [32]. Table 5 presents an example to express seven continents by one-hot encoding.Table 5
One-hot encoding representation of seven continents.
Name One-hot Encoding Asia 1000000  Africa 0100000  North America 0010000  South America 0001000  Antarctica 0000100  Europe 0000010  Oceania 0000001Figure 5
The procedure of embedding vectors.The mapping of one-hot encoding to embedding is through a fully connected layer. Embedding is a very popular neural network technique in recent years. It attempts to learn feature interactions from original input data. Embedding projects the data from high-order resource space to low-order target space [33]. The LANFM model can generalize to unobserved feature combinations and preserve the structure by leveraging embedding techniques. For example, we have two types of features: goods = {watch,necklace} with gender = {male,female}, and get a new cross features set: goods_gender = {watch-male,necklace-female,necklace-male,watch-female}. The cross features (also known as combination features) in the set mean that a male (or female) buys a watch (or a necklace). Assuming that we obtain a subset which collects the information that a male buys a watch, a female buys a watch and a female buys a necklace. But we do not get the information that a male buys a necklace and need to predict the possibility of this. It is hard to deal with this kind of problem through aforementioned methods. However, our LANFM model can handle the problem by learning the distributed representation of cross features and capturing the interactions between goods and gender.The details of the mapping procedure are the following: first of all, the one-hot encoding representation of the user information and the service information is treated as the input feature of the fully connected layer (i.e., the one-hot encoding layer in Figure5). Next, the weight of each link in the fully connected layer is calculated. Finally, the embedding representation of the user information and the service information is obtained through the fully connected layer (i.e., the embedding layer in Figure 5). The problem of high dimension can be tackled by embedding techniques. Note that the red lines in Figure 5 represent each of the dimensional values of the embedding vector. This procedure is a part of the location-aware factorization model, and the final embedding vectors are learned by stochastic gradient descent during the training process. Details about the model learning will be introduced in the following subsection.LetX denote the input feature vector. It is concatenated by the one-hot encoding representation of the user information (e.g., user id, user’s ASN id, and user’s country id) and the service information (e.g., service id, service’s ASN id, and service’s country id). Then, the embedding based factorization machine model equation is defined as(1)y^X=w0+∑i=1fwixi+∑i=1f-1∑j=i+1fVi,Vjxixj,wherein f is the length of the feature vector. Vi is the ith embedding vector. Vi,Vj is the inner product of various embedding vectors (e.g., user id embedding vector, user’s country embedding vector, user’s AS embedding vector, service id embedding vector, service’s country embedding vector, and service’s AS embedding vector). w0 is the global bias, and wi is the weight of the ith variable. The first two terms in the formula express the linear regression model. The third term is the 2-way cross feature which considers the association information between any two different features.The formula of cross features is as follows:(2)Vi,Vj=∑l=1kvil·vjl,wherein k is a hyperparameter that determines the dimension of the embedding vectors. vil is the lth value in the ith embedding vector of the user information or the service information.The interactions between various embedding vectors can be reformulated as follows:(3)∑i=1f-1∑j=i+1fVi,Vjxixj=12∑l=1k∑i=1fvilxi2-∑i=1nvil2xi2.The derivation details of Eq. (3) are in [13].


## 4.3. Model Learning

To estimate the performance of our LANFM model, we conduct a loss function to evaluate the error between the estimated value and the real value. Mathematically, the loss function of the LANFM model is represented as(4)minθ⁡Ly,y^=12∑i=1m∑j=1nIijyij-y^ij2,where Iij is the indicator function. If a user ui uses a service vj, Iij is equal to 1; otherwise, it is equal to 0. Our goal is to minimize the sum of the squared errors. In this way, we can achieve the optimal loss.Stochastic gradient descent (SGD) [34] is a universal optimization method in machine learning and deep learning. It randomly extracts a sample from the sample set at a time and updates it by gradient once after training. In the case of a large sample size, a model with an acceptable loss value can be obtained without training all the samples. In addition, the final result of the loss function is often in the vicinity of the global optimal solution. The optimization of the loss function given by Eq. (4) can be worked out by executing SGD in θ:(5)∂Ly,y^∂θ=y^-y∂y^∂θ,(6)∂y^∂θ=1,xi,xi∑j=1fvjlxj-vilxi2,ifθ=w0ifθ=wiifθ=vilThe following formula is used to update the model parameters:(7)θ=θ-η·y^-y∂y^∂θwhere θ is the model parameters (e.g., wi, vil), η>0 is the learning rate, and η controls the speed of gradient descent.


## 4.4. Complexity Analysis

The main computation of our location-aware factorization machine model is the evaluation of the loss functionL and its gradients against the variables. We only need to calculate all of the l in the formula ∑j=1fvjlxj in the first time when iterating parameters, because xi∑j=1fvjlxj-vilxi2 associates with l closely. And then, all gradients of vjl can be obtained easily. Evidently, the complexity of calculating entire l in the formula ∑j=1fvjlxj is O(kf). The complexity of calculating every gradient of the parameter is O(1) when ∑j=1fvjlxj is known. After obtaining the gradient of parameters, the time complexity of updating parameters is O(1). In total, there are kf+f+1 parameters to be estimated in the LANFM model. Therefore, the time complexity of our LANFM model is O(kf). In a word, the training time complexity of our LANFM model is linear. The above analysis process indicates the efficiency and scalability of our LANFM model.


## 5. Empirical Study

In this section, we carry out a series of empirical studies on a public dataset. Moreover, the LANFM model is compared against several baseline approaches to verify the effectiveness of our LANFM model, and we analyze the experimental results.In the following subsections, the detailed statistics of the WSDream dataset is depicted in Section5.1. The evaluation metrics are shown in Section 5.2. The performance comparison between the proposed LANFM model and other baseline methods is introduced in Section 5.3. The impact of parameters (e.g., matrix density, dimension of embedding vectors, and batch size [35]) (it is the size of each batch of data, i.e., how many samples are trained in each iteration) and experimental results discussion are presented in Sections 5.4, 5.5, and 5.6, respectively.


### 5.1. Dataset Description

We implement a collection of experiments on a real-world dataset: WSDream (https://wsdream.github.io/dataset/wsdream_dataset1.html). The location distribution of users and services is shown in Figure6. The WSDream dataset includes 339 distributed users, 5,825 services, and 1,974,675 historical invocation logs between users and services. The numbers of users’ ASs and Web services’ ASs are 137 and 1021. The QoS properties in the WSDream dataset are response time and throughput. The values of response time range from 0 to 20. The throughput values vary from 0 to 1000. The details of our dataset are described in Table 6.Table 6
Statistics of Web service QoS dataset.
Statistics Values Number of Service Users 339  Number of Web Services 5825  Number of Web Services Invocations 1,974,675  Range of Response Time 0-20s  Range of Throughput 0-1000kbps  Number of Users ASs 137  Number of Users Countries 31  Number of Web Services ASs 1021  Number of Web Services Countries 74Figure 6
Location distribution: (a) service users’ location distribution, with 339 service users distributed in 31 countries; (b) Web services’ location distribution, with 5825 Web services distributed in 74 countries. There are 1,974,675 invocation records between the users in (a) and the services in (b).
(a)
Service users’ location distribution (b)
Web services’ location distributionIn this paper, we attempt to predict the above-mentioned two QoS attributes for users. Our LANFM model is suitable for predicting any QoS attributes, with proper modification of the QoS attribute in the user-service invocation matrix.


### 5.2. Evaluation Metrics

We employ two evaluation metrics, Mean Absolute Error (MAE) and Normalized Mean Absolute Error (NMAE), to measure the performance of our proposed approach. These two metrics measure the proximity between the predicted values and the real values [36]. MAE is denoted as (8)MAE=∑ijr^ij-rijN,and the mathematical expression of NMAE is (9)NMAE=MAE∑ijrij/N.Here, N is the number of predicted QoS values, r^ij is the predicted QoS values, and rij is the real QoS values in the dataset. Smaller values of MAE and NMAE will lead to a better performance of the model.


### 5.3. Performance Comparison

To evaluate the performance of our LANFM model, the following baseline approaches are introduced for comparison. The baseline methods vary from memory-based collaborative filtering approaches and model-based collaborative filtering approaches to hybrid collaborative filtering approaches:(1)
UIPCC [4]: this method unifies the user-based collaborative filtering approach and item-based collaborative filtering approach to predict QoS for users. It is based on finding similar users and similar services(2)
PMF (probabilistic matrix factorization) [37]: this method assumes the data distribution is a Gaussian distribution. It factorizes the user-service invocation matrix to user-latent matrix and service-latent matrix. Then it uses the multiplication of these two latent matrices to predict QoS for users(3)
NMF (nonnegative matrix factorization) [38]: this method also exploits the user-service invocation matrix to obtain user-latent matrix and service-latent matrix. But it adds a constraint that the factorized latent matrices should be nonnegative(4)
NIMF (neighborhood-integrated matrix factorization) [5]: this approach firstly computes the similarities between any two users. Then, it combines the similar users’ information and QoS records to conduct matrix factorization. Finally, it predicts QoS for users(5)
EFMPred (embedding based factorization machine) [14]: this approach firstly embeds the user id and service id to vectors. Then, it uses factorization machine to predict QoS for users(6)
RegionKNN (region K nearest neighbors) [27]: this approach firstly clusters users and services on the basis of the location information and QoS values. Then it employs the clustering results to predict QoS for users(7)
LACF (location-aware collaborative filtering) [12]: this approach incorporates users’ and services’ locations and employs a location-aware collaborative filtering approach to predict QoS for users(8)
LBR (location-based regularization) [28]: this approach uses the local connectivity between users and combines regularization terms in classical matrix factorization framework to predict QoS for users(9)
HMF (hierarchical matrix factorization) [29]: this approach firstly groups users and services according to the location information. Then, it unifies the results from local matrix factorization and global matrix factorization to predict QoS for usersIn reality, only a portion of services are invoked by users. Thus, the invocation matrix between users and services is considerably sparse. We divide the dataset into training set and testing set by randomly removing a proportion of elements from the invocation matrix between users and services. For instance, if we remove 90% elements from the invocation matrix, then these 90% elements are regarded as testing set; the rest of 10% elements are treated as training set.The performance comparison results between our LANFM model and other baseline approaches are shown in Table7. It could be found that LANFM always achieves the best performance in both evaluation metrics (i.e., MAE and NMAE), no matter whether the QoS property is response time or throughput. Specifically, the performance of matrix factorization-based methods (e.g., PMF, NMF, NIMF, LBR, and HMF) is better than memory-based methods (e.g., UIPCC, LACF, and RegionKNN) due to learning the latent factors. In addition, factorization machine-based methods (e.g., EFMPred and LANFM) outperform the matrix factorization-based methods due to learning the cross features of the user information and the service information. Furthermore, LANFM outperforms EFMPred as a result of considering more important features (e.g., users’ location information and services’ location information). Compared with EFMPred, LANFM has a performance improvement of 0.06% to 6.98% in response time and a performance improvement of 1.52% to 3.46% in throughput. Moreover, when the training data is sparser, the performance improvement is more obvious. In reality, the data we obtain is very sparse. The observation demonstrates that our LANFM model can be applied to sparse data. Here, only a part of the results (e.g., 10%, 20%, 80%, and 90%) is presented in the table. The experimental results under all matrix density will be introduced in Section 5.4.Table 7
Quality of services prediction accuracy comparison.
QoS Properties Methods Matrix Density=10% Matrix Density=20% Matrix Density=80% Matrix Density=90% MAE NMAE MAE NMAE MAE NMAE MAE NMAE Response Time (0-20s) UIPCC 0.5842 0.6433 0.4514 0.4970 0.3475 0.3822 0.3443 0.3785 LACF 0.5612 0.6181 0.4778 0.5262 0.3692 0.4062 0.3637 0.3995 RegionKNN 0.5491 0.6048 0.5155 0.5677 0.4950 0.5446 0.4860 0.5338 PMF 0.4865 0.5361 0.4305 0.4743 0.3751 0.4123 0.3733 0.4098 NMF 0.4774 0.5261 0.4269 0.4703 0.3723 0.4093 0.3705 0.4068 NIMF 0.4792 0.5281 0.4202 0.4630 0.3665 0.4029 0.3677 0.4037 LBR 0.4806 0.5293 0.4301 0.4737 0.3761 0.4138 0.3736 0.4103 HMF 0.4815 0.5302 0.4298 0.4732 0.3734 0.4110 0.3698 0.4070 EFMPred 0.3878 0.4083 0.3332 0.3606 0.2641 0.2910 0.2599 0.2825 LANFM 0.3607 0.3966 0.3247 0.3571 0.2635 0.2903 0.2577 0.2823 Improve 6.98 % 2.85 % 2.55 % 0.97 % 0.24 % 0.25 % 0.84 % 0.06 %  Throughput (0-1000kbps) UIPCC 22.3274 0.4700 18.8646 0.3966 13.5460 0.2845 13.0623 0.2776 LACF 19.4303 0.4087 16.4495 0.3459 12.4200 0.2609 12.1073 0.2545 RegionKNN 24.8487 0.5226 24.0169 0.5050 24.0414 0.5050 23.9013 0.5023 PMF 15.9794 0.3362 13.9052 0.2924 12.1408 0.2551 11.9442 0.2520 NMF 15.5678 0.3275 13.5386 0.2847 11.9260 0.2506 11.7964 0.2489 NIMF 15.1393 0.3185 13.1799 0.2772 11.8641 0.2493 11.7977 0.2489 LBR 15.4431 0.3248 13.6455 0.2869 12.1012 0.2542 11.9560 0.2513 HMF 15.7076 0.3304 13.5961 0.2859 11.6637 0.2450 11.5562 0.2429 EFMPred 13.2966 0.2811 11.4295 0.2417 8.6713 0.1829 8.3839 0.1773 LANFM 12.8365 0.2714 11.0560 0.2338 8.5160 0.1796 8.2561 0.1746 Improve 3.46 % 3.45 % 3.27 % 3.27 % 1.79 % 1.80 % 1.52 % 1.52 %


### 5.4. Impact of Matrix Density

Matrix density is a significant parameter that affects the accuracy of QoS prediction. It means how many historical invocation records between users and services we can exploit to help predict QoS values. The density of the invocation matrix is changed from 10% to 90% to study the effect of matrix density. The step size is set as 10%. In this experiment, the dimension of embedding vector for response time is 30. With respect to throughput, the dimension value is 1400. The batch size is 4096.Figures7(a) and 7(b) display the prediction performance of all methods on response time in terms of MAE and NMAE. Figures 7(a) and 7(b) show that when the matrix density is increased from 10% to 50%, the downward trend in the values of MAE and NMAE is significant. However, when we increase the density from 50% to 90%, the decrease in the values of MAE and NMAE is relatively slow. The trends of Figures 7(c) and 7(d) are the same with Figures 7(a) and 7(b). This phenomenon indicates that it is reasonable to evaluate the performance of the model by regrading matrix density as a parameter. All observations on Figure 7 demonstrate that increasing QoS information appropriately is helpful to tackle the problem of data sparsity. Further, increasing QoS information appropriately is also conducive to improve QoS prediction results.Figure 7
Impact of matrix density.
(a) (b) (c) (d)


### 5.5. Impact of Dimension

The dimension of embedding vectors is another parameter affecting the performance of the LANFM model. It decides how many factors are used to describe the feature. In this experiment, the dimension of the embedding vector for response time is changed from 5 to 50 to study the influence of the dimension. In addition, the step size is set as 5. For throughput, the dimension value is varied from 200 to 1800 and the step size is 200. The batch size is 4096.Figures8(a)–8(f) present the prediction performance of the LANFM model on response time, where the matrix densities are accordingly set as 10%, 50%, and 90%. The experimental results analyses of response time are as follows: (1) for 10%, the MAE value and NMAE value increase with the increment of dimension. This observation shows that when the matrix is considerably sparse, a small dimension may be suitable to enhance the QoS prediction accuracy. (2) For 50% and 90%, the MAE value and NMAE value exhibit a downward tendency at the beginning and then present an upward tendency. The lowest MAE and NMAE values are achieved at dimension=30 for 50% and dimension=35 for 90%, respectively. This observation shows that when the matrix is dense, a relatively large dimension can better improve the accuracy of QoS prediction. Nevertheless, if the dimension is set too large, it may induce the problem of overfitting, leading to poor prediction results.Figure 8
Impact of embedding vector dimension.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)Figures8(g)–8(l) show the prediction performance of the LANFM model on throughput, where the matrix densities are correspondingly set as 10%, 50%, and 90%. Note that the scale of dimension is divided by 100 for better display. The experimental results analyses of throughput are as follows: (1) for 10% and 90%, the MAE and NMAE values of throughput decrease at first and then increase. The best MAE and NMAE values can be achieved at 600 and 1400, respectively. (2) For 50%, it indicates that the MAE and NMAE values of throughput show an overall downward trend, when the dimension of the embedding vector grows from 200 to 1800. Specifically, when the dimension is from 200 to 1400, the MAE and NMAE values decline quickly, and then it gradually converges. The MAE and NMAE values oscillate around the local minimum, when varying the dimension from 1400 to 1800. The first minimum can be obtained when the dimension is 1400. Although we can also obtain the minimum at 1800, the lager dimension requires greater time complexity.The observations on Figures8(g)–8(l) indicate that when the matrix is very sparse, a small dimension of embedding vector is better to generate accurate QoS values. While the matrix is dense, a relatively large dimension can improve the accuracy of QoS prediction. Notice that the dimension of response time is smaller than that of throughput, since the scale of throughput value is larger than that of response time.


### 5.6. Impact of Batch Size

Batch size defines the number of training samples to be shown to the network before a weight update can be performed. The batch size is determined by comprehensively considering the training time and the convergence speed. When the batch size is set larger, the training speed of each epoch is faster. But the convergence speed is slower. To study the effect of the batch size, we change the batch size from 64 to 5120 for both of the QoS properties. In this experiment, the densities of the invocation matrix are set as 10%, 50%, and 90%. The dimension of embedding vector for response time is 30. For throughput, it is set as 1400. It is worthwhile to note that 5120 is the maximum memory of our GPU.The prediction performance of the LANFM model on response time is presented in Figures9(a)–9(f), and we can observe the following: (1) for 10%, the MAE value and NMAE value decrease significantly when increasing the batch size from 64 to 1024. While it is from 1024 to 5120, both values oscillate around the local minimum. We can obtain the best value at 4096. (2) For 50%, the MAE value and NMAE value decrease significantly when increasing the batch size from 64 to 1024. While the batch size is from 1024 to 3072, the downward speeds of MAE value and NMAE value become slow. Finally, both of MAE and NMAE values converge. This observation demonstrates that when the batch size is small, enlarging the batch size can enhance the QoS prediction accuracy greatly. When it comes to a relatively large batch size, the improvement is less obvious. (3) For 90%, the MAE and NMAE values decline quickly when the batch size is from 64 to 2048 and then up to the minimum at batch size = 4096. The observations indicate that when the matrix is quite sparse, a small batch size (e.g., 1024) is quite useful for improving the accuracy of QoS prediction. While the matrix is dense, a lager batch size (e.g., 4096) is more useful to upgrade the accuracy of QoS prediction.Figure 9
Impact of batch size.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)As can be seen in Figures9(g)–9(l), when increasing the batch size from 64 to 3072, the MAE and NMAE values of throughput decline quickly. When the batch size is from 3072 to 5120, the MAE and NMAE values gradually converge. The observation indicates that when the batch size is small, enlarging it can greatly improve the QoS prediction accuracy. However, after exceeding a certain threshold (e.g., batch size=3072), the enhancement is not so obvious.


## 5.1. Dataset Description

We implement a collection of experiments on a real-world dataset: WSDream (https://wsdream.github.io/dataset/wsdream_dataset1.html). The location distribution of users and services is shown in Figure6. The WSDream dataset includes 339 distributed users, 5,825 services, and 1,974,675 historical invocation logs between users and services. The numbers of users’ ASs and Web services’ ASs are 137 and 1021. The QoS properties in the WSDream dataset are response time and throughput. The values of response time range from 0 to 20. The throughput values vary from 0 to 1000. The details of our dataset are described in Table 6.Table 6
Statistics of Web service QoS dataset.
Statistics Values Number of Service Users 339  Number of Web Services 5825  Number of Web Services Invocations 1,974,675  Range of Response Time 0-20s  Range of Throughput 0-1000kbps  Number of Users ASs 137  Number of Users Countries 31  Number of Web Services ASs 1021  Number of Web Services Countries 74Figure 6
Location distribution: (a) service users’ location distribution, with 339 service users distributed in 31 countries; (b) Web services’ location distribution, with 5825 Web services distributed in 74 countries. There are 1,974,675 invocation records between the users in (a) and the services in (b).
(a)
Service users’ location distribution (b)
Web services’ location distributionIn this paper, we attempt to predict the above-mentioned two QoS attributes for users. Our LANFM model is suitable for predicting any QoS attributes, with proper modification of the QoS attribute in the user-service invocation matrix.


## 5.2. Evaluation Metrics

We employ two evaluation metrics, Mean Absolute Error (MAE) and Normalized Mean Absolute Error (NMAE), to measure the performance of our proposed approach. These two metrics measure the proximity between the predicted values and the real values [36]. MAE is denoted as (8)MAE=∑ijr^ij-rijN,and the mathematical expression of NMAE is (9)NMAE=MAE∑ijrij/N.Here, N is the number of predicted QoS values, r^ij is the predicted QoS values, and rij is the real QoS values in the dataset. Smaller values of MAE and NMAE will lead to a better performance of the model.


## 5.3. Performance Comparison

To evaluate the performance of our LANFM model, the following baseline approaches are introduced for comparison. The baseline methods vary from memory-based collaborative filtering approaches and model-based collaborative filtering approaches to hybrid collaborative filtering approaches:(1)
UIPCC [4]: this method unifies the user-based collaborative filtering approach and item-based collaborative filtering approach to predict QoS for users. It is based on finding similar users and similar services(2)
PMF (probabilistic matrix factorization) [37]: this method assumes the data distribution is a Gaussian distribution. It factorizes the user-service invocation matrix to user-latent matrix and service-latent matrix. Then it uses the multiplication of these two latent matrices to predict QoS for users(3)
NMF (nonnegative matrix factorization) [38]: this method also exploits the user-service invocation matrix to obtain user-latent matrix and service-latent matrix. But it adds a constraint that the factorized latent matrices should be nonnegative(4)
NIMF (neighborhood-integrated matrix factorization) [5]: this approach firstly computes the similarities between any two users. Then, it combines the similar users’ information and QoS records to conduct matrix factorization. Finally, it predicts QoS for users(5)
EFMPred (embedding based factorization machine) [14]: this approach firstly embeds the user id and service id to vectors. Then, it uses factorization machine to predict QoS for users(6)
RegionKNN (region K nearest neighbors) [27]: this approach firstly clusters users and services on the basis of the location information and QoS values. Then it employs the clustering results to predict QoS for users(7)
LACF (location-aware collaborative filtering) [12]: this approach incorporates users’ and services’ locations and employs a location-aware collaborative filtering approach to predict QoS for users(8)
LBR (location-based regularization) [28]: this approach uses the local connectivity between users and combines regularization terms in classical matrix factorization framework to predict QoS for users(9)
HMF (hierarchical matrix factorization) [29]: this approach firstly groups users and services according to the location information. Then, it unifies the results from local matrix factorization and global matrix factorization to predict QoS for usersIn reality, only a portion of services are invoked by users. Thus, the invocation matrix between users and services is considerably sparse. We divide the dataset into training set and testing set by randomly removing a proportion of elements from the invocation matrix between users and services. For instance, if we remove 90% elements from the invocation matrix, then these 90% elements are regarded as testing set; the rest of 10% elements are treated as training set.The performance comparison results between our LANFM model and other baseline approaches are shown in Table7. It could be found that LANFM always achieves the best performance in both evaluation metrics (i.e., MAE and NMAE), no matter whether the QoS property is response time or throughput. Specifically, the performance of matrix factorization-based methods (e.g., PMF, NMF, NIMF, LBR, and HMF) is better than memory-based methods (e.g., UIPCC, LACF, and RegionKNN) due to learning the latent factors. In addition, factorization machine-based methods (e.g., EFMPred and LANFM) outperform the matrix factorization-based methods due to learning the cross features of the user information and the service information. Furthermore, LANFM outperforms EFMPred as a result of considering more important features (e.g., users’ location information and services’ location information). Compared with EFMPred, LANFM has a performance improvement of 0.06% to 6.98% in response time and a performance improvement of 1.52% to 3.46% in throughput. Moreover, when the training data is sparser, the performance improvement is more obvious. In reality, the data we obtain is very sparse. The observation demonstrates that our LANFM model can be applied to sparse data. Here, only a part of the results (e.g., 10%, 20%, 80%, and 90%) is presented in the table. The experimental results under all matrix density will be introduced in Section 5.4.Table 7
Quality of services prediction accuracy comparison.
QoS Properties Methods Matrix Density=10% Matrix Density=20% Matrix Density=80% Matrix Density=90% MAE NMAE MAE NMAE MAE NMAE MAE NMAE Response Time (0-20s) UIPCC 0.5842 0.6433 0.4514 0.4970 0.3475 0.3822 0.3443 0.3785 LACF 0.5612 0.6181 0.4778 0.5262 0.3692 0.4062 0.3637 0.3995 RegionKNN 0.5491 0.6048 0.5155 0.5677 0.4950 0.5446 0.4860 0.5338 PMF 0.4865 0.5361 0.4305 0.4743 0.3751 0.4123 0.3733 0.4098 NMF 0.4774 0.5261 0.4269 0.4703 0.3723 0.4093 0.3705 0.4068 NIMF 0.4792 0.5281 0.4202 0.4630 0.3665 0.4029 0.3677 0.4037 LBR 0.4806 0.5293 0.4301 0.4737 0.3761 0.4138 0.3736 0.4103 HMF 0.4815 0.5302 0.4298 0.4732 0.3734 0.4110 0.3698 0.4070 EFMPred 0.3878 0.4083 0.3332 0.3606 0.2641 0.2910 0.2599 0.2825 LANFM 0.3607 0.3966 0.3247 0.3571 0.2635 0.2903 0.2577 0.2823 Improve 6.98 % 2.85 % 2.55 % 0.97 % 0.24 % 0.25 % 0.84 % 0.06 %  Throughput (0-1000kbps) UIPCC 22.3274 0.4700 18.8646 0.3966 13.5460 0.2845 13.0623 0.2776 LACF 19.4303 0.4087 16.4495 0.3459 12.4200 0.2609 12.1073 0.2545 RegionKNN 24.8487 0.5226 24.0169 0.5050 24.0414 0.5050 23.9013 0.5023 PMF 15.9794 0.3362 13.9052 0.2924 12.1408 0.2551 11.9442 0.2520 NMF 15.5678 0.3275 13.5386 0.2847 11.9260 0.2506 11.7964 0.2489 NIMF 15.1393 0.3185 13.1799 0.2772 11.8641 0.2493 11.7977 0.2489 LBR 15.4431 0.3248 13.6455 0.2869 12.1012 0.2542 11.9560 0.2513 HMF 15.7076 0.3304 13.5961 0.2859 11.6637 0.2450 11.5562 0.2429 EFMPred 13.2966 0.2811 11.4295 0.2417 8.6713 0.1829 8.3839 0.1773 LANFM 12.8365 0.2714 11.0560 0.2338 8.5160 0.1796 8.2561 0.1746 Improve 3.46 % 3.45 % 3.27 % 3.27 % 1.79 % 1.80 % 1.52 % 1.52 %


## 5.4. Impact of Matrix Density

Matrix density is a significant parameter that affects the accuracy of QoS prediction. It means how many historical invocation records between users and services we can exploit to help predict QoS values. The density of the invocation matrix is changed from 10% to 90% to study the effect of matrix density. The step size is set as 10%. In this experiment, the dimension of embedding vector for response time is 30. With respect to throughput, the dimension value is 1400. The batch size is 4096.Figures7(a) and 7(b) display the prediction performance of all methods on response time in terms of MAE and NMAE. Figures 7(a) and 7(b) show that when the matrix density is increased from 10% to 50%, the downward trend in the values of MAE and NMAE is significant. However, when we increase the density from 50% to 90%, the decrease in the values of MAE and NMAE is relatively slow. The trends of Figures 7(c) and 7(d) are the same with Figures 7(a) and 7(b). This phenomenon indicates that it is reasonable to evaluate the performance of the model by regrading matrix density as a parameter. All observations on Figure 7 demonstrate that increasing QoS information appropriately is helpful to tackle the problem of data sparsity. Further, increasing QoS information appropriately is also conducive to improve QoS prediction results.Figure 7
Impact of matrix density.
(a) (b) (c) (d)


## 5.5. Impact of Dimension

The dimension of embedding vectors is another parameter affecting the performance of the LANFM model. It decides how many factors are used to describe the feature. In this experiment, the dimension of the embedding vector for response time is changed from 5 to 50 to study the influence of the dimension. In addition, the step size is set as 5. For throughput, the dimension value is varied from 200 to 1800 and the step size is 200. The batch size is 4096.Figures8(a)–8(f) present the prediction performance of the LANFM model on response time, where the matrix densities are accordingly set as 10%, 50%, and 90%. The experimental results analyses of response time are as follows: (1) for 10%, the MAE value and NMAE value increase with the increment of dimension. This observation shows that when the matrix is considerably sparse, a small dimension may be suitable to enhance the QoS prediction accuracy. (2) For 50% and 90%, the MAE value and NMAE value exhibit a downward tendency at the beginning and then present an upward tendency. The lowest MAE and NMAE values are achieved at dimension=30 for 50% and dimension=35 for 90%, respectively. This observation shows that when the matrix is dense, a relatively large dimension can better improve the accuracy of QoS prediction. Nevertheless, if the dimension is set too large, it may induce the problem of overfitting, leading to poor prediction results.Figure 8
Impact of embedding vector dimension.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)Figures8(g)–8(l) show the prediction performance of the LANFM model on throughput, where the matrix densities are correspondingly set as 10%, 50%, and 90%. Note that the scale of dimension is divided by 100 for better display. The experimental results analyses of throughput are as follows: (1) for 10% and 90%, the MAE and NMAE values of throughput decrease at first and then increase. The best MAE and NMAE values can be achieved at 600 and 1400, respectively. (2) For 50%, it indicates that the MAE and NMAE values of throughput show an overall downward trend, when the dimension of the embedding vector grows from 200 to 1800. Specifically, when the dimension is from 200 to 1400, the MAE and NMAE values decline quickly, and then it gradually converges. The MAE and NMAE values oscillate around the local minimum, when varying the dimension from 1400 to 1800. The first minimum can be obtained when the dimension is 1400. Although we can also obtain the minimum at 1800, the lager dimension requires greater time complexity.The observations on Figures8(g)–8(l) indicate that when the matrix is very sparse, a small dimension of embedding vector is better to generate accurate QoS values. While the matrix is dense, a relatively large dimension can improve the accuracy of QoS prediction. Notice that the dimension of response time is smaller than that of throughput, since the scale of throughput value is larger than that of response time.


## 5.6. Impact of Batch Size

Batch size defines the number of training samples to be shown to the network before a weight update can be performed. The batch size is determined by comprehensively considering the training time and the convergence speed. When the batch size is set larger, the training speed of each epoch is faster. But the convergence speed is slower. To study the effect of the batch size, we change the batch size from 64 to 5120 for both of the QoS properties. In this experiment, the densities of the invocation matrix are set as 10%, 50%, and 90%. The dimension of embedding vector for response time is 30. For throughput, it is set as 1400. It is worthwhile to note that 5120 is the maximum memory of our GPU.The prediction performance of the LANFM model on response time is presented in Figures9(a)–9(f), and we can observe the following: (1) for 10%, the MAE value and NMAE value decrease significantly when increasing the batch size from 64 to 1024. While it is from 1024 to 5120, both values oscillate around the local minimum. We can obtain the best value at 4096. (2) For 50%, the MAE value and NMAE value decrease significantly when increasing the batch size from 64 to 1024. While the batch size is from 1024 to 3072, the downward speeds of MAE value and NMAE value become slow. Finally, both of MAE and NMAE values converge. This observation demonstrates that when the batch size is small, enlarging the batch size can enhance the QoS prediction accuracy greatly. When it comes to a relatively large batch size, the improvement is less obvious. (3) For 90%, the MAE and NMAE values decline quickly when the batch size is from 64 to 2048 and then up to the minimum at batch size = 4096. The observations indicate that when the matrix is quite sparse, a small batch size (e.g., 1024) is quite useful for improving the accuracy of QoS prediction. While the matrix is dense, a lager batch size (e.g., 4096) is more useful to upgrade the accuracy of QoS prediction.Figure 9
Impact of batch size.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)As can be seen in Figures9(g)–9(l), when increasing the batch size from 64 to 3072, the MAE and NMAE values of throughput decline quickly. When the batch size is from 3072 to 5120, the MAE and NMAE values gradually converge. The observation indicates that when the batch size is small, enlarging it can greatly improve the QoS prediction accuracy. However, after exceeding a certain threshold (e.g., batch size=3072), the enhancement is not so obvious.


## 6. Conclusion

This paper proposes a location-aware factorization machine approach by leveraging the embedding technique in neural networks. Firstly, the location information of services and users is taken into account. Secondly, the user information and the service information are expressed as embedding vectors to mine the potential relationships between users and services. Finally, the inner products of embedding vectors, along with the weighted sum of feature vectors, are utilized to perform QoS prediction. There are three advantages to employ neural network techniques and factorization machine model: (1) the dimension of original input feature vectors can be reduced; (2) the problem of large data sparsity can be solved; and (3) the time complexity of our LANFM model is linear. That is to say, our LANFM model is able to solve the three shortcomings: high dimension, high time complexity, and high implementation expense. Therefore, the scalability of our LANFM model is good. It is applicable to large scale datasets. A series of comprehensive experiments are carried out on the WSDream dataset to verify the effectiveness of our LANFM model. First of all, we evaluate the performance of our approach and other state-of-the-art baseline approaches under different matrix densities, which demonstrates that our LANFM model always achieves the best performance. Then, we study the impact of the dimension of the embedding vector to determine how large it should be, which indicates that, for the two QoS properties, when the matrix is very sparse, a relatively small embedding size is good to enhance the performance; when the matrix is dense, a relatively large dimension can better improve the accuracy of QoS prediction. Finally, we investigate the effect of the batch size, which is a powerful parameter that affects the performance of optimization algorithm. The results show that, for the response time, when the matrix is quite sparse, a relatively small batch size is useful for improving the prediction performance; while the matrix is dense, a relatively large batch size is more conducive to improve the QoS prediction accuracy. For the throughput, when the batch size is relatively small, increasing the batch size will improve the predictive performance. While a certain threshold is exceeded, the improvement is less distinct.In reality, response time and throughput are dynamically changing with the network environment, so the time factor should be considered. Therefore, we will attempt to build a more powerful model, which considers the time information, to predict QoS values for users in future work. Additionally, other QoS attributes (e.g., reliability, availability, and failure probability) are rarely studied in previous work. Thus, we would like to investigate other QoS attributes in our next work.



---

*Source: 4932030-2019-04-11.xml*