forked from dssg/police-eis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dispatch_config.yaml
342 lines (319 loc) · 15.1 KB
/
dispatch_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
################################################
# UChicago DSaPP Police EIS #
# Model experiments #
################################################
store_model_object_in_database: False
########################
# Type of Experiment #
########################
unit: 'dispatch' # possible options: [dispatch, officer]
########################
# Temporal parameters #
########################
# these control what subset of the raw data is used to calculate the features
# used for feature CALCULATION
raw_data_from_date: '2012-01-01'
raw_data_to_date: '2012-04-01'
# these control what subset of the feature rows will be used to train and test
# used for row selection in MODELING
fake_today: ['01Mar2012'] # if you want a specific_today then pass this
training_window: [730] # training, days
prediction_window: [365] # prediction, days
########################
# Labelling Details #
########################
# NOTE: this ratio = n_label_1 / n_total
under_sampling_ratio: 0.1
# select which officers to generate labels for
labelling:
include_all_employed: True # include all officers who were employed during the specified period
include_all_active: True # include all officers who made an arrest or stop during the specified period.
def_adverse:
accidents: True
useofforce: True
complaint: True
officer_labels:
dispatch_labels:
LabelSustained: True
LabelUnjustified: True
LabelPreventable: True
########################
# Feature selection #
########################
dispatch_feature_table_name: 'diditwork3'
officer_features:
investigation_count_career: True
arrest_count_career: True
arrest_count_1yr: True
dispatch_features:
LabelSustained: True
LabelUnjustified: True
LabelPreventable: True
DispatchMinute: True
DispatchHour: True
DispatchDayOfWeek: True
DispatchYearQuarter: True
DispatchMonth: True
DispatchYear: True
OriginalPriority: True
DispatchType: True
DispatchSubType: True
NumberOfUnitsAssigned: True
AverageOfficerTravelTime: True
MinimumOfficerTravelTime: False
MaximumOfficerTravelTime: False
DispatchCategory: True
ArrestsInPast1Hour: True
ArrestsInPast6Hours: True
ArrestsInPast12Hours: False
ArrestsInPast24Hours: True
ArrestsInPast48Hours: False
ArrestsInPastWeek: True
FelonyArrestsInPast1Hour: True
FelonyArrestsInPast6Hours: True
FelonyArrestsInPast12Hours: False
FelonyArrestsInPast24Hours: False
FelonyArrestsInPast48Hours: False
FelonyArrestsInPastWeek: False
DrugsArrestsInPast1Hour: False
DrugsArrestsInPast6Hours: False
DrugsArrestsInPast12Hours: False
DrugsArrestsInPast24Hours: False
DrugsArrestsInPast48Hours: False
DrugsArrestsInPastWeek: False
StolenVehicleArrestsInPast1Hour: False
StolenVehicleArrestsInPast6Hours: False
StolenVehicleArrestsInPast12Hours: False
StolenVehicleArrestsInPast24Hours: False
StolenVehicleArrestsInPast48Hours: False
StolenVehicleArrestsInPastWeek: False
OfficersDispatchedInPast1Minute: False
OfficersDispatchedInPast15Minutes: False
OfficersDispatchedInPast30Minutes:
OfficersDispatchedInPast1Hour: True
OfficersDispatchedAverageUnjustifiedIncidentsInPast3Years: True
OfficersDispatchedAverageJustifiedIncidentsInPast3Years: True
OfficersDispatchedAveragePreventableIncidentsInPast3Years: True
OfficersDispatchedAverageNonPreventableIncidentsInPast3Years: True
OfficersDispatchedAverageSustainedAllegationsInPast3Years: True
OfficersDispatchedAverageUnsustainedAllegationsInPast3Years: True
OfficersDispatchedAverageUnjustifiedIncidentsInPastYear: False
OfficersDispatchedAverageJustifiedIncidentsInPastYear: False
OfficersDispatchedAveragePreventableIncidentsInPastYear: False
OfficersDispatchedAverageNonPreventableIncidentsInPastYear: False
OfficersDispatchedAverageSustainedAllegationsInPastYear: False
OfficersDispatchedAverageUnsustainedAllegationsInPastYear: False
OfficersDispatchedAverageUnjustifiedIncidentsInPast6Months: False
OfficersDispatchedAverageJustifiedIncidentsInPast6Months: False
OfficersDispatchedAveragePreventableIncidentsInPast6Months: False
OfficersDispatchedAverageNonPreventableIncidentsInPast6Months: False
OfficersDispatchedAverageSustainedAllegationsInPast6Months: False
OfficersDispatchedAverageUnsustainedAllegationsInPast6Months: False
OfficersDispatchedAverageUnjustifiedIncidentsInPast1Month: False
OfficersDispatchedAverageJustifiedIncidentsInPast1Month: False
OfficersDispatchedAveragePreventableIncidentsInPast1Month: False
OfficersDispatchedAverageNonPreventableIncidentsInPast1Month: False
OfficersDispatchedAverageSustainedAllegationsInPast1Month: False
OfficersDispatchedAverageUnsustainedAllegationsInPast1Month: False
OfficersDispatchedMinimumUnjustifiedIncidentsInPast3Years: False
OfficersDispatchedMinimumJustifiedIncidentsInPast3Years: False
OfficersDispatchedMinimumPreventableIncidentsInPast3Years: False
OfficersDispatchedMinimumNonPreventableIncidentsInPast3Years: False
OfficersDispatchedMinimumSustainedAllegationsInPast3Years: False
OfficersDispatchedMinimumUnsustainedAllegationsInPast3Years: False
OfficersDispatchedMinimumUnjustifiedIncidentsInPastYear: False
OfficersDispatchedMinimumJustifiedIncidentsInPastYear: False
OfficersDispatchedMinimumPreventableIncidentsInPastYear: False
OfficersDispatchedMinimumNonPreventableIncidentsInPastYear: False
OfficersDispatchedMinimumSustainedAllegationsInPastYear: False
OfficersDispatchedMinimumUnsustainedAllegationsInPastYear: False
OfficersDispatchedMinimumUnjustifiedIncidentsInPast6Months: False
OfficersDispatchedMinimumJustifiedIncidentsInPast6Months: False
OfficersDispatchedMinimumPreventableIncidentsInPast6Months: False
OfficersDispatchedMinimumNonPreventableIncidentsInPast6Months: False
OfficersDispatchedMinimumSustainedAllegationsInPast6Months: False
OfficersDispatchedMinimumUnsustainedAllegationsInPast6Months: False
OfficersDispatchedMinimumUnjustifiedIncidentsInPast1Month: False
OfficersDispatchedMinimumJustifiedIncidentsInPast1Month: False
OfficersDispatchedMinimumPreventableIncidentsInPast1Month: False
OfficersDispatchedMinimumNonPreventableIncidentsInPast1Month: False
OfficersDispatchedMinimumSustainedAllegationsInPast1Month: False
OfficersDispatchedMinimumUnsustainedAllegationsInPast1Month: False
OfficersDispatchedMaximumUnjustifiedIncidentsInPast3Years: False
OfficersDispatchedMaximumJustifiedIncidentsInPast3Years: False
OfficersDispatchedMaximumPreventableIncidentsInPast3Years: False
OfficersDispatchedMaximumNonPreventableIncidentsInPast3Years: False
OfficersDispatchedMaximumSustainedAllegationsInPast3Years: False
OfficersDispatchedMaximumUnsustainedAllegationsInPast3Years: False
OfficersDispatchedMaximumUnjustifiedIncidentsInPastYear: False
OfficersDispatchedMaximumJustifiedIncidentsInPastYear: False
OfficersDispatchedMaximumPreventableIncidentsInPastYear: False
OfficersDispatchedMaximumNonPreventableIncidentsInPastYear: False
OfficersDispatchedMaximumSustainedAllegationsInPastYear: False
OfficersDispatchedMaximumUnsustainedAllegationsInPastYear: False
OfficersDispatchedMaximumUnjustifiedIncidentsInPast6Months: False
OfficersDispatchedMaximumJustifiedIncidentsInPast6Months: False
OfficersDispatchedMaximumPreventableIncidentsInPast6Months: False
OfficersDispatchedMaximumNonPreventableIncidentsInPast6Months: False
OfficersDispatchedMaximumSustainedAllegationsInPast6Months: False
OfficersDispatchedMaximumUnsustainedAllegationsInPast6Months: False
OfficersDispatchedMaximumUnjustifiedIncidentsInPast1Month: False
OfficersDispatchedMaximumJustifiedIncidentsInPast1Month: False
OfficersDispatchedMaximumPreventableIncidentsInPast1Month: False
OfficersDispatchedMaximumNonPreventableIncidentsInPast1Month: False
OfficersDispatchedMaximumSustainedAllegationsInPast1Month: False
OfficersDispatchedMaximumUnsustainedAllegationsInPast1Month: False
AverageAgeOfRespondingOfficers: True
MaximumAgeOfRespondingOfficers: False
MinimumAgeOfRespondingOfficers: False
HighestEducationLevelAmongRespondingOfficers: False
LowestEducationLevelAmongRespondingOfficers: False
ProportionOfRespondingOfficersWithFourYearCollegeDegreeOrHigher: False
ProportionOfRespondingOfficersMale: True
ProportionOfRespondingOfficersBlack: True
ProportionOfRespondingOfficersHispanic: True
ProportionOfRespondingOfficersAsian: False
ProportionOfRespondingOfficersOtherRace: False
ProportionOfRespondingOfficersDivorcedOrSeparated: True
ProportionOfRespondingOfficersMarried: True
MedianAgeInCT: True
MedianAgeOfMenInCT: False
MedianAgeOfWomenInCT: False
UnweightedSampleCountOfPopulationInCT: True
UnweightedSampleCountOfHousingUnitsInCT: True
PercentageMenInCT: True
PercentageWomenInCT: False
PercentageWhiteInCT: False
PercentageBlackInCT: True
PercentageAsianInCT: False
PercentageHispanicInCT: True
PercentageForeignBornInCT: False
ProportionOfPopulationUnderAge18InCT: True
ProportionOfPopulationEnrolledInSchoolInCT: False
ProportionOfPopulationOver25WithLessThanHighSchoolEducationInCT: False
ProportionOfPopulationVeteransInCT: False
ProportionOfPopulationWithIncomeBelowPovertyLevelInPastYearInCT: False
ProportionOfPopulationWithIncomeInPast12MonthsBelow45000DollarsInCT: False
MedianIncomeInPast12MonthsInCT: False
MedianHouseholdIncomeInPast12MonthsInCT: False
ProportionOfHouseholdsReceivingAssistanceOrFoodStampsInCT: False
ProportionOfHousingUnitsVacantInCT: False
ProportionOfHousingUnitsOccupiedByOwnerInCT: False
MedianYearStructureBuildInCT: False
MedianYearRenterMovedIntoHousingUnitInCT: False
MedianYearOwnerMovedIntoHousingUnitInCT: False
MedianGrossRentInCT: False
MedianPropertyValueInCT: False
LowerQuartilePropertyValueInCT: False
UpperQuartilePropertyValueInCT: False
AverageHouseholdSizeInCT: True
ProportionOfChildrenUnder18LivingWithSingleParentInCT: True
ProportionOfChildrenUnder18LivingWithMotherInCT: False
ProportionOfPopulationNeverMarriedInCT: False
ProportionOfPopulationDivorcedOrSeparatedInCT: False
ProportionOfPopulationWithoutHealthInsuranceInCT: False
ProportionOfWomenWhoGaveBirthInPast12MonthsInCT: False
ArrestsWithin1kmRadiusInPast1Hour: False
ArrestsWithin1kmRadiusInPast6Hours: True
ArrestsWithin1kmRadiusInPast12Hours: False
ArrestsWithin1kmRadiusInPast24Hours: False
ArrestsWithin500mRadiusInPast1Hour: False
ArrestsWithin500mRadiusInPast6Hours: False
ArrestsWithin500mRadiusInPast12Hours: True
ArrestsWithin500mRadiusInPast24Hours: False
ArrestsWithin100mRadiusInPast1Hour: True
ArrestsWithin100mRadiusInPast6Hours: False
ArrestsWithin100mRadiusInPast12Hours: False
ArrestsWithin100mRadiusInPast24Hours: True
DispatchesWithin1kmRadiusInPast15Minutes: False
DispatchesWithin1kmRadiusInPast30Minutes: False
DispatchesWithin1kmRadiusInPast1Hour: True
DispatchesWithin500mRadiusInPast15Minutes: False
DispatchesWithin500mRadiusInPast30Minutes: False
DispatchesWithin500mRadiusInPast1Hour: False
DispatchesWithin100mRadiusInPast15Minutes: False
DispatchesWithin100mRadiusInPast30Minutes: False
DispatchesWithin100mRadiusInPast1Hour: False
AverageOfficerDispatchesWithin100mRadiusInPast1Hour: True
AverageOfficerDispatchesWithin100mRadiusInPast3Hours: False
AverageOfficerDispatchesWithin100mRadiusInPast6Hours: False
AverageOfficerDispatchesWithin100mRadiusInPast24Hours: True
AverageOfficerDispatchesWithin100mRadiusInPast48Hours: False
AverageOfficerDispatchesWithin500mRadiusInPast1Hour: False
AverageOfficerDispatchesWithin500mRadiusInPast3Hours: False
AverageOfficerDispatchesWithin500mRadiusInPast6Hours: False
AverageOfficerDispatchesWithin500mRadiusInPast24Hours: True
AverageOfficerDispatchesWithin500mRadiusInPast48Hours: False
AverageOfficerDispatchesWithin1kmRadiusInPast1Hour: True
AverageOfficerDispatchesWithin1kmRadiusInPast3Hours: False
AverageOfficerDispatchesWithin1kmRadiusInPast6Hours: False
AverageOfficerDispatchesWithin1kmRadiusInPast24Hours: False
AverageOfficerDispatchesWithin1kmRadiusInPast48Hours: False
MaximumOfficerDispatchesWithin100mRadiusInPast1Hour: False
MaximumOfficerDispatchesWithin100mRadiusInPast3Hours: False
MaximumOfficerDispatchesWithin100mRadiusInPast6Hours: False
MaximumOfficerDispatchesWithin100mRadiusInPast24Hours: False
MaximumOfficerDispatchesWithin100mRadiusInPast48Hours: False
MaximumOfficerDispatchesWithin500mRadiusInPast1Hour: False
MaximumOfficerDispatchesWithin500mRadiusInPast3Hours: False
MaximumOfficerDispatchesWithin500mRadiusInPast6Hours: False
MaximumOfficerDispatchesWithin500mRadiusInPast24Hours: False
MaximumOfficerDispatchesWithin500mRadiusInPast48Hours: False
MaximumOfficerDispatchesWithin1kmRadiusInPast1Hour: False
MaximumOfficerDispatchesWithin1kmRadiusInPast3Hours: False
MaximumOfficerDispatchesWithin1kmRadiusInPast6Hours: False
MaximumOfficerDispatchesWithin1kmRadiusInPast24Hours: False
MaximumOfficerDispatchesWithin1kmRadiusInPast48Hours: False
########################
# Model selection #
########################
model: ['RandomForest' , 'LogisticRegression','ExtraTrees'] #, 'AdaBoost', 'SVM']
parameters:
RandomForest:
n_estimators: [100] # [10, 25, 50, 100] # [1000, 10000]
max_depth: [20] # [5, 10, 20] # 50, 100
max_features: ['sqrt'] # 'log2'] # [2, 4, 8, 16, "auto"]
criterion: ['gini'] # ['gini' ] #'entropy']
min_samples_split: [2] #[2, 5] #, 10]
ExtraTrees:
n_estimators: [50] #10, 25, 50, 100, 1000] #, 10000]
max_depth: [20] #[5, 10, 20] # 50, 100
max_features: ['sqrt'] # , 'log2'] # [2, 4, 8, 16, "auto"]
criterion: ['gini'] # , 'entropy']
min_samples_split: [2] #5, 10]
AdaBoost:
algorithm: ['SAMME', 'SAMME.R']
n_estimators: [1, 10, 100] # [1000, 10000]
learning_rate: [0.01, 0.1, 1, 10, 100]
LogisticRegression:
C_reg: [0.01] # [0.00001, 0.0001, 0.001, 0.01, 0.1, 1, 10]
penalty: ['l1'] #, 'l2']
SVM:
C_reg: [0.001, 0.01, 0.1, 1] # [0.00001, 0.0001, 0.001, 0.01, 0.1, 1, 10]
kernel: ['linear']
GradientBoostingClassifier:
n_estimators: [1, 10, 100] # [1000, 10000]
learning_rate: [0.001, 0.01, 0.05, 0.1, 0.5]
subsample: [0.1, 0.5, 1.0]
max_depth: [1, 3, 5, 10, 20] # [50, 100]
DecisionTreeClassifier:
criterion: ['gini', 'entropy']
max_depth: [1, 5, 10, 20] # [50, 100]
max_features: ['sqrt', 'log2']
min_samples_split: [2, 5, 10]
SGDClassifier:
loss: ['log', 'modified_huber']
penalty: ['l1', 'l2', 'elasticnet']
KNeighborsClassifier:
n_neighbors: [1, 3, 5, 10, 25, 50, 100]
weights: ['uniform', 'distance']
algorithm: ['auto', 'kd_tree']
########################
# Parallelization #
########################
n_cpus: 4
########################
# Output file details #
########################
directory: 'results/'
pkl_prefix: 'dispatch_results'