# Machine Learning-Based Solutions for Handover Decisions in Non-Terrestrial Networks
## 3 Proposed Method
### Proposed Classification Algorithm  
The triggering of measurement reporting is used based on the location of the UE, which means that in a specific cell, users that are close to the cell center will not have the same received signal strength (RSS) as those who are at the edge of the cell, as described in Figure 7.  
In NTN, there is just a simple variation in signal strength between two beams in an overlapped region. The users have trouble telling which cell has a better RSS because the handover procedure is subject to measurement events. In NTN, due to the movement of the satellite and the beams, a potentially large number of UE must perform HO at a given time [13], which could result in significant signaling overhead and service continuity issues depending on the speed of the satellite, propagation latency, and UE density. As shown in Figure 8, while the satellite and the beams are moving, some users are handing out from the area no longer served by the cell, and others are also handing in. In that specific scenario, we have two types of users: the ones who are ready to hand over; and those who are not to perform the handover. During the feature engineering, we created two additional features called distance and handover-ready based on the dataset produced. Since we know the centroid of each cluster, we can use the Haversine formula to determine how far the UE is from the center of the cell. As described below, the haversine formula determines the great-circle distance between two points on a sphere knowing their longitudes and latitudes. Let the central angle \(\theta\) between any two points on a sphere be:  
\[\theta=\frac{d}{r}, \tag{2}\]  
where \(d\) is the distance between the two UE along a great circle of the sphere, and \(r\) is the radius of the sphere. With the help of the haversine formula, it is possible to calculate the haversine of \(\theta\) directly from the latitude and longitude of the two points:  
\[\mathit{hav}(\theta)=\mathit{hav}(\varphi_{2}-\varphi_{1})+\cos\varphi_{1}\cos \varphi_{2}\mathit{hav}(\lambda_{2}-\lambda_{1}), \tag{3}\]  
Alternatively, to avoid employing cosines, which degrade resolution at small angles. \[\mathit{hav}(\theta)=\mathit{hav}(\varphi_{2}-\varphi_{1})+(1-\mathit{hav}( \varphi_{1}-\varphi_{2})-\mathit{hav}(\varphi_{1}+\varphi_{2}))\cdot\mathit{hav }(\lambda_{2}-\lambda_{1}) \tag{4}\]  
where \((\varphi_{1},\varphi_{2})\) are the latitude of point 1 and latitude of point 2 whereas \((\lambda_{1},\lambda_{2})\) are the longitude of point 1 and longitude of point 2. Here, we consider the coordinate of point 1 as the cell center coordinate, which is the centroid of the cluster, whereas point 2 is the coordinate of a specific UE. Finally, the haversine function \(\mathit{hav}(\theta)\), applied above to both the central angle \(\theta\) and the differences in latitude and longitude, is as follows:  
\[\mathit{hav}(\theta)=\sin^{2}(\frac{\theta}{2})=\frac{1-\cos\theta}{2} \tag{5}\]  
Figure 7: A sketch of near-far effect in different scenarios in NTN. The haversine function computes half a versine of the angle \(\theta\). To solve for the distance \(d\), apply the archaversine (inverse haversine) to \(h=hav(\theta)\) or use the arcsine (inverse sine) function:  
\[d=r\times archav(h)=2r\arcsin(\sqrt{h}), \tag{6}\]  
or more explicitly:  
\[d=2r\arcsin(\sqrt{hav(\varphi_{2}-\varphi_{1})+(1-hav(\varphi_{1}-\varphi_{2}) -hav(\varphi_{1}+\varphi_{2}))\cdot hav(\lambda_{2}-\lambda_{1})}) \tag{7}\]  
\[=2r\arcsin(\sqrt{\sin^{2}{(\frac{\varphi_{2}-\varphi_{1}}{2})}+(1-\sin^{2}( \frac{\varphi_{2}-\varphi_{1}}{2})-\sin^{2}(\frac{\varphi_{2}+\varphi_{1}}{2}) )\cdot\sin^{2}(\frac{\lambda_{2}-\lambda_{1}}{2})}) \tag{8}\]  
\[=2r\arcsin(\sqrt{\sin^{2}(\frac{\varphi_{2}-\varphi_{1}}{2})+\cos\varphi_{1}.\cos\varphi_{2}\cdot\sin^{2}(\frac{\lambda_{2}-\lambda_{1}}{2})}) \tag{9}\]  
Based on the generated dataset, during the feature engineering process, we created two more features, the distance, and handover-ready.