pppereira3 commited on
Commit
47c294e
1 Parent(s): 4a5cf53

pushing files to the repo from the example!

Browse files
Files changed (3) hide show
  1. NYC_SQF_ARR_KNN.pkl +2 -2
  2. README.md +90 -102
  3. config.json +28 -46
NYC_SQF_ARR_KNN.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:29b81bb4cbcc372f68425a413c98361435f9d9914c9dff141cdeacf1a6720f7b
3
- size 1381355
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a4f63d22909c913b902bdd00c4c863ac10878f7a81b9d8923bd79fb09de2619
3
+ size 1174667
README.md CHANGED
@@ -11,29 +11,29 @@ widget:
11
  ASK_FOR_CONSENT_FLG:
12
  - 1
13
  - 1
14
- - 0
15
  CONSENT_GIVEN_FLG:
 
16
  - 1
17
  - 0
18
- - 0
19
  FIREARM_FLAG:
20
  - 0
21
  - 0
22
  - 0
23
  FRISKED_FLAG:
24
  - 1
25
- - 1
26
  - 1
27
  ISSUING_OFFICER_RANK:
28
- - 10
29
- - 13
30
  - 9
 
31
  KNIFE_CUTTER_FLAG:
32
  - 0
33
  - 0
34
  - 0
35
  OTHER_CONTRABAND_FLAG:
36
- - 1
37
  - 0
38
  - 0
39
  OTHER_WEAPON_FLAG:
@@ -41,53 +41,41 @@ widget:
41
  - 0
42
  - 0
43
  SEARCHED_FLAG:
44
- - 1
45
  - 0
46
- - 1
47
- STOP_ID:
48
- - 8283
49
- - 4532
50
- - 14787
51
  STOP_LOCATION_PRECINCT:
52
- - 90
53
- - 40
54
- - 106
55
  SUPERVISING_OFFICER_RANK:
56
  - 12
57
- - 7
58
  - 12
59
  SUSPECT_BODY_BUILD_TYPE:
60
  - 2
61
  - 3
62
- - 3
63
  SUSPECT_HEIGHT:
64
- - 5.7
65
- - 5.1
66
- - 5.6
67
  SUSPECT_RACE_DESCRIPTION:
68
- - 7
 
69
  - 3
70
- - 7
71
  SUSPECT_REPORTED_AGE:
72
- - 22.0
73
- - 20.0
74
- - 30.0
75
  SUSPECT_SEX:
76
- - 1
77
  - 2
78
  - 2
79
  SUSPECT_WEIGHT:
80
- - 135.0
81
- - 170.0
82
- - 150.0
83
- WEAPON_FOUND_FLAG:
84
- - 0
85
- - 0
86
- - 0
87
- __index_level_0__:
88
- - 8282
89
- - 4531
90
- - 14786
91
  ---
92
 
93
  # Model description
@@ -107,80 +95,80 @@ widget:
107
  <details>
108
  <summary> Click to expand </summary>
109
 
110
- | Hyperparameter | Value |
111
- |-----------------------|---------------------------------------------------------------|
112
- | memory | |
113
- | steps | [('scaler', MinMaxScaler()), ('knn', KNeighborsClassifier())] |
114
- | verbose | False |
115
- | scaler | MinMaxScaler() |
116
- | knn | KNeighborsClassifier() |
117
- | scaler__clip | False |
118
- | scaler__copy | True |
119
- | scaler__feature_range | (0, 1) |
120
- | knn__algorithm | auto |
121
- | knn__leaf_size | 30 |
122
- | knn__metric | minkowski |
123
- | knn__metric_params | |
124
- | knn__n_jobs | |
125
- | knn__n_neighbors | 5 |
126
- | knn__p | 2 |
127
- | knn__weights | uniform |
128
 
129
  </details>
130
 
131
  ### Model Plot
132
 
