Commit
·
47155cb
1
Parent(s):
cfc048b
Update app.py
Browse files
app.py
CHANGED
@@ -99,26 +99,26 @@ def make_prediction(alcohol, arrest_type, belts, contributed_to_accident, disobe
|
|
99 |
|
100 |
iface = gr.Interface(fn=make_prediction,
|
101 |
inputs=[gr.components.Checkbox(label='Was the driver under the influence of alcohol?'),
|
102 |
-
gr.components.Dropdown(label='Choose the arrest type', choices=list(tf['OneHotEncoder'].transformers_[0][1].categories_[0]), value='A - Marked Patrol'),
|
103 |
gr.components.Checkbox(label='Were seatbelts used appropriately?'),
|
104 |
gr.components.Checkbox(label='Did the driver actions contribute to an accident?'),
|
105 |
gr.components.Checkbox(label='Was the driver disobedient? (such as failing to display documentation upon request)?'),
|
106 |
-
|
107 |
gr.components.Dropdown(label='Driver Gender', choices=['M', 'F', 'N'], value='M'),
|
108 |
gr.components.Checkbox(label='Was the driver driving with Invalid Documentation (such as suspended registration, suspended license, expired registration plates and validation tabs or expired license plate)?'),
|
109 |
-
|
110 |
gr.components.Checkbox(label='Was the driver using a mobile phone while driving?'),
|
111 |
gr.components.Checkbox(label='Was the driver caught driving with negligence (example switching lanes in an unsafe manner)?'),
|
112 |
gr.components.Slider(minimum=1, step=1, label='Number of offences committed'),
|
113 |
gr.components.Checkbox(label='Did the violation involve any personal injury?'),
|
114 |
gr.components.Checkbox(label='Did the violation involve any property damage?'),
|
115 |
-
gr.components.Dropdown(label='Choose the race of the driver', choices=tf['OneHotEncoder'].transformers_[0][1].categories_[2], value='WHITE'),
|
116 |
gr.components.Checkbox(label='Did the driver fail to obey signs and markings (such as traffic control device instructions, stop lights, red signal and stop sign lines)?'),
|
117 |
-
gr.components.Dropdown(label='Choose the race of the driver', choices=tf['OneHotEncoder'].transformers_[0][1].categories_[3], value='NO SEARCH CONDUCTED'),
|
118 |
gr.components.Checkbox(label='Was the driver caught speeding?'),
|
119 |
gr.components.Slider(maximum=23, step=1, label='Time HOUR when stop occurred in 24-hour format'),
|
120 |
gr.components.Slider(minimum=2012, maximum=2024, step=1, label='Year when stop occurred'),
|
121 |
-
gr.components.Dropdown(label='What is the name of the subagency that conducted the traffic stop?', choices=tf['OneHotEncoder'].transformers_[0][1].categories_[1], value='4th District, Wheaton'),
|
122 |
gr.components.Checkbox(label='Was the vehicle safe and up to standards (lights properly switched, registration plates attached etc.)?'),
|
123 |
gr.components.Slider(minimum=1970, maximum=2023, step=1, label='Year of manufacture of the vehicle:')],
|
124 |
outputs=["text"])
|
|
|
99 |
|
100 |
iface = gr.Interface(fn=make_prediction,
|
101 |
inputs=[gr.components.Checkbox(label='Was the driver under the influence of alcohol?'),
|
102 |
+
gr.components.Dropdown(label='Choose the arrest type', choices=list(tf['OneHotEncoder'].transformers_[0][1].categories_[0]), value='A - Marked Patrol'),
|
103 |
gr.components.Checkbox(label='Were seatbelts used appropriately?'),
|
104 |
gr.components.Checkbox(label='Did the driver actions contribute to an accident?'),
|
105 |
gr.components.Checkbox(label='Was the driver disobedient? (such as failing to display documentation upon request)?'),
|
106 |
+
gr.components.Dropdown(label='Choose the driver city', choices=list(tf['OrdinalEncoder_VeryHighCardinality'].categories_[0]), value='SILVER SPRING'),
|
107 |
gr.components.Dropdown(label='Driver Gender', choices=['M', 'F', 'N'], value='M'),
|
108 |
gr.components.Checkbox(label='Was the driver driving with Invalid Documentation (such as suspended registration, suspended license, expired registration plates and validation tabs or expired license plate)?'),
|
109 |
+
gr.components.Dropdown(label='Vehicle Make', choices=list(tf['OrdinalEncoder_HighCardinality'].categories_[0]), value='TOYOTA'),
|
110 |
gr.components.Checkbox(label='Was the driver using a mobile phone while driving?'),
|
111 |
gr.components.Checkbox(label='Was the driver caught driving with negligence (example switching lanes in an unsafe manner)?'),
|
112 |
gr.components.Slider(minimum=1, step=1, label='Number of offences committed'),
|
113 |
gr.components.Checkbox(label='Did the violation involve any personal injury?'),
|
114 |
gr.components.Checkbox(label='Did the violation involve any property damage?'),
|
115 |
+
gr.components.Dropdown(label='Choose the race of the driver', choices=list(tf['OneHotEncoder'].transformers_[0][1].categories_[2]), value='WHITE'),
|
116 |
gr.components.Checkbox(label='Did the driver fail to obey signs and markings (such as traffic control device instructions, stop lights, red signal and stop sign lines)?'),
|
117 |
+
gr.components.Dropdown(label='Choose the race of the driver', choices=list(tf['OneHotEncoder'].transformers_[0][1].categories_[3]), value='NO SEARCH CONDUCTED'),
|
118 |
gr.components.Checkbox(label='Was the driver caught speeding?'),
|
119 |
gr.components.Slider(maximum=23, step=1, label='Time HOUR when stop occurred in 24-hour format'),
|
120 |
gr.components.Slider(minimum=2012, maximum=2024, step=1, label='Year when stop occurred'),
|
121 |
+
gr.components.Dropdown(label='What is the name of the subagency that conducted the traffic stop?', choices=list(tf['OneHotEncoder'].transformers_[0][1].categories_[1]), value='4th District, Wheaton'),
|
122 |
gr.components.Checkbox(label='Was the vehicle safe and up to standards (lights properly switched, registration plates attached etc.)?'),
|
123 |
gr.components.Slider(minimum=1970, maximum=2023, step=1, label='Year of manufacture of the vehicle:')],
|
124 |
outputs=["text"])
|