CFP last date
20 December 2024
Reseach Article

Implementation of Model Evaluation using Confusion Matrix in Python

by Ahmad Farhan AlShammari
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 186 - Number 50
Year of Publication: 2024
Authors: Ahmad Farhan AlShammari
10.5120/ijca2024924236

Ahmad Farhan AlShammari . Implementation of Model Evaluation using Confusion Matrix in Python. International Journal of Computer Applications. 186, 50 ( Nov 2024), 42-48. DOI=10.5120/ijca2024924236

@article{ 10.5120/ijca2024924236,
author = { Ahmad Farhan AlShammari },
title = { Implementation of Model Evaluation using Confusion Matrix in Python },
journal = { International Journal of Computer Applications },
issue_date = { Nov 2024 },
volume = { 186 },
number = { 50 },
month = { Nov },
year = { 2024 },
issn = { 0975-8887 },
pages = { 42-48 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume186/number50/implementation-of-model-evaluation-using-confusion-matrix-in-python/ },
doi = { 10.5120/ijca2024924236 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2024-12-01T00:09:52+05:30
%A Ahmad Farhan AlShammari
%T Implementation of Model Evaluation using Confusion Matrix in Python
%J International Journal of Computer Applications
%@ 0975-8887
%V 186
%N 50
%P 42-48
%D 2024
%I Foundation of Computer Science (FCS), NY, USA
Abstract

The goal of this research is to develop a model evaluation program using confusion matrix in Python. Model evaluation is used to measure the performance of the applied model by comparing the predicted data with the actual data. Confusion matrix is used to summarize the predictions of the applied model and compute the evaluation metrics. The basic steps of model evaluation using confusion matrix are explained: preparing data (actual and predicted), computing confusion matrix, computing totals (sum of items, diagonal, rows, and columns), computing evaluation metrics (accuracy, precision, recall, and F1-score), printing evaluation metrics, and plotting confusion matrix. The developed program was tested on an experimental dataset. The program successfully performed the basic steps of model evaluation using confusion matrix and provided the required results.

References
  1. Sammut, C., & Webb, G. I. (2011). "Encyclopedia of Machine Learning". Springer Science & Business Media.
  2. Jung, A. (2022). "Machine Learning: The Basics". Singapore: Springer.
  3. Kubat, M. (2021). "An Introduction to Machine Learning". Cham, Switzerland: Springer.
  4. Li, H. (2023). "Machine Learning Methods". Springer Nature.
  5. Dey, A. (2016). "Machine Learning Algorithms: A Review". International Journal of Computer Science and Information Technologies, 7 (3), 1174-1179.
  6. Bonaccorso, G. (2018). "Machine Learning Algorithms: Popular Algorithms for Data Science and Machine Learning". Packt Publishing.
  7. Jo, T. (2021). "Machine Learning Foundations: Supervised, Unsupervised, and Advanced Learning". Springer.
  8. Jordan, M. I., & Mitchell, T. M. (2015). "Machine Learning: Trends, Perspectives, and Prospects". Science, 349(6245), 255-260.
  9. Forsyth, D. (2019). "Applied Machine Learning". Cham, Switzerland: Springer.
  10. Chopra, D., & Khurana, R. (2023). "Introduction to Machine Learning with Python". Bentham Science Publishers.
  11. Müller, A. C., & Guido, S. (2016). "Introduction to Machine Learning with Python: A Guide for Data Scientists". O'Reilly Media.
  12. Zollanvari, A. (2023). "Machine Learning with Python: Theory and Implementation". Springer Nature.
  13. Raschka, S. (2015). "Python Machine Learning". Packt Publishing.
  14. Sarkar, D., Bali, R., & Sharma, T. (2018). "Practical Machine Learning with Python". Apress.
  15. Swamynathan, M. (2019). "Mastering Machine Learning with Python in Six Steps: A Practical Implementation Guide to Predictive Data Analytics using Python". Apress.
  16. Kong, Q., Siauw, T., & Bayen, A. (2020). "Python Programming and Numerical Methods: A Guide for Engineers and Scientists". Academic Press.
  17. Yale, K., Nisbet, R., & Miner, G. D. (2017). "Handbook of Statistical Analysis and Data Mining Applications". Elsevier.
  18. Unpingco, J. (2022). "Python for Probability, Statistics, and Machine Learning". Cham, Switzerland: Springer.
  19. Brandt, S. (2014). "Data Analysis: Statistical and Computational Methods for Scientists and Engineers". Springer.
  20. VanderPlas, J. (2017). "Python Data Science Handbook: Essential Tools for Working with Data". O'Reilly Media.
  21. James, G., Witten, D., Hastie, T., Tibshirani, R., & Taylor, J. (2023). "An Introduction to Statistical Learning: With Applications in Python". Springer Nature.
  22. Aggarwal, C. C. (2020). "Data Classification: Algorithms and Applications". CRC Press
  23. Novaković, J. D., Veljović, A., Ilić, S. S., Papić, Ž., & Tomović, M. (2017). "Evaluation of Classification Models in Machine Learning". Theory and Applications of Mathematics & Computer Science, 7(1), 39.
  24. Zheng, A. (2015). "Evaluating Machine Learning Models: A Beginner's Guide to Key Concepts and Pitfalls". O'Reilly Media.
  25. Raschka, S. (2018). "Model Evaluation, Model Selection, and Algorithm Selection in Machine Larning". arXiv preprint arXiv:1811.12808.
  26. Rainio, O., Teuho, J. & Klén, R. (2024). "Evaluation Metrics and Statistical Tests for Machine Learning". Scientific Reports, 14 (1), 6086.
  27. Naidu, G., Zuva, T., & Sibanda, E. M. (2023). "A Review of Evaluation Metrics in Machine Learning Algorithms". In Computer Science On-line Conference (pp. 15-25). Cham: Springer International Publishing.
  28. Hossin, M., & Sulaiman, M.N, (2015). "A Review on Evaluation Metrics for Data Classification Evaluations". International Journal of Data Mining & Knowledge Management Process, 5, 01-11.
  29. Python: https://www.python.org
  30. Numpy: https://www.numpy.org
  31. Pandas: https:// pandas.pydata.org
  32. Matplotlib: https://www. matplotlib.org
  33. NLTK: https://www.nltk.org
  34. SciPy: https://scipy.org
  35. SK Learn: https://scikit-learn.org
  36. Kaggle: https://www.kaggle.com
Index Terms

Computer Science
Information Sciences

Keywords

Artificial Intelligence Machine Learning Model Evaluation Confusion Matrix Evaluation Metrics Accuracy Precision Recall F1-Score Python Programming