133
- <style>#sk-container-id-2 {/* Definition of color scheme common for light and dark mode */--sklearn-color-text: black;--sklearn-color-line: gray;/* Definition of color scheme for unfitted estimators */--sklearn-color-unfitted-level-0: #fff5e6;--sklearn-color-unfitted-level-1: #f6e4d2;--sklearn-color-unfitted-level-2: #ffe0b3;--sklearn-color-unfitted-level-3: chocolate;/* Definition of color scheme for fitted estimators */--sklearn-color-fitted-level-0: #f0f8ff;--sklearn-color-fitted-level-1: #d4ebff;--sklearn-color-fitted-level-2: #b3dbfd;--sklearn-color-fitted-level-3: cornflowerblue;/* Specific color for light theme */--sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));--sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));--sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));--sklearn-color-icon: #696969;@media (prefers-color-scheme: dark) {/* Redefinition of color scheme for dark theme */--sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));--sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));--sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));--sklearn-color-icon: #878787;}
134
- }#sk-container-id-2 {color: var(--sklearn-color-text);
135
- }#sk-container-id-2 pre {padding: 0;
136
- }#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;
137
- }#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed var(--sklearn-color-line);margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: var(--sklearn-color-background);
138
- }#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }`but bootstrap.min.css set `[hidden] { display: none !important; }`so we also need the `!important` here to be able to override thedefault hidden behavior on the sphinx rendered scikit-learn.org.See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;
139
- }#sk-container-id-2 div.sk-text-repr-fallback {display: none;
140
  }div.sk-parallel-item,
141
  div.sk-serial,
142
  div.sk-item {/* draw centered vertical line to link estimators */background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));background-size: 2px 100%;background-repeat: no-repeat;background-position: center center;
143
- }/* Parallel-specific style estimator block */#sk-container-id-2 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 2px solid var(--sklearn-color-text-on-default-background);flex-grow: 1;
144
- }#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: var(--sklearn-color-background);position: relative;
145
- }#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;
146
- }#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;
147
- }#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;
148
- }#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;
149
- }/* Serial-specific style estimator block */#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: var(--sklearn-color-background);padding-right: 1em;padding-left: 1em;
150
  }/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is
151
  clickable and can be expanded/collapsed.
152
  - Pipeline and ColumnTransformer use this feature and define the default style
153
  - Estimators will overwrite some part of the style using the `sk-estimator` class
154
- *//* Pipeline and ColumnTransformer style (default) */#sk-container-id-2 div.sk-toggleable {/* Default theme specific background. It is overwritten whether we have aspecific estimator or a Pipeline/ColumnTransformer */background-color: var(--sklearn-color-background);
155
  }/* Toggleable label */
156
- #sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.5em;box-sizing: border-box;text-align: center;
157
- }#sk-container-id-2 label.sk-toggleable__label-arrow:before {/* Arrow on the left of the label */content: "▸";float: left;margin-right: 0.25em;color: var(--sklearn-color-icon);
158
- }#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: var(--sklearn-color-text);
159
- }/* Toggleable content - dropdown */#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
160
- }#sk-container-id-2 div.sk-toggleable__content.fitted {/* fitted */background-color: var(--sklearn-color-fitted-level-0);
161
- }#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;border-radius: 0.25em;color: var(--sklearn-color-text);/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
162
- }#sk-container-id-2 div.sk-toggleable__content.fitted pre {/* unfitted */background-color: var(--sklearn-color-fitted-level-0);
163
- }#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {/* Expand drop-down */max-height: 200px;max-width: 100%;overflow: auto;
164
- }#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";
165
- }/* Pipeline/ColumnTransformer-specific style */#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {color: var(--sklearn-color-text);background-color: var(--sklearn-color-unfitted-level-2);
166
- }#sk-container-id-2 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: var(--sklearn-color-fitted-level-2);
167
  }/* Estimator-specific style *//* Colorize estimator box */
168
- #sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {/* unfitted */background-color: var(--sklearn-color-unfitted-level-2);
169
- }#sk-container-id-2 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {/* fitted */background-color: var(--sklearn-color-fitted-level-2);
170
- }#sk-container-id-2 div.sk-label label.sk-toggleable__label,
171
- #sk-container-id-2 div.sk-label label {/* The background is the default theme color */color: var(--sklearn-color-text-on-default-background);
172
  }/* On hover, darken the color of the background */
173
- #sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {color: var(--sklearn-color-text);background-color: var(--sklearn-color-unfitted-level-2);
174
  }/* Label box, darken color on hover, fitted */
