{'fraction_non_alphanumeric': 0.017557251908396947, 'fraction_numerical': 0.006870229007633588, 'mean_word_length': 5.154929577464789, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sleep Heart Rate Variability Analysis and k-Nearest Neighbours Classification of Primary Insomnia

The Heart Rate Variability (HRV) of many sleep disorders shows an alteration of the sympathovagal balance of the Autonomous Nervous System (ANS). Primary insomnia refers to the difficulty in initiating or maintaining sleep that is not caused by other illnesses or substances. The HRV of primary insomnia shows inconsistent findings although it is believed to impair the HRV variables. This study compares the HRV changes during different sleep stages and evaluates the k-nearest neighbours (kNN) classifier using the HRV features for primary insomnia classification. The time and frequency HRV variables were extracted from sleep ECG signals of 10 primary insomnia patients and 10 healthy controls during four sleep stages – N1, N2, N3 and REM. The Mann-Whitney U-test was conducted to evaluate the existence of statistical significant differences between the two groups at different sleep stages. The kNN classifier was adapted for the classification tool. Only the LF index of HRV was significantly higher in the primary insomnia patients compared to the healthy subjects. The classification accuracy of kNN was at 75% when both the HRV time and frequency variables were accounted as inputs to the classifier.