# Multi-Layer QoE Learning System Implemented by Fiberhost
## 5 Implementation of Unsupervised Learning
### Clustering
When the decoder fully recovers, the values of the characteristics start to improve and, after a certain time, reach the maximum value until the next quality deterioration. \(VSBCT\) takes into account the negative event counter \(bcc\) (5), which increases when the decoder switches to a lower profile than the one that is currently being played. The \(tsblc\) (6) factor is the time elapsed since the last negative event. \[VSBCT= \begin{cases}1&bc_{c}=0\\ -1\cdot\frac{log_{2}(1+bc_{c})}{tsblc}&bc_{c}>0\end{cases}  \tag{4}\]  
\[bc_{c}= \begin{cases}bc_{c}&bitrate_{kbps}^{N}>bitrate_{kbps}^{N-1}\\ bc_{c}+1&\left(bitrate_{kbps}^{N}\
eq ref_{bitrate}\right)\leq bitrate_{ kbps}^{N-1}\\ bc_{c}&bitrate_{kbps}^{N}=ref_{bitrate}\end{cases}  \tag{5}\]  
\[tsblc= \begin{cases}t_{n-x}&bitrate_{kbps}^{N}>bitrate_{kbps}^{N-1}\\ t_{n}&bitrate_{kbps}^{N}\leq bitrate_{kbps}^{N-1}.\end{cases}  \tag{6}\]  
Stalls are the events related to the saturation of the playback buffer. At this point, the decoder stops playing the content. Stalls can be caused by network conditions, problems with CDN servers or internal problems of the TV platform. The bitrate value for the stream is then 0 Mbps. We decided to use characteristics to determine the number of stalls for a single event, channel and session. We considered the ratio of the sum of the stall duration to the duration of the event, channel and session. However, we decided that the stall counter would better represent the behavior of the decoder when a stall occurs. In our case, the TV service was only provided on a GPON network, which is characterized by fast data transmission and low latency. The decoders are delivered to the customers together with optical terminals. The connection to these terminals can be wired or wireless. When stalling occurs, the decoder displays a black screen with an error message. We have observed that, in most cases, this behavior lasts between 1 and 3 s, as the performance of the optical network allows the decoders to download successive video segments quickly. In this particular case, it will be more annoying for the customer to have interchangeable stalls with a black board that appears alternating with the video content than to have a single black screen that lasts for a longer time. In addition, we needed to take into consideration that events on TV services tend to last much longer than short videos on popular streaming services. Sports events, for example, can last for more than 3 h as a single show. The number of stalls was determined for a single event \(avErr_{event}\) (7), a channel \(avErr_{channel}\) (8), and the entire viewing session, i.e., from start to shutdown of the decoder \(avErr_{session}\) (9). \[avErr_{event}=\sum_{n=1}^{i_{agent}}n \tag{7}\]  
\[avErr_{channel}=\sum_{n=1}^{i_{channel}}n \tag{8}\]  
\[avErr_{session}=\sum_{n=1}^{i_{agent}}n. \tag{9}\]  
A min-max normalization (10) was used to scale the different metrics. The value of the metric \(x\) was returned as \(x_{scaled}\). This value was scaled in the range \(<a;b>\). Since the parameters \(SCI\), \(SCTI\) and \(VSBCT\) can refer to both positive behavior, i.e., quality improvement, and negative behavior, i.e., quality degradation, they took values within the range \(<-1;1>\). The parameters \(avErr_{event}\), \(avErr_{channel}\) and \(avErr_{session}\) were scaled to values \(<0;-1>\). This is because they were only associated with the negative behavior of stalling. \[x_{scaled}=a+\frac{(x-min(x))(b-a)}{max(x)-min(x)}. \tag{10}\]