175
- #sk-container-id-2 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {color: var(--sklearn-color-text);background-color: var(--sklearn-color-fitted-level-2);
176
- }/* Estimator label */#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;
177
- }#sk-container-id-2 div.sk-label-container {text-align: center;
178
  }/* Estimator-specific */
179
- #sk-container-id-2 div.sk-estimator {font-family: monospace;border: 1px dotted var(--sklearn-color-border-box);border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
180
- }#sk-container-id-2 div.sk-estimator.fitted {/* fitted */background-color: var(--sklearn-color-fitted-level-0);
181
  }/* on hover */
182
- #sk-container-id-2 div.sk-estimator:hover {/* unfitted */background-color: var(--sklearn-color-unfitted-level-2);
183
- }#sk-container-id-2 div.sk-estimator.fitted:hover {/* fitted */background-color: var(--sklearn-color-fitted-level-2);
184
  }/* Specification for estimator info (e.g. "i" and "?") *//* Common style for "i" and "?" */.sk-estimator-doc-link,
185
  a:link.sk-estimator-doc-link,
186
  a:visited.sk-estimator-doc-link {float: right;font-size: smaller;line-height: 1em;font-family: monospace;background-color: var(--sklearn-color-background);border-radius: 1em;height: 1em;width: 1em;text-decoration: none !important;margin-left: 1ex;/* unfitted */border: var(--sklearn-color-unfitted-level-1) 1pt solid;color: var(--sklearn-color-unfitted-level-1);
@@ -200,22 +188,22 @@ div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,
200
  .sk-estimator-doc-link span {display: none;z-index: 9999;position: relative;font-weight: normal;right: .2ex;padding: .5ex;margin: .5ex;width: min-content;min-width: 20ex;max-width: 50ex;color: var(--sklearn-color-text);box-shadow: 2pt 2pt 4pt #999;/* unfitted */background: var(--sklearn-color-unfitted-level-0);border: .5pt solid var(--sklearn-color-unfitted-level-3);
201
  }.sk-estimator-doc-link.fitted span {/* fitted */background: var(--sklearn-color-fitted-level-0);border: var(--sklearn-color-fitted-level-3);
202
  }.sk-estimator-doc-link:hover span {display: block;
203
- }/* "?"-specific style due to the `<a>` HTML tag */#sk-container-id-2 a.estimator_doc_link {float: right;font-size: 1rem;line-height: 1em;font-family: monospace;background-color: var(--sklearn-color-background);border-radius: 1rem;height: 1rem;width: 1rem;text-decoration: none;/* unfitted */color: var(--sklearn-color-unfitted-level-1);border: var(--sklearn-color-unfitted-level-1) 1pt solid;
204
- }#sk-container-id-2 a.estimator_doc_link.fitted {/* fitted */border: var(--sklearn-color-fitted-level-1) 1pt solid;color: var(--sklearn-color-fitted-level-1);
205
  }/* On hover */
206
- #sk-container-id-2 a.estimator_doc_link:hover {/* unfitted */background-color: var(--sklearn-color-unfitted-level-3);color: var(--sklearn-color-background);text-decoration: none;
207
- }#sk-container-id-2 a.estimator_doc_link.fitted:hover {/* fitted */background-color: var(--sklearn-color-fitted-level-3);
208
  }
