Evaluates distance measures in text classification, suggesting direction-based methods are superior.
Choosing a distance measure is one of the earliest and least examined decisions in a text mining pipeline, yet it can determine whether a system works at all. This study quantifies that effect by comparing cosine, Jaccard, Euclidean and Manhattan distances on a deliberately controlled document classification task. Four categories of the 20 Newsgroups corpus — computer graphics, baseball, medicine and firearms policy — supply 2,256 posts, represented as TF-IDF vectors over a 21,951-term vocabulary and classified with a five-neighbour k-nearest neighbours rule. Only the distance measure varies; corpus, preprocessing, feature space and train/test split are held fixed, so any difference in outcome is attributable to the measure alone. Cosine distance reaches 0.900 accuracy and 0.899 macro F1-score. Jaccard distance follows at 0.808 on both, despite discarding term-frequency information entirely. The magnitude-sensitive measures collapse: Euclidean reaches 0.362 macro F1 and Manhattan 0.156, at or below the level expected from a degenerate classifier on four categories. The pattern holds across accuracy, precision and recall, and is explained by the geometry of sparse high-dimensional space, in which summed coordinate differences are dominated by document length rather than by topic. The findings argue that direction-based comparison should be the default for TF-IDF representations, that set-based comparison remains competitive for topic-level tasks, and that magnitude-based measures require explicit length normalisation before they are usable on text.
No takes yet. Share an insight, caveat, or question.
Ayaz Ahmad (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: