# Key Quality Indicators Prediction for Web Browsing with Embedded Filter Feature Selection
## 3 Feature Weighted ML-kNN for KQI Prediction
### Data Preprocessing  
Generally, preprocessing is necessary since the service perception data acquired in the real network always suffer from missing attributes and noises. The preprocessing includes removal of abnormal samples, conversion and normalization, etc.  
(1) Constructions of initial feature set and label set  
In a mobile network (e.g., LTE), in case a user is visiting a target webpage by a web browsing APP (such as UCweb, QQ browser, etc.) on the phone, a service perception sample is then generated by the MCS agent deployed on the phone. All the samples received at the server end constitute the initial MCS dataset \(\overline{\mathbf{D}}=\left\{(\overline{x}_{i},\ \overline{Y}_{i})|1\leq i\leq m\ \right\}\). Each sample contains mainly the following attributes: Date, Time, TAC, Cell ID, Longitude, Latitude, RSRP, RSRQ, Phone ID, Phone Model, Website name, Website IP, DNS IP, \(D_{dns}\), \(D_{tcp}\), \(D_{tcp}\), and \(D_{res}\).  
Here we take a subset of the dataset field, {Date, Time, TAC, CI, Longitude, Latitude, RSRP, RSRQ, Website name, Website IP, DNS IP, Phone ID, Phone Model}, as the initial feature set \(\overline{\mathbf{x}}=\left\{\overline{x}_{1},\ \overline{x}_{2},\ldots,\overline{x}_{p}\ \right\}\), \(\mathbf{p}=13\). To make it clear, here we number them with Feature IDs from 1 to 13 in sequential order. Among these the fields {Date, Time, Longitude, Latitude, RSRP, RSRQ} are numerical, and the rest are nominal.  
The initial label set consists of all the KQI indicators \(\{D_{dns},D_{tcp},D_{req},\) and \(D_{res}\}\), and is represented as \(\overline{Y}=\left\{\overline{y}_{1},\ \overline{y}_{2}\ldots,\ \overline{y}_{q}\right\}\), \(q=4\).  
Normalization of the features  
All the numerical-valued features are normalized as follows.  
\[x_{i}=\frac{g(\overline{x}_{i})-LB(\overline{x}_{i})}{UB(\overline{x}_{i})- LB(\overline{x}_{i})},\ 1\leq i\leq m \tag{5}\]  
where \(\overline{x}_{i}\) represents the initial value of the \(i\)-th feature, and \(g(\overline{x}_{i})\) is a truncation function with an upper bound \(UB(\overline{x}_{i})\) and a lower bound \(LB(\overline{x}_{i})\), i.e.,:  
\[g(\overline{x}_{i})=\left\{\begin{array}{cc}UB(\overline{x}_{i}),&\text{if } \overline{x}_{i}>UB(\overline{x}_{i})\\ LB(\overline{x}_{i}),&\text{if }\overline{x}_{i}<LB(\overline{x}_{i})\\ \overline{x}_{i},&\text{otherwise}\end{array}\right. \tag{6}\]  
In practice, sampling error or individual difference among the phones often leads to extremely small or large sample values. To mitigate its influence, box plot method is employed to determine the lower and upper bounds for the truncation, namely,  
\[\left\{\begin{array}{cc}LB(\overline{x}_{i})=\max(Q1(\overline{x}_{i})-3 IQR( \overline{x}_{i}),\ \min(\overline{x}_{i}))\\ UB(\overline{x}_{i})=\min(Q3(\overline{x}_{i})+3 IQR(\overline{x}_{i}),\ \max( \overline{x}_{i}))\end{array}\right. \tag{7}\]  
where \(Q3(\overline{x}_{i})\) and \(Q1(\overline{x}_{i})\) represent the upper and lower quartile of box plot of the \(i\)-th feature, respectively. \(IQR(\overline{x}_{i})=Q3(\overline{x}_{i})-Q1(\overline{x}_{i})\) refers to the interquartile range.  
Boolean-conversion of labels  
For binary classification task, the labels in the dataset need to be first converted into Boolean values, with the predefined hard decision thresholds \(\{T_{1}\)\(\sim\)\(T_{q}\}\):  
\[y_{j}=\llbracket\overline{y_{j}}<T_{j}\rrbracket,1\leq j\leq q; \tag{8}\]  
The function \(\llbracket c\rrbracket\) indicates that when condition \(c\) holds, it returns 1, otherwise 0.  
Then we get the dataset \(\boldsymbol{D^{\prime}}=\{(x_{i},\ \Upsilon_{i})\big{|}1\leq i\leq m\ \}\).