# Repetition with Learning Approaches in Massive Machine Type Communications
## 3 Repetition with Learning Approaches
According to the distance data, K samples in training set that are closest to x are determined and referred to as \(Near_{k}(x)\). Figure 2 illustrates the RLA using KNN (RLA-KNN), where \(k\) is the number of comparisons, and \(\text{L}\big{(}\text{x},\ s_{j}\big{)}\) is a measured distance. Figure 2: RLA–KNN approach. In the KNN approach, distance measurement is the most effective approach to determining the similarity between two samples. Commonly used distance measures include the Euclidean distance, Manhattan distance, Chebyshev distance, and Minkowski distance. Let the eigenspace X be an n-dimension real vector space (\(\mathbb{R}^{n}\)): \(x_{i},x_{j}\in X\); \(x_{i}=\left(x_{i}^{1},x_{i}^{2},\ldots,x_{i}^{n}\right)^{T}\); and \(x_{j}=\left(x_{j}^{1},x_{j}^{2},\ldots,x_{j}^{n}\right)^{T}\). The distance between \(x_{i}\) and \(x_{j}\) is defined as [33]:  
\[L_{p}\big{(}x_{i},\ x_{j}\big{)}=\left(\sum_{l=1}^{n}\Bigl{|}x_{i}^{(l)}-x_{j}^ {(l)}\Bigr{|}^{p}\right)^{1/p} \tag{3}\]  
When \(p\geq 1\), the Minkowski distance is derived. When \(p=1\), the Manhattan distance is derived. When \(p=2\), the Euclidean distance is obtained. When \(p=\infty\), the Chebyshev distance is derived. In the RLA-KNN, we set the \(p\) to 2, using distance measures by Euclidean distance. The time complexity of the prediction for the RLA-KNN approach is O(N), and the time complexity of sorting for the RLA-KNN approach is O(N log N). KNN approaches are generally inapplicable for large-scale communication systems because of the complex calculation procedure involved. Therefore, SVMs are implemented to identify the repetition approach according to high-dimensional channel quality measurement results. SVM is a commonly employed machine learning method, which is generally modeled as a convex quadratic programming problem [34; 35]. Therefore, an SVM is simpler to execute than the KNN approach. Figure 3 depicts the RLA using an SVM (RLA-SVM) approach, in which a repetition approach is selected according to the BLER in the data. For a set of data \(X\) and label \(Y\), the task of SVM is to find a set of parameters such that \(x^{\theta T}=\textit{threshold}\), and the samples with \(x^{\theta T}<\textit{threshold}\) are judged as negative samples, and the samples with \(x^{\theta T}>\textit{threshold}\) are judged as positive samples. The sample X is a two-dimensional data set of channel quality:  
Figure 3: RLA–SVM approach. \[X= \begin{bmatrix}x_{1}^{(1)}&x_{2}^{(1)}\\ x_{1}^{(2)}&x_{2}^{(2)}\\ \vdots&\vdots\\ x_{1}^{(m)}&x_{2}^{(m)}\end{bmatrix}  \tag{4}\]  
This dataset \(X\) is linearly inseparable on the two-dimensional plane, and the new dataset generated by a transformation function \(\phi(x)\) is linearly separable:  
\[\phi(x_{1},x_{2}\ )=\left(x_{1}^{2},\sqrt{2}x_{1},x_{2},x_{2}^{2}\right) \tag{5}\]  
For the new dataset after the dimension increase, the prediction y for repetition number can be expressed as:  
\[y_{protition}=\sum_{i=1}^{m}\lambda_{i}y^{(i)}\langle\phi(\hat{x}),\ \phi(x^{(i)})\rangle\]  
\[=\sum_{i=1}^{m}\lambda_{i}y^{(i)}\langle((\hat{x}_{1}^{2},\sqrt{2}_{1},\hat{x }_{2},\hat{x}_{2}^{2}\ )),\ {(x_{1}^{(i)},x_{2}^{(i)},x_{2}^{(i)})}\rangle\]  
\[=\sum_{i=1}^{m}\lambda_{i}y^{(i)}\langle(\hat{x}_{1},{x_{1}^{(i)}}^{2}+2\hat{ x}_{1}x_{1}^{(i)}\hat{x}_{2}x_{2}^{(i)}+\hat{x}_{2}^{2},{x_{2}^{(i)}}^{2}) \tag{6}\]  
Through the above transformation, after the data set is upscaling, the calculation of SVM training and prediction can actually be converted into the calculation of the original feature. We choose a function: \(k(x_{1},x_{2})=\left\langle x_{1},x_{2}\right\rangle^{2}\), use it to replace the inner product calculation of SVM:  
\[\hat{y}=\left\{ \begin{aligned} +1,\ \sum_{i=1}^{m}\lambda_{i}y^{i}k\big{(}\hat{x},x^{i} \big{)}&\geq+1\\ -1,\sum_{i=1}^{m}\lambda_{i}y^{i}k\big{(}\hat{x}_{1},x^{i}\big{)}& \leq+1\end{aligned} \right.