209
- </style><div id="sk-container-id-2" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>Pipeline(steps=[(&#x27;scaler&#x27;, MinMaxScaler()), (&#x27;knn&#x27;, KNeighborsClassifier())])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item sk-dashed-wrapped"><div class="sk-label-container"><div class="sk-label fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-4" type="checkbox" ><label for="sk-estimator-id-4" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;&nbsp;Pipeline<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.pipeline.Pipeline.html">?<span>Documentation for Pipeline</span></a><span class="sk-estimator-doc-link fitted">i<span>Fitted</span></span></label><div class="sk-toggleable__content fitted"><pre>Pipeline(steps=[(&#x27;scaler&#x27;, MinMaxScaler()), (&#x27;knn&#x27;, KNeighborsClassifier())])</pre></div> </div></div><div class="sk-serial"><div class="sk-item"><div class="sk-estimator fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-5" type="checkbox" ><label for="sk-estimator-id-5" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;MinMaxScaler<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.preprocessing.MinMaxScaler.html">?<span>Documentation for MinMaxScaler</span></a></label><div class="sk-toggleable__content fitted"><pre>MinMaxScaler()</pre></div> </div></div><div class="sk-item"><div class="sk-estimator fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-6" type="checkbox" ><label for="sk-estimator-id-6" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;KNeighborsClassifier<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.neighbors.KNeighborsClassifier.html">?<span>Documentation for KNeighborsClassifier</span></a></label><div class="sk-toggleable__content fitted"><pre>KNeighborsClassifier()</pre></div> </div></div></div></div></div></div>
210
 
211
  ## Evaluation Results
212
 
213
  | Metric | Value |
214
  |-----------|----------|
215
- | accuracy | 0.84621 |
216
- | f1 score | 0.737695 |
217
- | precision | 0.804348 |
218
- | recall | 0.681243 |
219
 
220
  # How to Get Started with the Model
221
 
 
11
  ASK_FOR_CONSENT_FLG:
12
  - 1
13
  - 1
14
+ - 1
15
  CONSENT_GIVEN_FLG:
16
+ - 2
17
  - 1
18
  - 0
 
19
  FIREARM_FLAG:
20
  - 0
21
  - 0
22
  - 0
23
  FRISKED_FLAG:
24
  - 1
25
+ - 0
26
  - 1
27
  ISSUING_OFFICER_RANK:
28
+ - 11
 
29
  - 9
30
+ - 11
31
  KNIFE_CUTTER_FLAG:
32
  - 0
33
  - 0
34
  - 0
35
  OTHER_CONTRABAND_FLAG:
36
+ - 0
37
  - 0
38
  - 0
39
  OTHER_WEAPON_FLAG:
 
41
  - 0
42
  - 0
43
  SEARCHED_FLAG:
 
44
  - 0
45
+ - 0
46
+ - 0
 
 
 
47
  STOP_LOCATION_PRECINCT:
48
+ - 68
49
+ - 107
50
+ - 75
51
  SUPERVISING_OFFICER_RANK:
52
  - 12
53
+ - 12
54
  - 12
55
  SUSPECT_BODY_BUILD_TYPE:
56
  - 2
57
  - 3
58
+ - 2
59
  SUSPECT_HEIGHT:
60
+ - 6.4
61
+ - 5.9
62
+ - 5.9
63
  SUSPECT_RACE_DESCRIPTION:
64
+ - 6
65
+ - 4
66
  - 3
 
67
  SUSPECT_REPORTED_AGE:
68
+ - 21.0
69
+ - 68.0
70
+ - 18.0
71
  SUSPECT_SEX:
72
+ - 2
73
  - 2
74
  - 2
75
  SUSPECT_WEIGHT:
76
+ - 160.0
77
+ - 180.0
78
+ - 140.0
 
 
 
 
 
 
 
 
79
  ---
80
 
81
  # Model description
 
95
  <details>
96
  <summary> Click to expand </summary>
97
 
98
+ | Hyperparameter | Value |
99
+ |-----------------------|-----------------------------------------------------------------------------|
100
+ | memory | |
101
+ | steps | [('scaler', MinMaxScaler()), ('knn', KNeighborsClassifier(n_neighbors=15))] |
102
+ | verbose | False |
103
+ | scaler | MinMaxScaler() |
104
+ | knn | KNeighborsClassifier(n_neighbors=15) |
105
+ | scaler__clip | False |
106
+ | scaler__copy | True |
107
+ | scaler__feature_range | (0, 1) |
108
+ | knn__algorithm | auto |
109
+ | knn__leaf_size | 30 |
110
+ | knn__metric | minkowski |
111
+ | knn__metric_params | |
112
+ | knn__n_jobs | |
113
+ | knn__n_neighbors | 15 |
114
+ | knn__p | 2 |
115
+ | knn__weights | uniform |
116
 
117
  </details>
118
 
119
  ### Model Plot
120
 
121
+ <style>#sk-container-id-4 {/* Definition of color scheme common for light and dark mode */--sklearn-color-text: black;--sklearn-color-line: gray;/* Definition of color scheme for unfitted estimators */--sklearn-color-unfitted-level-0: #fff5e6;--sklearn-color-unfitted-level-1: #f6e4d2;--sklearn-color-unfitted-level-2: #ffe0b3;--sklearn-color-unfitted-level-3: chocolate;/* Definition of color scheme for fitted estimators */--sklearn-color-fitted-level-0: #f0f8ff;--sklearn-color-fitted-level-1: #d4ebff;--sklearn-color-fitted-level-2: #b3dbfd;--sklearn-color-fitted-level-3: cornflowerblue;/* Specific color for light theme */--sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));--sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));--sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));--sklearn-color-icon: #696969;@media (prefers-color-scheme: dark) {/* Redefinition of color scheme for dark theme */--sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));--sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));--sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));--sklearn-color-icon: #878787;}
122
+ }#sk-container-id-4 {color: var(--sklearn-color-text);
123
+ }#sk-container-id-4 pre {padding: 0;
124
+ }#sk-container-id-4 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;
125
+ }#sk-container-id-4 div.sk-dashed-wrapped {border: 1px dashed var(--sklearn-color-line);margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: var(--sklearn-color-background);
126
+ }#sk-container-id-4 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }`but bootstrap.min.css set `[hidden] { display: none !important; }`so we also need the `!important` here to be able to override thedefault hidden behavior on the sphinx rendered scikit-learn.org.See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;
127
+ }#sk-container-id-4 div.sk-text-repr-fallback {display: none;
128
  }div.sk-parallel-item,
