{'fraction_non_alphanumeric': 0.015594541910331383, 'fraction_numerical': 0.0, 'mean_word_length': 5.262195121951219, '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}}
Improving the running time of the nearest neighbor algorithm

Nearest neighbor algorithm is a well-known method, in pattern recognition, for classifying objects based on the nearest examples in the feature space. However, it's major drawback is the sequential search operation which calculates the distance between the probing object and the entire set of the training instances. In this paper, we propose a novel method to accelerate the searching operation in the nearest neighbor algorithm. Our method consists of two main steps; creating the reference table and searching the nearest neighbor. Reference table of the training instances is created once in the initial phase and referred periodically by the searching step. Surprisingly, this reference table can drastically reduce the searching time of the nearest neighbor algorithm on any feature space. The experimental results on five real-world datasets from the VCI repository show a remarkable improvement on the searching time while the accuracy is still preserved.