## 2 Materials and Methods
### Gathered Data
#### Features  
The clustering algorithm input consists of four main features calculated based on heuristic measurements gathered from production devices. Authors have proposed newly calculated parameters to connect the stalls occurrence, frequency, duration, and bitrate switch metrics, including occurrence, frequency, and duration. The proposed parameter SCI (Streaming Change Importance) will indicate whether the change in bitrate playback is positive or negative in the present time \(n\) to the previous time \(n-1\). The negative change means that the set-top-box in the time \(n\) plays lower video quality regards time \(n-1\) and vice versa. The bitrate level in the given time and reference bitrate is gathered directly from the STBs logs. The stalling occurrence for the analyzed system has been illustrated in the recorded video attached to the Supplementary Files. The sequence presents stalling from the production set-top-box that occurred while watching a football match. When a signal loss occurs, the customer can notice the black screen with the audio/video error message. The value \"\(-1\)\" generally represents the loss of signal. The formula of SCI is as follows:  
\[SCI=\left\{ \begin{aligned} -1,\,bitrate_{\textit{kbps}}^{N}=0\\ \frac{bitrate_{\textit{kbps}}^{N}-bitrate_{\textit{kbps}}^{N-1}}{ ref_{\textit{bitrate}}}x\geq 0\\ 1,\,bitrate_{\textit{kbps}}^{N}=ref_{\textit{bitrate}}\end{aligned} \right. \tag{1}\]  
In Formula (1), the bitrate is the bitrate level in kilobytes per second in the present time (\(n\)), as well as in the previously gathered entry (\(n-1\)). The \(ref_{\textit{bitrate}}\) determines the highest available bitrate for a given channel gathered from the CDN configuration. When the stalls occur, the current bitrate level will decrease to 0, or the system error will occur (i.e., \(bitrate_{bps}^{\text{N}}=0\)) in which case SCI will take the value \(-1\). This means that the significant change in the stream occurs in the negative direction. The customer will perceive that the black screen that is not desired. On the other hand, when the current bitrate level reaches the maximum intended level, i.e., the \(bitrate_{bps}^{\text{N}}=ref_{bitrate}\), the SCI will take the value 1. This means that the positive change in stream occurred, or in the given sampling time, the set-top-box plays the highest available quality. When the currently played stream is higher than 0 and lower than the maximum available value, which can be different for every channel, and the SCI will be assigned to the values from the \((-1;1)\) range. If the bitrate in time \(n\) is improving, and it is higher than the bitrate in time \(n-1\), the SCI will have positive values. On the other hand, the SCI will take the negative values. The SCI parameter is to provide information on whether, in the given time, the video quality improved or deteriorated. When set-top-box starts playing, it can reach the highest possible bitrate level (Figure 4). In the example time \(t_{n-2}\), the SCI will reach the value \"1\", as the degradation is not observable. When the bitrate decreases by half in time \(t_{n-1}\), the SCI will reach the value \"\(-0.5\)\". In time \(t_{n}\) the SCI will become \"\(-1\)\" due to the stall occurrence, which is highly observable, and the degradation is significant. After the given period of time, the STB can recover the signal, and at times \(t_{n+x}\), the SCI will take positive values. The SCTI (stream change importance in the given time) parameter is proposed based on the SCI parameter. The arranged feature aims to link the positive or negative quality change with the given TV event or channel importance. From the TV operator's perspective, specified channels can be more important than others. The importance can be identified by the occupied number on the channel list, increased maximum bitrate, or audience. The channel importance is set as the current viewership in the given model. The current viewership is calculated every 15 min time interval (TI) for every channel (CH) available to customers.