129
  div.sk-serial,
130
  div.sk-item {/* draw centered vertical line to link estimators */background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));background-size: 2px 100%;background-repeat: no-repeat;background-position: center center;
131
+ }/* Parallel-specific style estimator block */#sk-container-id-4 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 2px solid var(--sklearn-color-text-on-default-background);flex-grow: 1;
132
+ }#sk-container-id-4 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: var(--sklearn-color-background);position: relative;
133
+ }#sk-container-id-4 div.sk-parallel-item {display: flex;flex-direction: column;
134
+ }#sk-container-id-4 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;
135
+ }#sk-container-id-4 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;
136
+ }#sk-container-id-4 div.sk-parallel-item:only-child::after {width: 0;
137
+ }/* Serial-specific style estimator block */#sk-container-id-4 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: var(--sklearn-color-background);padding-right: 1em;padding-left: 1em;
138
  }/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is
139
  clickable and can be expanded/collapsed.
140
  - Pipeline and ColumnTransformer use this feature and define the default style
141
  - Estimators will overwrite some part of the style using the `sk-estimator` class
142
+ *//* Pipeline and ColumnTransformer style (default) */#sk-container-id-4 div.sk-toggleable {/* Default theme specific background. It is overwritten whether we have aspecific estimator or a Pipeline/ColumnTransformer */background-color: var(--sklearn-color-background);
143
  }/* Toggleable label */
144
+ #sk-container-id-4 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.5em;box-sizing: border-box;text-align: center;
145
+ }#sk-container-id-4 label.sk-toggleable__label-arrow:before {/* Arrow on the left of the label */content: "▸";float: left;margin-right: 0.25em;color: var(--sklearn-color-icon);
146
+ }#sk-container-id-4 label.sk-toggleable__label-arrow:hover:before {color: var(--sklearn-color-text);
147
+ }/* Toggleable content - dropdown */#sk-container-id-4 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
148
+ }#sk-container-id-4 div.sk-toggleable__content.fitted {/* fitted */background-color: var(--sklearn-color-fitted-level-0);
149
+ }#sk-container-id-4 div.sk-toggleable__content pre {margin: 0.2em;border-radius: 0.25em;color: var(--sklearn-color-text);/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
150
+ }#sk-container-id-4 div.sk-toggleable__content.fitted pre {/* unfitted */background-color: var(--sklearn-color-fitted-level-0);
151
+ }#sk-container-id-4 input.sk-toggleable__control:checked~div.sk-toggleable__content {/* Expand drop-down */max-height: 200px;max-width: 100%;overflow: auto;
152
+ }#sk-container-id-4 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";
153
+ }/* Pipeline/ColumnTransformer-specific style */#sk-container-id-4 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {color: var(--sklearn-color-text);background-color: var(--sklearn-color-unfitted-level-2);
154
+ }#sk-container-id-4 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: var(--sklearn-color-fitted-level-2);
155
  }/* Estimator-specific style *//* Colorize estimator box */
156
+ #sk-container-id-4 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {/* unfitted */background-color: var(--sklearn-color-unfitted-level-2);
157
+ }#sk-container-id-4 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {/* fitted */background-color: var(--sklearn-color-fitted-level-2);
158
+ }#sk-container-id-4 div.sk-label label.sk-toggleable__label,
159
+ #sk-container-id-4 div.sk-label label {/* The background is the default theme color */color: var(--sklearn-color-text-on-default-background);
160
  }/* On hover, darken the color of the background */
161
+ #sk-container-id-4 div.sk-label:hover label.sk-toggleable__label {color: var(--sklearn-color-text);background-color: var(--sklearn-color-unfitted-level-2);
162
  }/* Label box, darken color on hover, fitted */
163
+ #sk-container-id-4 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {color: var(--sklearn-color-text);background-color: var(--sklearn-color-fitted-level-2);
164
+ }/* Estimator label */#sk-container-id-4 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;
165
+ }#sk-container-id-4 div.sk-label-container {text-align: center;
166
  }/* Estimator-specific */
167
+ #sk-container-id-4 div.sk-estimator {font-family: monospace;border: 1px dotted var(--sklearn-color-border-box);border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;/* unfitted */background-color: var(--sklearn-color-unfitted-level-0);
168
+ }#sk-container-id-4 div.sk-estimator.fitted {/* fitted */background-color: var(--sklearn-color-fitted-level-0);
169
  }/* on hover */
170
+ #sk-container-id-4 div.sk-estimator:hover {/* unfitted */background-color: var(--sklearn-color-unfitted-level-2);
171
+ }#sk-container-id-4 div.sk-estimator.fitted:hover {/* fitted */background-color: var(--sklearn-color-fitted-level-2);
172
  }/* Specification for estimator info (e.g. "i" and "?") *//* Common style for "i" and "?" */.sk-estimator-doc-link,
173
  a:link.sk-estimator-doc-link,
174
  a:visited.sk-estimator-doc-link {float: right;font-size: smaller;line-height: 1em;font-family: monospace;background-color: var(--sklearn-color-background);border-radius: 1em;height: 1em;width: 1em;text-decoration: none !important;margin-left: 1ex;/* unfitted */border: var(--sklearn-color-unfitted-level-1) 1pt solid;color: var(--sklearn-color-unfitted-level-1);
 
188
  .sk-estimator-doc-link span {display: none;z-index: 9999;position: relative;font-weight: normal;right: .2ex;padding: .5ex;margin: .5ex;width: min-content;min-width: 20ex;max-width: 50ex;color: var(--sklearn-color-text);box-shadow: 2pt 2pt 4pt #999;/* unfitted */background: var(--sklearn-color-unfitted-level-0);border: .5pt solid var(--sklearn-color-unfitted-level-3);
189
  }.sk-estimator-doc-link.fitted span {/* fitted */background: var(--sklearn-color-fitted-level-0);border: var(--sklearn-color-fitted-level-3);
190
  }.sk-estimator-doc-link:hover span {display: block;
191
+ }/* "?"-specific style due to the `<a>` HTML tag */#sk-container-id-4 a.estimator_doc_link {float: right;font-size: 1rem;line-height: 1em;font-family: monospace;background-color: var(--sklearn-color-background);border-radius: 1rem;height: 1rem;width: 1rem;text-decoration: none;/* unfitted */color: var(--sklearn-color-unfitted-level-1);border: var(--sklearn-color-unfitted-level-1) 1pt solid;
192
+ }#sk-container-id-4 a.estimator_doc_link.fitted {/* fitted */border: var(--sklearn-color-fitted-level-1) 1pt solid;color: var(--sklearn-color-fitted-level-1);
193
  }/* On hover */
194
+ #sk-container-id-4 a.estimator_doc_link:hover {/* unfitted */background-color: var(--sklearn-color-unfitted-level-3);color: var(--sklearn-color-background);text-decoration: none;
195
+ }#sk-container-id-4 a.estimator_doc_link.fitted:hover {/* fitted */background-color: var(--sklearn-color-fitted-level-3);
196
  }
