Simple kNN classifier for VoIP and RTC Metrics
kNN stands for k-Nearest-Neighbours, which is a Supervised machine learning algorithm used for classification, determining the class of a data point based on the maximum number of neighbors the data point has belonging to the same class.
MOS stands for Mean Opinion Score, a commonly used measure for audio and video VoIP quality evaluation. This example only accounts for network performance related parameters negatively affecting the score.
In this example, a fictional Data set is provided for trainig ml.js KNN module using various combinations of Packet Loss, Jitter and Round-Trip-Tip measurements and their resulting MOS rank in class 1-4. This dataset is oversimplified, purely illustrative for educational purposes and does not necessarily represent actual conditions.
prompt: Lost%/10: 0.0 (0%0
prompt: Jitter/100: 0.5 (50ms)
prompt: RTT/100: 1.0 (100ms)
prompt: CodecType: 0 (PCMU)
With 0,0.5,1,0 -- type = MOS4
prompt: Lost%/10: 0.5 (50%)
prompt: Jitter/100: 1.0 (100ms)
prompt: RTT/100: 1.0 (100ms)
prompt: CodecType: 0 (PCMU)
With 0.5,1,1,0 -- type = MOS1
This mere adaption is heavily based on the awesome Machine Learning with JavaScript tutorial by Abhishek Soni