Classifying Learning Styles with Multinomial Naive Bayes



Overview
This project asks a simple question: can a machine guess how someone learns just from the sentences they write? VARK learning styles are usually identified through long, rigid multiple-choice questionnaires. This study replaces the questionnaire with a text classifier: a model reads a short free-written text and predicts whether the writer is a Visual, Auditory, Read/Write, or Kinesthetic learner.
The approach uses TF-IDF to turn text into numbers and Multinomial Naive Bayes to learn which words are characteristic of each style. The classifier was implemented both from scratch (to understand the math) and with scikit-learn (to validate correctness), then compared against SVM, Random Forest, and Decision Tree baselines.
Tech Stack & Rationale
Layer | Technology | Why |
|---|---|---|
Language | Python 3.14 | Dominant ecosystem for NLP prototyping and notebooks |
Vectorization | TF-IDF (scikit-learn) | Gives each word a weighted score; simple and interpretable |
Classifier | Multinomial Naive Bayes | Designed for discrete count features; fast to train and highly accurate on short text |
Manual implementation | NumPy | Re-implemented the classifier from scratch to verify understanding |
Baselines | scikit-learn (SVM, Random Forest, Decision Tree) | Comparison to situate the MNB result |
Analysis | pandas, matplotlib, seaborn | Data wrangling, confusion matrix, and ROC curves |
Environment | Jupyter Notebook | Reproducible, literate workflow |
Architecture
The pipeline is a classic four-stage text-classification flow: free text → TF-IDF vectorization → Multinomial Naive Bayes → softmax + argmax.
- Dataset — 4,000 balanced Indonesian sentences (1,000 per VARK class), generated with GLM-5.1 and stored in dataset_vark.csv. Split 80:20 into 3,200 training and 800 test sentences.
- TF-IDF — each sentence is converted into a weighted word vector (TF × IDF), producing a 4,000 × 586 sparse matrix. Words that are frequent in one sentence but rare overall (e.g. gambar, diskusi, praktikum) receive high weights.
- Multinomial Naive Bayes — learns a prior P(c) per class and a likelihood P(w|c) per word. Laplace smoothing (α = 1.0) prevents zero probabilities, and predictions are computed in log-space to avoid floating-point underflow.
- Softmax + argmax — log scores are converted to percentages; the highest-scoring class is the prediction. The output includes a confidence level, not just a label.
Folder Structure
learning-method-classification/
├── dataset.csv # 1.9 MB raw dataset
├── dataset_vark.csv # balanced 4,000-sentence VARK dataset
├── generate_vark_dataset.py # dataset generation script (GLM-5.1)
├── klasifikasi_vak_indonesia.ipynb # TF-IDF + MNB pipeline (scikit-learn)
├── klasifikasi_vak_naive_bayes.ipynb # from-scratch MNB implementation
├── perbandingan_model_vark.ipynb # model comparison (MNB vs SVM/RF/DT)
├── presentasi_vark_classification.md # presentation deck
├── pyproject.toml # Python 3.14 dependencies
└── Latex/
├── jnteti-english/ # JNTETI journal paper (English)
├── jnteti-indonesian/ # JNTETI journal paper (Indonesian)
├── laporan-vark/ # project report
└── presentasi-vark/ # LaTeX presentationImpact & Results
Evaluation on the 800 held-out test sentences:
Class | Precision | Recall | F1 | AUC |
|---|---|---|---|---|
Auditory | 97.69% | 100.00% | 98.83% | 0.9991 |
Kinesthetic | 99.02% | 100.00% | 99.51% | 0.9999 |
Read/Write | 100.00% | 97.37% | 98.67% | 0.9993 |
Visual | 100.00% | 98.98% | 99.49% | 0.9999 |
Macro avg | 99.18% | 99.09% | 99.12% | 0.9996 |
793 of 800 predictions were correct. The 7 errors are semantic, not random: 5 Read/Write texts were confused with Auditory (shared communication vocabulary), and 2 Visual texts with Kinesthetic (hands-on context). Total compute time was ~21 ms (TF-IDF 91.8%, training 5.8%, prediction 2.4%).
- Total inference pipeline time is ~21 ms — fast enough to replace a questionnaire with real-time text analysis.
- The 4,000-sentence Indonesian VARK dataset (generated with GLM-5.1) is a reusable artifact for future NLP work in the same domain.
My Contributions
Co-authored with Igi Ardiyanto (Universitas Gadjah Mada). My work on this repository:
- Generated the 4,000-sentence synthetic VARK dataset (generate_vark_dataset.py) with GLM-5.1.
- Implemented the Multinomial Naive Bayes classifier from scratch (with Laplace smoothing and log-space prediction) alongside the scikit-learn baseline.
- Built the TF-IDF + MNB pipeline, the confusion-matrix and ROC analysis, and the model-comparison notebook.
- Authored the presentation deck and the JNTETI journal paper (English and Indonesian) in LaTeX.
References
[1] N. Fleming, "VARK: A Guide to Learning Styles," 1992.
[2] A. McCallum and K. Nigam, "A Comparison of Event Models for Naive Bayes Text Classification," in Proc. AAAI Workshop on Learning for Text Categorization, 1998.
[3] G. Salton and C. Buckley, "Term-Weighting Approaches in Automatic Text Retrieval," Information Processing & Management, vol. 24, no. 5, pp. 513–523, 1988.
[4] A. S. Shina and I. Ardiyanto, "learning-method-classification," GitHub repository, 2026. [Online]. Available: https://github.com/ave-shina/learning-method-classification
Comments
Leave a Comment
You must be signed in to comment
0 Comments
No comments yet. Be the first to comment!