Skip to main content
QUICK REVIEW

[Paper Review] An Improved k-Nearest Neighbor Algorithm for Text Categorization

Baoli Li, Shiwen Yu|ArXiv.org|Jun 16, 2003
Text and Document Classification TechnologiesComputer Science2 references86 citations
TL;DR

This paper proposes a category-adaptive k-NN algorithm for text categorization that dynamically adjusts the number of nearest neighbors per class based on training set class frequency, reducing bias toward larger classes. Experiments on Chinese text show improved performance on small classes and reduced sensitivity to k, especially when cross-validation is impractical.

ABSTRACT

k is the most important parameter in a text categorization system based on k-Nearest Neighbor algorithm (kNN).In the classification process, k nearest documents to the test one in the training set are determined firstly. Then, the predication can be made according to the category distribution among these k nearest neighbors. Generally speaking, the class distribution in the training set is uneven. Some classes may have more samples than others. Therefore, the system performance is very sensitive to the choice of the parameter k. And it is very likely that a fixed k value will result in a bias on large categories. To deal with these problems, we propose an improved kNN algorithm, which uses different numbers of nearest neighbors for different categories, rather than a fixed number across all categories. More samples (nearest neighbors) will be used for deciding whether a test document should be classified to a category, which has more samples in the training set. Preliminary experiments on Chinese text categorization show that our method is less sensitive to the parameter k than the traditional one, and it can properly classify documents belonging to smaller classes with a large k. The method is promising for some cases, where estimating the parameter k via cross-validation is not allowed.

Motivation & Objective

  • To address the bias in traditional k-NN text categorization caused by uneven class distribution in training data.
  • To reduce sensitivity to the choice of fixed k by allowing category-specific k values.
  • To improve classification accuracy for minority (smaller) classes without relying on cross-validation for k selection.
  • To develop a method that uses more neighbors for frequently occurring classes and fewer for rare ones, based on training data statistics.

Proposed method

  • The algorithm assigns a different k value to each category based on the number of training samples in that category.
  • For each test document, the k nearest neighbors are selected separately for each category using category-specific k values.
  • The final classification is determined by majority voting among the category-specific nearest neighbors.
  • The number of neighbors used per category is proportional to the size of the category in the training set, favoring larger categories with more neighbors.
  • The method avoids fixed k by using a dynamic k per class, calculated as a function of class frequency.
  • The approach is applied independently per category during classification, ensuring that larger classes contribute more to the decision.

Experimental results

Research questions

  • RQ1How does dynamic k selection per category affect classification performance in imbalanced text categorization?
  • RQ2Can a category-adaptive k-NN approach reduce bias toward larger classes in text categorization?
  • RQ3To what extent does the proposed method reduce sensitivity to the choice of k compared to fixed-k k-NN?
  • RQ4Can the method effectively classify documents from smaller classes without requiring cross-validation for k tuning?

Key findings

  • The proposed method significantly reduces sensitivity to the choice of k compared to the traditional fixed-k k-NN algorithm.
  • The algorithm improves classification accuracy for smaller classes, especially when a large k is used.
  • The method maintains high performance on larger classes while enhancing minority class detection.
  • The approach is effective in scenarios where cross-validation for k selection is not feasible.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.