Lucas Ngoge, Dr. Kennedy Ogada, Dr. Dennis Kaburu


One of the major roles of government is to curb crime. Despite the measures the government has taken to counteract criminal activity, the security situation in many urban centers has gotten worse. The goal of this study was to create and assess a machine learning model with the core function of forecasting crime categories and utilizing contextual features found in the datasets to visualize the locations in which they occur. This was achieved by combining time, space, and contextual information with machine learning to improve crime prediction and mapping. The datasets were collected from various sources were subjected to a number of machine learning algorithms to evaluate how well they performed. The random forest algorithm emerged as the best algorithm with a classification accuracy of 97% or 0.973301 using the confusion matrix. The longitude and latitude features were used to tag the specific locations of crime occurrences on a map.


Keywords: Machine Learning Algorithms; Classification; Prediction; Mapping; Data Visualization[1]

Correspondence: Lucas Ngoge, Jomo Kenyatta University of Agriculture and Technology, Kenya,

Full Text:



Dikananda et al (2022). Comparison of Decision Tree Classification Methods and Gradient Boosted Trees. TEM Journal. 11. 316-322

Kanimozhi et al (2021). Crime Type and Occurrence Prediction Using Machine Learning Algorithm, International Conference on Artificial Intelligence and Smart Systems (ICAIS), Coimbatore, India.

Llaha (2020). Crime Analysis and Prediction using Machine Learning, 43rd International Convention on Information, Communication and Electronic Technology (MIPRO), Opatija, Croatia. /10.23919/MIPRO48935.2020.9245120.

Mahesh & Dipti (2020). Machine Learning Algorithms for Predictive Analytics: A Review and New Perspectives.

Mohamed et al (2022). Supervised Machine Learning Techniques.

Mahmud et al (2021). Crime Rate Prediction Using Machine Learning and Data Mining. In: Borah, S., Pradhan, R., Dey, N., Gupta, P. (eds) Soft Computing Techniques and Applications. Advances in Intelligent Systems and Computing, vol 1248.

National Police Service (NPS)(2022),“Annual Report“ .

Nguyen et al (2018). Applying Random Forest Classification to map land use/land cover using Landsat 8 oli, Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci., XLII-3/W4, pp 363–367,2018.

Patrick and Erin (2020). Optimizing the C4.5 Decision Tree Algorithm using MSD-Splitting, International Journal of Advanced Computer Science and Applications(IJACSA), pp 11(10).

Pratibha et al (2020), Crime Prediction and Analysis, 2nd International Conference on Data, Engineering and Applications (IDEA), Bhopal, India. /10.1109/IDEA49133.2020.9170731.

Sarker (2021). Machine Learning: Algorithms, Real-World Applications and Research Directions. Sn Comput. Sci. Pp 2.

Sen (2021). Machine Learning - Algorithms, Models and Applications. IntechOpen . /10.5772/intechopen.94615.

Saraiva et al (2022). Crime Prediction and Monitoring in Porto, Portugal, Using Machine Learning, Spatial and Text Analytics. ISPRS Int. J. Geo-Inf,.

Tahir et al (2021). Crime Prediction using Naïve Bayes Algorithm .International Journal of Advance Research, Ideas, and Innovations in Technology, Volume 7, Issue 4 - V7I4-1713.

Veena et al (2022). Cybercrime: Identification and Prediction Using Machine Learning Techniques. Computational Intelligence and Neuroscience, 1-10.

Viet et al (2021). The Naïve Bayes Algorithm for Learning Data Analytics, Indian Journal of Computer Science and Engineering. 12. 1038-1043.

Wasim et al (2020). Crime Analysis And Prediction Using The K-Means Clustering Technique. Epra International Journal of Economic and Business Review. 05. 277-280.

Yoganand et al (2020). An User-Friendly Interface for Data Preprocessing and Visualization using Machine Learning Models.

Zeineddine et al (2020). Enhancing Prediction of Student Success: Automated Machine Learning Approach. Computers & Electrical Engineering. 89.


  • There are currently no refbacks.