Optimization of the Support Vector Machine Algorithm for Chocolate Consumption Classification Using SMOTE and GridSearchCV

Extreme class imbalance can cause classification models to favor the majority class, resulting in an inadequate representation of model performance when accuracy is used as the sole evaluation metric. This study aims to evaluate the performance of the Support Vector Machine (SVM) algorithm using the Synthetic Minority Over-sampling Technique (SMOTE) and GridSearchCV for chocolate consumption category classification. The dataset consists of 1,885 observations from *Chocolate Consumption.xlsx*, a processed file derived from the *Drug Consumption (Quantified)* dataset available in the UCI Machine Learning Repository. It contains 12 predictor features and three target classes encoded as 0, 1, and 2. The class distribution indicates a substantial imbalance, comprising 32 observations in class 0, 67 in class 1, and 1,786 in class 2. The data were divided using a stratified train-test split with an 80:20 ratio. StandardScaler was applied for feature scaling, while hyperparameter optimization was performed using Stratified 3-Fold Cross-Validation with Macro-F1 as the model selection metric. Three configurations were evaluated: SVM with GridSearchCV, SVM with SMOTE, and SVM combining SMOTE and GridSearchCV. The test results show that the combined configuration achieved the highest Macro-F1 score among the three evaluated configurations, at 0.3370, with an accuracy of 89.66%, macro-precision of 0.3360, and macro-recall of 0.3385. However, the confusion matrix reveals that the model failed to correctly classify any of the six class-0 observations and correctly identified only one of the 14 class-1 observations. These findings indicate that the relatively high accuracy was primarily influenced by the model's performance on the majority class. Therefore, although the combination of SMOTE and GridSearchCV achieved the highest Macro-F1 score in this experiment, it did not provide adequate classification performance across all classes. Repeated evaluation and further testing of alternative class imbalance handling strategies are required.

Authors

Institutions

Publication Details

Journal
Integrated Journal of Artificial Intelligence and Data Science
Published
2026-11-16
DOI
https://doi.org/10.68300/ijaids.v2i2.113
Primary Topic
Imbalanced Data Classification Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Optimization of the Support Vector Machine Algorithm for Chocolate Consumption Classification Using SMOTE and GridSearchCV

Firman Aziz, Irmawati Irmawati, Ayu Lestari Azis, Wahyuni Azis
7 links
Integrated Journal of Artificial Intelligence and Data Science
Imbalanced Data Classification Techniques
article

Optimization of the Support Vector Machine Algorithm for Chocolate Consumption Classification Using SMOTE and GridSearchCV

Firman Aziz, Irmawati Irmawati, Ayu Lestari Azis, Wahyuni Azis
article en

Abstract

Extreme class imbalance can cause classification models to favor the majority class, resulting in an inadequate representation of model performance when accuracy is used as the sole evaluation metric. This study aims to evaluate the performance of the Support Vector Machine (SVM) algorithm using the Synthetic Minority Over-sampling Technique (SMOTE) and GridSearchCV for chocolate consumption category classification. The dataset consists of 1,885 observations from *Chocolate Consumption.xlsx*, a processed file derived from the *Drug Consumption (Quantified)* dataset available in the UCI Machine Learning Repository. It contains 12 predictor features and three target classes encoded as 0, 1, and 2. The class distribution indicates a substantial imbalance, comprising 32 observations in class 0, 67 in class 1, and 1,786 in class 2. The data were divided using a stratified train-test split with an 80:20 ratio. StandardScaler was applied for feature scaling, while hyperparameter optimization was performed using Stratified 3-Fold Cross-Validation with Macro-F1 as the model selection metric. Three configurations were evaluated: SVM with GridSearchCV, SVM with SMOTE, and SVM combining SMOTE and GridSearchCV. The test results show that the combined configuration achieved the highest Macro-F1 score among the three evaluated configurations, at 0.3370, with an accuracy of 89.66%, macro-precision of 0.3360, and macro-recall of 0.3385. However, the confusion matrix reveals that the model failed to correctly classify any of the six class-0 observations and correctly identified only one of the 14 class-1 observations. These findings indicate that the relatively high accuracy was primarily influenced by the model's performance on the majority class. Therefore, although the combination of SMOTE and GridSearchCV achieved the highest Macro-F1 score in this experiment, it did not provide adequate classification performance across all classes. Repeated evaluation and further testing of alternative class imbalance handling strategies are required.

Integrated Journal of Artificial Intelligence and Data ScienceVol. 2(2)
Universitas Pancasakti Makassar (ID), State University of Makassar (ID)
Good health and well-being
Imbalanced Data Classification Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon