I'm trying to predict the primary crime type on a given location using the Chicago crime dataset.
Stripping out all the provided features to just:
- Location Description Encoded (The location information like street, house, apartment - label encoded)
- Beat (An int representing the police patrol route)
And only trying to predict from the types, label encoded:
- Narcotics
- Battery
Yields the highest score against the predictions of about 75% using a DecisionTreeClassifier.
What I did to try and improve on this score, was to include crime cluster information.
For each community area in Chicago (there are 77), I divided each into 10 clusters (using K-Means). Then, for each cluster - I got a percentage for each of my target feature crimes out of all the crimes in the cluster e.g.
Cluster has 100 crimes
BATTERY_CLUSTER_PERCENT = 0.25
THEFT_CLUSTER_PERCENT = 0.15
NARCOTICS_CLUSTER_PERCENT = 0.05
OTHER_CLUSTER_PERCENT = 0.55
And I assigned each of these values to every row for that cluster.
When I went back and tried my model with these features, the score appears to have actually dropped by a percent.
This is my model without the cluster information
And with the cluster information added in:
print(f'DecisionTreeClassifier Score: {model.score(X_test, y_test)}')
DecisionTreeClassifier Score: 0.747892534416884
What's interesting is that my F-1 score increased as well as my ROC.
Why might this happen? Is there anything I can do to improve my score or is this a totally wrong approach?
model.score(X_test, y_test)
is outputting (ever so slightly) lower scores, I would have expected some improvement rather than consistently a tiny bit lower... $\endgroup$DecisionTreeClassifier Score: 0.747892534416884
? That's the output frommodel.score(X_test, y_test)
- it's nearly the same when including or excluding the cluster information. Is there a reason why the model accuracy wouldn't have increased to 0.80 for example? $\endgroup$