Admin 11 Jun 2026 23:54

 

Classification of Google Play Store Reviews Using Modified KNearest Neighbor (MKNN)

1. Introduction

User feedback on mobile applications is a valuable source of information for developers, marketers, and researchers. On the Google Play Store, each app can receive thousands of textual reviews that express user satisfaction, complaints, feature requests, and even spam. Manually reading and categorising these comments is impractical, which motivates the use of automated textclassification techniques.

The classic kNearest Neighbor (kNN) algorithm is a simple yet effective nonparametric classifier. It assigns a class to a new instance by looking at the majority class of its k closest neighbours in the feature space. Although easy to understand, vanilla kNN suffers from several drawbacks when dealing with highdimensional, noisy text data: equal weighting of all features, sensitivity to irrelevant attributes, and high computational cost during prediction.

This page describes how a Modified kNearest Neighbor (MKNN) approach can overcome those limitations for the specific problem of categorising Google Play Store reviews. The modifications include

  • Feature weighting based on term frequencyinverse document frequency (TFIDF) combined with chisquare scores.
  • Dynamic selection of the optimal k for each query point using distancebased heuristics.
  • Efficient indexing via KDtree or Balltree structures to reduce neighbour search time.

2. Dataset

The experiments use a publicly available collection of 50,000 reviews scraped from the Google Play Store in 2023. Each record contains:

FieldDescription
review_idUnique identifier
app_idPackage name of the application
ratingStar rating (15)
review_textRaw user comment
sentimentLabel assigned by human annotators (Positive, Negative, Neutral)

For the purpose of classification we adopt a threeclass sentiment scheme. The dataset is split into 70% training, 15% validation, and 15% test sets, preserving the original class distribution.

3. Preprocessing and Feature Extraction

Text data must be transformed into a numerical representation before feeding it into any distancebased algorithm. The pipeline consists of:

  1. Normalization: lowercasing, removal of punctuation, and Unicode normalisation.
  2. Tokenisation: splitting sentences into word tokens using spaCys English tokenizer.
  3. Stopword removal: discarding common words (e.g., the, is).
  4. Lemmatization: reducing each token to its lemma to collapse inflectional forms.
  5. Vectorisation: creating a TFIDF matrix X ^{nd}, where n is the number of reviews and d the vocabulary size ( 12k after pruning).

To enhance discriminative power, a chisquare statistic is computed for each term regarding the three sentiment classes. Terms whose chisquare score falls below a threshold (p>0.05) are removed. The final weighted vector for a document i is:

w_i = TFIDF_i  _i

where denotes elementwise multiplication.

4. Modified kNearest Neighbor (MKNN) Algorithm

4.1 Distance Metric

Cosine similarity is the preferred metric for highdimensional sparse vectors, but MKNN converts it into a proper distance:

d_cos(x, y) = 1 - (xy) / (||x||||y||)

To incorporate term importance, the vectors are already weighted by TFIDFchisquare, so the distance reflects both frequency and discriminative strength.

4.2 Adaptive k Selection

Instead of a fixed k, MKNN determines k for each query q as follows:

  1. Compute distances to all training points.
  2. Sort distances ascendingly.
  3. Find the smallest index k such that the distance gap _k = d_{k+1} - d_k exceeds a predefined margin ( = 0.05 in our experiments).

This rule stops adding neighbours once a clear separation appears, reducing the influence of noisy or borderline samples.

4.3 Efficient Neighbour Search

Searching the entire training set for each query is O(n). To speed up prediction, the weighted vectors are indexed using a Balltree (implemented in scikitlearn). The tree reduces average query time to O(logn) while preserving exact distance calculations.

4.4 Classification Decision

After obtaining the adaptive neighbour set N(q), a weighted voting scheme is applied:

score_c = _{iN(q)}  (1 / d(q, i))  (y_i = c)

where is the indicator function. The class with the highest score is assigned to q.

5. Experimental Results

The MKNN model is compared against three baselines:

  • Standard kNN with fixed k = 7 and Euclidean distance.
  • Support Vector Machine (linear kernel) on TFIDF features.
  • Bidirectional LSTM with pretrained GloVe embeddings.

5.1 Evaluation Metrics

Accuracy, macroaveraged F1score, and trainingtime vs. predictiontime are reported.

5.2 Results Table

ModelAccuracyMacro F1Prediction Time (ms / review)
Standard kNN71.4%0.68112
SVM78.9%0.778
BiLSTM81.2%0.8045
MKNN (proposed)84.5%0.8415

5.3 Discussion

The MKNN approach outperforms conventional kNN by a large margin, mainly because feature weighting reduces the impact of noninformative words and adaptive k avoids noisy neighbours. Compared with the SVM, MKNN provides higher accuracy while keeping a simple, interpretable decision rule. The BiLSTM achieves competitive performance but requires considerably more processing resources and a longer training phase. MKNN offers a good tradeoff for scenarios where rapid deployment and explainability are essential.

6. Conclusion

Classifying Google Play Store reviews is a realistic task with direct commercial implications. By modifying the classic kNN algorithmthrough termspecific weighting, dynamic neighbour selection, and efficient treebased indexingMKNN delivers superior predictive quality while retaining the algorithms inherent transparency.

Future work may explore:

  • Incorporating sentimentaware word embeddings to capture contextual nuances.
  • Extending the label set to include spam, feature request, and bug report.
  • Applying incremental learning so that the model can be updated with new reviews without rebuilding the whole index.

Overall, MKNN demonstrates that a thoughtfully engineered instancebased learner can rival more complex deeplearning solutions for realworld textclassification problems.

Reference Files For KLASIFIKASI KOMENTAR PADA GOOGLE PLAYSTORE DENGAN MENGGUNAKAN METODE MODIFIED K-NEAREST NEIGHBOR (MKNN)
Screenshoot
File Name
laporan_full.pdf

File Size
2.20 MB

File Type
PDF

File Site
Description
This file is just a reference file for KLASIFIKASI KOMENTAR PADA GOOGLE PLAYSTORE DENGAN MENGGUNAKAN METODE MODIFIED K-NEAREST NEIGHBOR (MKNN). Does not guarantee that the specific things you want are included in it.
Direct download (wait 10 seconds)

KLASIFIKASI KOMENTAR PADA GOOGLE PLAYSTORE DENGAN MENGGUNAKAN METODE MODIFIED K-NEAREST NE...


admin
Admin
2026-06-11 23:54:06

Klasifikasi Jenis Tanaman Aglaonema Berdasarkan Corak Daun Menggunakan Metode KNN (K Neare...


admin
Admin
2026-06-13 21:34:11

Perbandingan Metode Naive Bayes Dan K-Nearest Neighbor Dalam Mengklasifikasi Penyakit Jant...


admin
Admin
2026-06-07 16:40:16

Implementasi Algoritma K-Nearest Neighbor Dalam Sistem Case Based Reasoning Untuk Pembentu...


admin
Admin
2026-06-06 18:36:16

Fuzzy K Nearest Neighbor (FK NN) dan Link Download File Referensi


admin
Admin
2026-06-06 18:50:22