As my attempt to predict the category of crimes that occurred in the city by the bay, the dataset retrieved from https://www.kaggle.com/c/sf-crime is a collection of all crimes committed in San Francisco during the period of 6 June, 2003 to 13 May, 2015.

Since the number of rows is pretty huge (878049!!!), I will display the names of columns of the dataset -

##       [,1]        
##  [1,] "Dates"     
##  [2,] "Category"  
##  [3,] "Descript"  
##  [4,] "DayOfWeek" 
##  [5,] "PdDistrict"
##  [6,] "Resolution"
##  [7,] "Address"   
##  [8,] "X"         
##  [9,] "Y"

Other than the five self-explanatory columns,

Analysis 1 - Calculating the number of crimes for each district to determine the one with maximum occurences of crime.

As we can see from the above graph, the “Southern” district has recorded the highest number of crimes and can, thus, be predicted to be at the highest danger. Thus, I won’t be surprised if the rates of real estate start falling in that area after people recognize this trend.

Analysis 2 - Calculating the number of crimes for each district to determine the one with maximum occurences of crime.

Friday has, thus, observed higher crimes than any other day in the history and is, thus, considered as the least safe day to hang around at San Francisco.

Analysis 3 - To find out the outcome of the investigation of the convicted for each crime

As we can see above, most criminals fall under the ‘none’ category, which means that major of the crimes committed in SF do not fall under any of the defined categories of resolution, which is also evidenced by the minute length of several of the bars in the graph

So let us ignore that resolution and see only the well-defined ones

So after overloooking that category, the next highest category is ‘Arrested - Booked’ followed by ‘Arrested - Cited’ which have a much larger number of crimes under them, when compared to the case of ‘unfounded’ crimes, that certifies the capability of the SFPD

Analysis 4 - Calculating the number of each type of crime committed

The most common type of crime committed is ‘Larceny/Theft’, followed by ‘other offenses’


Visualization 1 - Display the locations of occurences of crimes for each district on weekdays? (Monday - Friday)

Visualization 2 - Display the locations of occurences of crimes for each district on weekends (Saturday & Sunday)


In case you need to contact me, please feel free to shoot me an email at rohan27@uw.edu

Thank you for viewing!