# Key Quality Indicators Prediction for Web Browsing with Embedded Filter Feature Selection
## 3 Feature Weighted ML-kNN for KQI Prediction
### KQI Prediction Based on Feature Weighted ML-kNN  
ML-kNN [17; 18] is the extension of classical kNN in dealing with multi-label classification. There have been many modifications proposed thereafter. For instance, [PERSON] proposes a granular feature weighted kNN for multi-label learning based on mutual information in Reference [19]. By granulating the label space into a plurality of label granules, the feature weights are then calculated for each label granule. The features are weighted according to the label classification knowledge embedded, and then the problems arising from the explosion of label combinations and inter-label correlation in the original ML-kNN can be mitigated. As we know, the accuracy of KNN-based classifier and clustering analysis is largely dependent on the type of distance metric employed [20; 21]. For example, in [22] the performance of kNN in ECG analysis in case of Euclidean distance, Manhattan distance and correlation distance are compared, and finally Euclidean distance performs the best. For simplicity, here Euclidean distance, one of the most widely used distance measures, is employed. Generally, in the neighbor searching of ML-kNNalgorithm, the distance of samples in feature space is calculated with equal-weighted Euclidean distance. The filter feature selection is separated from the subsequent learning tasks. Nevertheless, the feature weights actually reflect how significantly each feature influences the labels. Therefore, is it possible to utilize the feature weights to intervene in the calculation of distance in the neighbor searching? It might be able to search for more effective neighbors. Considering that the KQI prediction task involves only a few number of features and labels, the main purpose of feature selection herein is not to reduce the number of features involved in the learning, but to utilize the feature weights to improve the performance of the KQI prediction instead. Therefore, a feature-weighted ML-kNN is proposed to predict the KQI. In this case, the FS process is tightly embedded into the machine learning task that follows. The UML-ReliefF is no longer an independent process as conventional filter FS does. Thus, we call it the embedded filter feature selection. In addition, from the perspective of practical scenario, it is usually necessary to use historical data samples of a few previous days to predict the service quality at the moment, so as to ensure the timeliness of the prediction. Therefore, based on the preprocessing and feature selection, the KQI prediction can be performed with feature-weighted ML-kNN. The pseudo code of the algorithm is presented in Algorithm 2. ```
Input: Initial training set \(\overline{D}\), Unknown sample \(\mathbf{x}_{0}\), Prediction window length \(L\); Output: Prediction of label vector \(\mathbf{Y}_{0}\) of unknown sample;
1. Preprocess \(\overline{D}\) according to Section 3.1 to obtain \(\mathbf{D^{\prime}}\);
2. Obtain \(\mathbf{W=(}w_{1},w_{2},\ldots,w_{p}\mathbf{)}\) according to UML-ReliefF in Section 3.2; // \(p\): dimension of feature set. 3. Sort the features according to their weights in descending order and retain Top \(N\) features, reconstruct \(\mathbf{D^{\prime}}\) to be \(\mathbf{D^{\prime\prime}}\) accordingly;
4. Select \(x_{i}\) from \(\mathbf{D^{\prime\prime}}\) where \(x_{i1}\) is in the range \((x_{01}-L,\ x_{01}-1)\);
5. Reconstruct the training set \(\mathbf{D=\{(x_{i},Y_{i})|1\leq i\leq m\prime\}\);
6. Identify \(k\)-nearest neighbors \(\mathcal{N}(\mathbf{x}_{i})\) for each \(x_{i}\) in \(\mathbf{D}\), in which the distance is calculated with weighted Euclidean distance as in Equation (10):
7. \(\text{dis}\Big{(}x_{i},\ x_{j}\Big{)}=\sqrt{\sum\limits_{n=1}^{N}w_{n}\Big{(} \mathbf{x}_{in}-\mathbf{x}_{jn}\Big{)}^{2}}\) (10)
8. for\(j=1\) to \(q\)do// \(q\)do// \(q\): dimension of label set. 9. Calculate the prior probabilities \(\mathbb{P}\big{(}H_{j}\big{)}\) and \(\mathbb{P}\big{(}\overline{H}_{j}\big{)}\) according to Equation (11):
10.