Comparison of Random Forest Algorithm Classifier and Naïve Bayes Algorithm in Whatsapp Message Type Classification

This study compares the effectiveness of Random Forest and Naïve Bayes algorithms in classifying WhatsApp messages into three categories: normal, promotional, and fraudulent messages. With over 2.78 billion active users worldwide and 90% of Indonesian internet users utilizing WhatsApp, the platform's end-to-end encryption creates challenges for automatic spam detection, necessitating machine learning approaches. A dataset of 300 messages, equally distributed across the three categories, underwent preprocessing including cleansing, case folding, stopword removal, normalization, and stemming before being converted to numerical form using TF-IDF vectorization. Experimental results demonstrated that Naïve Bayes outperformed Random Forest with higher accuracy (88.67% vs. 86.00%), precision (89.64% vs. 88.95%), recall (88.67% vs. 86.00%), and F1-score (88.61% vs. 85.99%). Cross-validation analysis with 10-fold validation further confirmed Naïve Bayes' superior consistency and stability across all evaluation metrics. Additionally, Naïve Bayes exhibited remarkable computational efficiency, requiring only 0.13 seconds for training compared to Random Forest's 3.65 seconds. Confusion matrix analysis revealed Naïve Bayes' particular effectiveness in distinguishing between normal and fraudulent messages, crucial for preventing users from falling victim to scams. The model successfully identified key fraud indicators such as "claim," "account," and "verification" while demonstrating precision in ambiguous cases. These findings contribute significantly to developing more effective spam detection systems for encrypted messaging platforms where traditional filtering mechanisms cannot be applied, ultimately enhancing user safety and experience through automated identification of potentially harmful content.

Authors

Publication Details

Journal
Journal of Renewable Energy Electrical and Computer Engineering
Published
2025-03-17
DOI
https://doi.org/10.29103/jreece.v5i1.21227
Primary Topic
Wireless Sensor Networks and IoT
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Comparison of Random Forest Algorithm Classifier and Naïve Bayes Algorithm in Whatsapp Message Type Classification

Yesy Afrillia, Mukti Qamal, Abdul Hadi Abd Rahman
1 links
Journal of Renewable Energy Electrical and Computer Engineering
Wireless Sensor Networks and IoT
article

Comparison of Random Forest Algorithm Classifier and Naïve Bayes Algorithm in Whatsapp Message Type Classification

Yesy Afrillia, Mukti Qamal, Abdul Hadi Abd Rahman
article en

Abstract

This study compares the effectiveness of Random Forest and Naïve Bayes algorithms in classifying WhatsApp messages into three categories: normal, promotional, and fraudulent messages. With over 2.78 billion active users worldwide and 90% of Indonesian internet users utilizing WhatsApp, the platform's end-to-end encryption creates challenges for automatic spam detection, necessitating machine learning approaches. A dataset of 300 messages, equally distributed across the three categories, underwent preprocessing including cleansing, case folding, stopword removal, normalization, and stemming before being converted to numerical form using TF-IDF vectorization. Experimental results demonstrated that Naïve Bayes outperformed Random Forest with higher accuracy (88.67% vs. 86.00%), precision (89.64% vs. 88.95%), recall (88.67% vs. 86.00%), and F1-score (88.61% vs. 85.99%). Cross-validation analysis with 10-fold validation further confirmed Naïve Bayes' superior consistency and stability across all evaluation metrics. Additionally, Naïve Bayes exhibited remarkable computational efficiency, requiring only 0.13 seconds for training compared to Random Forest's 3.65 seconds. Confusion matrix analysis revealed Naïve Bayes' particular effectiveness in distinguishing between normal and fraudulent messages, crucial for preventing users from falling victim to scams. The model successfully identified key fraud indicators such as "claim," "account," and "verification" while demonstrating precision in ambiguous cases. These findings contribute significantly to developing more effective spam detection systems for encrypted messaging platforms where traditional filtering mechanisms cannot be applied, ultimately enhancing user safety and experience through automated identification of potentially harmful content.

Journal of Renewable Energy Electrical and Computer EngineeringVol. 5(1)
Openalex Percentile: Top 91%
Wireless Sensor Networks and IoT
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.