{'fraction_non_alphanumeric': 0.017329255861365953, 'fraction_numerical': 0.0, 'mean_word_length': 4.64367816091954, '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}}
Positive Predictive Value based dynamic K-Nearest Neighbor

The K Nearest Neighbors classification method assigns to an unclassified observation the class which obtains the best results after a voting criteria is applied among the observation’s K nearest, previously classified points. In a validation process the optimal K is selected for each database and all the cases are classified with this K value. However the optimal K for the database does not have to be the optimal K for all the points. In view of that, we propose a new version where the K value is selected dynamically. The new unclassified case is classified with different K values. And looking for each K how many votes has obtained the winning class, we select the class of the most reliable one. To calculate the reliability, we use the Positive Predictive Value (PPV) that we obtain after a validation process. The new algorithm is tested on several datasets and it is compared with the K-Nearest Neighbor rule.