Subido por Laura Mendoza


Predicting Crime Using Time and Location Data
Jesia Quader Yuki
Md.Mahfil Quader Sakib
Zaisha Zamal
North South University
Dhaka, Bangladesh
North South University
Dhaka, Bangladesh
North South University
Dhaka, Bangladesh
[email protected]
[email protected]
[email protected]
Khan Mohammad Habibullah
Amit Kumar Das
East West University
Dhaka, Bangladesh
East West University
Dhaka, Bangladesh
[email protected]
[email protected]
Criminal and sociology scholars are analyzing the pattern of
criminal activity and its relationship with the area. Researchers
have shown that many crook activities are taking place in a region.
This is called a hotspot. Machine learning can be used to become
aware of hotspots by way of data pushed approach.
To have a better response towards criminal activity, it is very
important that one should understand the patterns in crime. We
analyze this pattern by taking crime datasets from the Chicago
Police Department's CLEAR (Citizen Law Enforcement Analysis
and Reporting) system. This dataset includes different blocks of
the city of Chicago. The major aim of this mission is to expect
which category of crime is most probably to take place at a
detailed time and places in Chicago. Finally, this paper uses a
different algorithm like Random Forest, Decision Tree and
different ensemble methods such as Extra Trees, Bagging and
AdaBoost to evaluate the accuracy given by each algorithm.
The motivation of this paper is to explore the special device
studying strategies to investigate the crime patterns so that this
could help regulation enforcement organization to behavior their
operations. Our approach will help regulation enforcement
agencies to have assumption ahead about the possibility of crime,
which could arise at a place in a given time. This will assist them
to resolve the instances faster than earlier.
Machine learning, Ensemble, Random Forest, Decision Tree,
Bagging, AdaBoost, Extra Trees.
This paper uses a dataset from Chicago, which involves
extraordinary classes of crimes occurring, based totally on
different factors along with places and crimes over the 16years.
We have used different classifiers to locate hotspots of crook
activities primarily based on the time of day. The goal of this
challenge is to apply machine learning procedures to find a
criminal sample with the aid of its category with the given precise
time and location.
Crime as the word suggests it is the violation that people does, and
it is usually performed against the laws and it is punishable. Crime
Analysis is a part of criminology studies where a various pattern
of activities involving criminology are studied and tries to find the
indicators of occurred events. Criminal activities are a regular
occurrence all over the world. Governments spend a huge amount
of time to use technology to tackle criminal activities. Machine
learning of its works with data and through reading records helps
to predict. This paper uses machine-learning techniques to analyze
the previous crime datasets and predicts the hotspots for the crime
based on time and location.
Criminal activities are common around the world. Therefore,
researchers have completed many works on this subject matter.
Researches have been analyzing the relation among criminal
activities and socio-economic variables like unemployment,
earnings level, level of schooling and so forth.
CCS Concepts
• Computing
Researchers like Bharati et al worked-on Crime Prediction and
Analysis Using Machine Learning where the author used machine
learning and data mining for prediction of crimes in Chicago [1].
The datasets include information like vicinity description, type of
crime, date, time, range, longitude, etc. They used the K-Nearest
Neighbor (KNN) classification and plenty of different algorithms
to test for crime prediction. A classifier that gives higher accuracy
is used for further training. Also, Sangani et al worked on similar
paper on Crime Prediction and Analysis where they used Simple
K-Means clustering techniques and algorithm for predicting
Crimes [2]. This model tried to figure out crime trends based on
crime zone but not based on a certain period. Therefore, they can
extend their model by using more datasets with more features
such as season, date, time so that this model will be more
beneficial of police using as well as safety of normal people.
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that
copies bear this notice and the full citation on the first page. Copyrights
for components of this work owned by others than ACM must be
honored. Abstracting with credit is permitted. To copy otherwise, or
republish, to post on servers or to redistribute to lists, requires prior
specific permission and/or a fee. Request permissions from
[email protected]
ICCCM 2019, July 27–29, 2019, Bangkok, Thailand
© 2019 Association for Computing Machinery.
ACM ISBN 978-1-4503-7195-7/19/07…$15.00
Crime Prediction using Ensemble Approach by Almaw et al
investigates on hidden crime data mining [3]. They used
records 1995 FBI Uniform Crime Reporting (UCR), Iqbal et al.
found an accuracy of 83.95% when used Decision Tree and Naive
Bayesian set of rules is used to predict the category of crimes for
various states of the USA [12]. Similarly, Dash et al. analyze
Chicago city crime facts fused with different social information
sources the usage of community analytic strategies to expect a
criminal activity for the following 12 months [13]. They
experimented with polynomial, auto-regressive and support vector
regression methods and determined that the first-rate of support
vector regression considerably outperforms other methods.
ensembled classification learning methods. They used Naïve
Bayes classification and artificial network to test for crime
analysis. They identify the crime trends and patterns and predicts
the type of crimes might occur next in a specific locality of
longitude and latitude in a specific schedule of time and season.
Therefore, they can further implement the required combined
techniques for improving a better crime prediction of a single
classifier model by integrating multiple models by using more
datasets with more features. Some researchers like Tabedzki et al.
used the random forest model. By the usage of random forest and
k-nearest neighbor, researchers obtained the first-rate accuracy
across 39 different categories [4]. Since the information was very
noisy, consequently they thought random forest might provide
great effects.
Sathyadevan et al endorse an approach for detecting and figuring
out crime using data mining and machine learning techniques [14].
They implemented k-means clustering for crime detection, where
it generates two crime-clusters. To increase k-means achieved
results, they added GMAPI, which embeds Google maps through
NetBeans. The accuracy that they receive from their model is of
93.62% and 93.99%, respectively. Paper on Different Approaches
for Crime Prediction system by Varshitha D N et al. predicted
crimes based on location and time from previous crimes data
records [15]. They applied deep learning technique to predict
crimes and analyzed sentimental techniques too. Ingilevich et al
used criminal datasets of the city of Saint-Petersburg to implant
the type of the crimes and tried to predict the possible crimes in
future on specific urban area depending on time to decrease the
crimes of that area [16]. They used logistic regression, linear
regression, gradient boosting for this predicting forecasting
classification model. In addition, they compared with the
predictive results and figured out that gradient boosting gives the
high accuracy for this model. They can further extend their work
by focusing on longitude and latitude of a specific urban area with
more features. Sadhana and Sangareddy have used twitter records
and sentiment evaluation to predict crime in real time [17]. They
extensively utilized this fact to map the awareness of crime
occurrences and discover huge scale hotspots.
This paper aims to predict the crime occurrences in Chicago based
on time and location. The algorithms are trained with time
attributes such as “Day”, “Month”, “Year”, “Hour”, “Minute”,
“Second” and with location attributes such as “Location”,
“Location Description”, “Block”, “Latitude” and “Longitude”.
In addition, Phua et al. offer a new fraud detection technique that
is built by thinking about existing fraud detection research [5].
Three distinctive algorithms are used at the identical skewed
statistics. Using these algorithms, the accuracy obtained is greater
than 90%. Chandrasekar et. al. implemented Gradient Boosted
trees and Support Vector Machines in their other paper and
showed that their work on implemented algorithm gives high
accuracy [6]. They have worked on especially centered on one-ofa-kind cities. Last works related to crimes in different cities,
expected many kinds of crimes occurring in the metropolis. The
paper has discovered that the maximum suitable classifiers that
possible practice on those sorts of datasets can be tree-based
Kang et al. analyzed crime occurrences by the usage of
multimodal records in which they have applied deep learning [7].
They found out that DNN version provides greater precision
values in predicting crime prevalence than other prediction
fashions when they are compared with other works. Their present
crime predicting methodology for finding occurrences is not able
to produce statistics based on the unique form of at a selected time.
Prediction of Hourly Effect of Land Used on Crime by
Matijosaitiene et al predicted future crimes based on the time
using Manhattan [8]. They used the random forest and logistic
regression for their predicting model of crimes based on exact
time features when most of the crimes happened. They achieved
high accuracy on random forest algorithms. They also tried to
analyze hot spot feature to predict for controlling crimes in
different areas. In their future work, they can also add specific
longitude and latitude of a specific area where crimes mostly
This paper uses a specific dataset to train the algorithm. The
algorithm that is used to train the dataset are Random Forest,
Decision Tree and different ensemble methods such as Extra
Trees, Bagging and AdaBoost.
Survey of Crime Analysis and Prediction by Mookiah et al studied
crime connected variables, which showed the influencing factor of
crimes and tried to figure out the rate of crimes [9]. Boni et al
worked-on Area-Specific Crime Prediction Models where they
predicted crimes by using zip code located specific area [10]. In
their model, they used crime datasets from Chicago where they
tried to discover two types of model one is hierarchical models
based on certain locality and another is regularized multitasking
for this model. Naïve Bayes Approach for the Crime Prediction in
Data Mining by Jangra et al used Machine learning techniques
and regression techniques for predicting and analyzing of criminal
datasets related for predicting crimes in India based on time and
location [17] [18] [11]. This model gives uniform characteristics
result for noisy data but KNN regression techniques and Naïve
Bayes are utilized for this model and Naïve Bayes gives the high
accuracy for this predictive model.
The following steps are followed for all the implemented
Figure 1. Proposed system.
Combining two datasets - 1990 US Law Enforcement
Management and Administrative Statistics (LEMAS) and crime
In Fig 2. y axis on the graph shows the number of crime rates and
x axis on the graph shows years over the time period from 2001 to
2017. Before the year 2008, there was a fluctuation in crime rates.
In 2008, there was the highest occurrence of crime activities Later,
the crime rates began to fall.
3.1. Features
The dataset that is used is collected from the Chicago Police
Department's CLEAR (Citizen Law Enforcement Analysis and
Reporting) system. The datasets consist of facts on crime
prevalence that has taken area in Chicago over the time of
1/1/2001 to 1/1/2017. The dataset that we used is in a CSV format,
which contains more than 6,000,000 records/rows.
There are different attributes of the dataset. The attributes that are
used in this paper is given in the table:
Table 1. Attributes that is used from the datasets
Location Description
FBI Code
Figure 3. Shows criminal activities happening over a year.
In Fig 3. months are in x-axis and count is in the y-axis. January
to December is represented by 1 to 12. The highest occurrence of
crime rate is during the month of May and the lowest occurrence
of crime rate is on the month of February.
Primary Type
3.2. Data Preprocessing
For preprocessing the dataset, this paper used Tabular software
and Python library Scikit-learn (sklearn).
The dataset consists of some attributes, which are string
values, and other attributes are in numeric values. To train
the model, the text features in this paper’s dataset needs to be
converted right into a numeric value. This conversion is dealt
with by means of the usage of Python library NumPy.
Attributes in our dataset with string type are “Date”,
“Location”, “Location Description” etc. Using python, this
paper assigned numeric values for those capabilities.
Since time is considered as the main factor thus “Date” has
been split into “Day”, “Month”, “Year”, “Hour”, “Minute”,
“Second” attributes.
Figure 4. Criminal activities occurring in the different hour of
the day.
In Fig.4. y axis represents count and x axis represents hour (in 24
hours format). Most crimes occur for the duration of the afternoon
evening. There is a huge change in crook activities at some point
at the time of 6 PM and 8 PM. At 5 AM, the variety of crime
prevalence is least.
Figure 2. Shows criminal activities happening since 2001 to
Figure 5. Criminal activities occurring on different days.
In Fig.5. Number of crime occurrences is represented in y axis and
different days over a month is represented in x axis. Most crimes
occur during the beginning of the month and decrease at the end
of the month.
Decision Tree
The dataset that we used is imbalance as 20000 (Theft) have the
highest frequency for the specific crime occurrences and the
lowest frequency is six for another crime occurrences (Stalking).
That is why; we want to lessen the training, which has a lower
frequency to end up with the balanced dataset.
Extra Tree
The table 2 shows that Bagging gives the highest accuracy and
AdaBoost gives the lowest accuracy among the fixed algorithm
that is used.
Only the top 18 crime classes are utilized to try to reduce the
range of instructions out of 30 categories. All other crime lessens
are categorized through “Other offenses”.
Highest accuracy is acquired with the implement of Bagging
because ensemble method combines several tree classifiers and
gives much better predictive results. The main reason of difference
in actual and predicted values are noise, variance, and bias.
Bagging gives an accuracy of 99.92%, thus minimizing the
maximum difference between actual and predicted values.
AdaBoost creates a strong classifier from several weak classifiers.
AdaBoost generally works best for binary classification. The
dataset used in this paper consists of different categories of crimes.
Therefore, it is a multiclass classification problem. Thus,
AdaBoost provides lowest accuracy among all the algorithm used.
This paper uses five different types of algorithms to predict the
type of crime that might occur based on time and location. The
algorithm involving trees showed that the predicted results is very
much closer to the actual results. Thus, the dataset used, provides
the maximum correct result with higher accuracy when
implemented with different tree classifiers. The stated results in
this paper show that Bagging method works best and AdaBoost
works least well for predicting crimes using time and location.
The results in this paper provides similar results when
implemented with tree-based algorithms. Therefore, this paper
expects to get more variation in the results when implemented
with other classifying algorithms in the future.
Figure 6. shows 13 classes of “Other crimes”.
In Fig 6. shows specific crimes which are considered as “Other
crimes. This is because the number of occurrences involving those
crimes are lower, compared to other classes of crimes available in
the dataset.
[1] Alkesh Bharati and Dr Sarvanaguru RA.K. 2018. Crime
Prediction and Analysis Using Machine Learning.
This paper uses dataset which contains both the mixture of
categorical and numeric values. Thus, the paper mainly focuses on
those algorithms which can work on the combination of both
categorical and numeric values. Also, keeping in mind that, the
algorithm performs well for our classification problem. Therefore,
several algorithms are chosen to serve the purpose such as
Decision Tree, Random forest and several ensemble methods such
as Bagging, AdaBoost and ExtraTree Classifier.
[2] Ankit Sangani, Vijaya Pinjarkar and Chirag Sampat. 2019.
Crime Prediction and Analysis, 2nd International Conference
on Advances in Science & Technology.
[3] Ayisheshim Almaw and Kalyani Kadam. 2018. Survey Paper
on Crime Prediction using Ensemble Approach, International
Journal of Pure and Applied Mathematics, 118 (8), 133-139
[4] Christian Tabedzki, Amruthesh Thirumalaiswamy and Paul
van Vliet. 2018. Yo Home to Bel-Air: Predicting Crime on
The Streets of Philadelphia
The main motive of this paper is to use algorithms on these
datasets to classify the type of crime occurring based on time and
location. The chosen algorithms are applied where it provides a
simple and fast way of learning a function. This is where the
algorithm maps data x to outputs y, where x is a mixture of
categorical and numeric variables and y is the categorical value for
classification. The applied algorithm gives better performance for
any classification problem.
[5] Clifton Phua, Damminda Alahakoon and Vincent Lee. 2004.
Minority Report in Fraud Detection: Classification of
Skewed Data, Sigkdd Explorations, 6(1),51-5
[6] Tayal, D.K., Jain, A., Arora, S., Agarwal, S., Gupta, T. and
Tyagi, N., 2015. Crime detection and criminal identification
in India using data mining techniques. AI & society, 30(1),
The result after reducing the classes is shown in the below table
for all algorithms.
[7] Hyeon-Woo Kang and Hang-Bong Kang. 2018. Prediction of
crime occurrence from multimodal data using deep learning.
Table 2. Comparison of accuracy
Random Forest
[8] Irina Matijosaitiene, Peng Zhao, Sylvain Jaume and Joseph
W. Gilkey Jr. 2018. Prediction of Hourly Effect of Land Use
on Crime, International Journal of Geo-Information, 8, 16,
[14] Sathyadevan, S. and Gangadharan, S., 2014, August. Crime
analysis and prediction using data mining. In 2014 First
International Conference on Networks & Soft Computing
(ICNSC2014) (pp. 406-412). IEEE.
[9] Mookiah, L., Eberle, W. and Siraj, A., 2015, April. Survey of
crime analysis and prediction. In The Twenty-Eighth
International Flairs Conference.
[15] Varshitha D N, Vidyashree K P, Aishwarya P, Janya T S, K
R Dhananjay Gupta and Sahana R. 2017. Paper on Different
Approaches for Crime Prediction system, International
Journal of Engineering Research & Technology (IJERT),
[10] Al Boni, M. and Gerber, M.S., 2016, December. Areaspecific crime prediction models. In 2016 15th IEEE
International Conference on Machine Learning and
Applications (ICMLA)(pp. 671-676). IEEE.
[16] Varvara Ingilevich and Sergey Ivanov. 2018. Crime rate
prediction in the urban environment using social factors,
Procedia Computer Science, 136, 472–478
[11] Mrinalini Jangra and Shaveta Kalsi. 2019. Naïve Bayes
Approach for the Crime Prediction in Data Mining,
International Journal of Computer Applications, 178 (4).
[17] Xinyu Chen, Youngwoon Cho and Suk young Jang. 2015.
Crime Prediction Using Twitter Sentiment and Weather,
IEEE Systems and Information Engineering Design
Symposium., (June 2015).
[18] A. K. Das, A. Ashrafi and M. Ahmmad, “Joint Cognition of
Both Human and Machine for Predicting Criminal
Punishment in Judicial System," 2019 4th International
Conference on Computer and Communication Systems
(ICCCS), Singapore, 2019.
[12] Rizwan Iqbal, Masrah Azrifah Azmi Murad, Aida Mustapha,
Payam Hassany Shariat Panahy, and Nasim Khanahmadliravi.
2013. An Experimental Study of Classification Algorithms
for Crime Prediction. Indian Journal of Science and
Technology, 6, 3 (March. 2013),4220-4225.
[13] Dash, S.K., Safro, I. and Srinivasamurthy, R.S., 2018,
December. Spatio-temporal prediction of crimes using
network analytic approach. In 2018 IEEE International
Conference on Big Data (Big Data) (pp. 1912-1917). IEEE.