The widespread occurrence of criminal activities poses a substantial threat to public safety and property. Hence, the proactive prediction of crimes is vital as it empowers law enforcement agencies to make decisions on resource allocation and targeted interventions based on the data, ultimately leading to a more secure and protected community. Additionally, such initiatives raise public awareness, encouraging vigilance during periods of heightened criminal activity. In this project, machine learning techniques are leveraged to forecast the crime rate in the city of Chicago. This research introduces a more efficient data preparation method, optimizing data representation to enable machine learning models to capture patterns and learn from the information provided effectively. After training the models using LightGBM, XGBoost, CatBoost, and Gradient Boosting, the models achieved R2 scores of 0.8086, 0.8088, 0.8094, and 0.8084, respectively. An ensemble method combining these individual models was implemented to improve the prediction performance. Through the voting ensemble method, the final R2 score for crime rate prediction was enhanced to 0.8104. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024.