197
+ </style><div id="sk-container-id-4" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>Pipeline(steps=[(&#x27;scaler&#x27;, MinMaxScaler()),(&#x27;knn&#x27;, KNeighborsClassifier(n_neighbors=15))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item sk-dashed-wrapped"><div class="sk-label-container"><div class="sk-label fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-8" type="checkbox" ><label for="sk-estimator-id-8" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;&nbsp;Pipeline<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.pipeline.Pipeline.html">?<span>Documentation for Pipeline</span></a><span class="sk-estimator-doc-link fitted">i<span>Fitted</span></span></label><div class="sk-toggleable__content fitted"><pre>Pipeline(steps=[(&#x27;scaler&#x27;, MinMaxScaler()),(&#x27;knn&#x27;, KNeighborsClassifier(n_neighbors=15))])</pre></div> </div></div><div class="sk-serial"><div class="sk-item"><div class="sk-estimator fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-9" type="checkbox" ><label for="sk-estimator-id-9" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;MinMaxScaler<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.preprocessing.MinMaxScaler.html">?<span>Documentation for MinMaxScaler</span></a></label><div class="sk-toggleable__content fitted"><pre>MinMaxScaler()</pre></div> </div></div><div class="sk-item"><div class="sk-estimator fitted sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-10" type="checkbox" ><label for="sk-estimator-id-10" class="sk-toggleable__label fitted sk-toggleable__label-arrow fitted">&nbsp;KNeighborsClassifier<a class="sk-estimator-doc-link fitted" rel="noreferrer" target="_blank" href="https://scikit-learn.org/1.5/modules/generated/sklearn.neighbors.KNeighborsClassifier.html">?<span>Documentation for KNeighborsClassifier</span></a></label><div class="sk-toggleable__content fitted"><pre>KNeighborsClassifier(n_neighbors=15)</pre></div> </div></div></div></div></div></div>
198
 
199
  ## Evaluation Results
200
 
201
  | Metric | Value |
202
  |-----------|----------|
203
+ | accuracy | 0.851224 |
204
+ | f1 score | 0.741192 |
205
+ | precision | 0.800138 |
206
+ | recall | 0.690334 |
207
 
208
  # How to Get Started with the Model
209
 
config.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "sklearn": {
3
  "columns": [
4
- "STOP_ID",
5
  "FRISKED_FLAG",
6
  "SEARCHED_FLAG",
7
  "STOP_LOCATION_PRECINCT",
@@ -15,12 +14,10 @@
15
  "FIREARM_FLAG",
16
  "KNIFE_CUTTER_FLAG",
17
  "OTHER_WEAPON_FLAG",
18
- "WEAPON_FOUND_FLAG",
19
  "ASK_FOR_CONSENT_FLG",
20
  "CONSENT_GIVEN_FLG",
21
  "ISSUING_OFFICER_RANK",
22
- "SUPERVISING_OFFICER_RANK",
23
- "__index_level_0__"
24
  ],
25
  "environment": [
26
  "scikit-learn=1.5.2"
@@ -29,11 +26,11 @@
29
  "ASK_FOR_CONSENT_FLG": [
30
  1,
31
  1,
32
- 0
33
  ],
34
  "CONSENT_GIVEN_FLG": [
 
35
  1,
36
- 0,
37
  0
38
  ],
39
  "FIREARM_FLAG": [
@@ -43,13 +40,13 @@
43
  ],
44
  "FRISKED_FLAG": [
45
  1,
46
- 1,
47
  1
48
  ],
49
  "ISSUING_OFFICER_RANK": [
50
- 10,
51
- 13,
52
- 9
53
  ],
54
  "KNIFE_CUTTER_FLAG": [
55
  0,
@@ -57,7 +54,7 @@
57
  0
58
  ],
59
  "OTHER_CONTRABAND_FLAG": [
60
- 1,
61
  0,
62
  0
63
  ],
@@ -67,64 +64,49 @@
67
  0
68
  ],
69
  "SEARCHED_FLAG": [
70
- 1,
71
  0,
72
- 1
73
- ],
74
- "STOP_ID": [
75
- 8283,
76
- 4532,
77
- 14787
78
  ],
79
  "STOP_LOCATION_PRECINCT": [
80
- 90,
81
- 40,
82
- 106
83
  ],
84
  "SUPERVISING_OFFICER_RANK": [
85
  12,
86
- 7,
87
  12
88
  ],
89
  "SUSPECT_BODY_BUILD_TYPE": [
90
  2,
91
  3,
92
- 3
93
  ],
94
  "SUSPECT_HEIGHT": [
95
- 5.7,
96
- 5.1,
97
- 5.6
98
  ],
99
  "SUSPECT_RACE_DESCRIPTION": [
100
- 7,
101
- 3,
102
- 7
103
  ],
104
  "SUSPECT_REPORTED_AGE": [
105
- 22.0,
106
- 20.0,
107
- 30.0
108
  ],
109
  "SUSPECT_SEX": [
110
- 1,
111
  2,
112
  2
113
  ],
114
  "SUSPECT_WEIGHT": [
115
- 135.0,
116
- 170.0,
117
- 150.0
118
- ],
119
- "WEAPON_FOUND_FLAG": [
120
- 0,
121
- 0,
122
- 0
123
- ],
124
- "__index_level_0__": [
125
- 8282,
126
- 4531,
127
- 14786
128
  ]
129
  },
130
  "model": {
 
1
  {
2
  "sklearn": {
3
  "columns": [
 
4
  "FRISKED_FLAG",
5
  "SEARCHED_FLAG",
6
  "STOP_LOCATION_PRECINCT",
 
14
  "FIREARM_FLAG",
15
  "KNIFE_CUTTER_FLAG",
16
  "OTHER_WEAPON_FLAG",
 
17
  "ASK_FOR_CONSENT_FLG",
18
  "CONSENT_GIVEN_FLG",
19
  "ISSUING_OFFICER_RANK",
20
+ "SUPERVISING_OFFICER_RANK"
 
21
  ],
22
  "environment": [
23
  "scikit-learn=1.5.2"
 
26
  "ASK_FOR_CONSENT_FLG": [
27
  1,
28
  1,
29
+ 1
30
  ],
31
  "CONSENT_GIVEN_FLG": [
32
+ 2,
33
  1,
 
34
  0
35
  ],
36
  "FIREARM_FLAG": [
 
40
  ],
41
  "FRISKED_FLAG": [
42
  1,
43
+ 0,
44
  1
45
  ],
46
  "ISSUING_OFFICER_RANK": [
47
+ 11,
48
+ 9,
49
+ 11
50
  ],
51
  "KNIFE_CUTTER_FLAG": [
52
  0,
 
54
  0
55
  ],
56
  "OTHER_CONTRABAND_FLAG": [
57
+ 0,
58
  0,
59
  0
60
  ],
 
64
  0
65
  ],
66
  "SEARCHED_FLAG": [
 
67
  0,
68
+ 0,
69
+ 0
 
 
 
 
70
  ],
71
  "STOP_LOCATION_PRECINCT": [
72
+ 68,
73
+ 107,
74
+ 75
75
  ],
76
  "SUPERVISING_OFFICER_RANK": [
77
  12,
78
+ 12,
79
  12
80
  ],
81
  "SUSPECT_BODY_BUILD_TYPE": [
82
  2,
83
  3,
84
+ 2
85
  ],
86
  "SUSPECT_HEIGHT": [
87
+ 6.4,
88
+ 5.9,
89
+ 5.9
90
  ],
91
  "SUSPECT_RACE_DESCRIPTION": [
92
+ 6,
93
+ 4,
94
+ 3
95
  ],
96
  "SUSPECT_REPORTED_AGE": [
97
+ 21.0,
98
+ 68.0,
99
+ 18.0
100
  ],
101
  "SUSPECT_SEX": [
102
+ 2,
103
  2,
104
  2
105
  ],
106
  "SUSPECT_WEIGHT": [
107
+ 160.0,
108
+ 180.0,
109
+ 140.0
 
 
 
 
 
 
 
 
 
 
110
  ]
111
  },
112
  "model": {