Commit
·
cfc048b
1
Parent(s):
0eb8d4a
test
Browse files
app.py
CHANGED
@@ -99,17 +99,14 @@ 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 |
-
|
103 |
-
'Marked Patrol',
|
104 |
gr.components.Checkbox(label='Were seatbelts used appropriately?'),
|
105 |
gr.components.Checkbox(label='Did the driver actions contribute to an accident?'),
|
106 |
gr.components.Checkbox(label='Was the driver disobedient? (such as failing to display documentation upon request)?'),
|
107 |
-
#gr.components.Dropdown(label='Choose the driver city', choices=tf['OrdinalEncoder_VeryHighCardinality'].categories_[0], value='SILVER SPRING'),
|
108 |
-
'SILVER SPRING',
|
109 |
gr.components.Dropdown(label='Driver Gender', choices=['M', 'F', 'N'], value='M'),
|
110 |
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)?'),
|
111 |
-
#gr.components.Dropdown(label='Vehicle Make', choices=tf['OrdinalEncoder_HighCardinality'].categories_[0], value='TOYOTA'),
|
112 |
-
'TOYOTA',
|
113 |
gr.components.Checkbox(label='Was the driver using a mobile phone while driving?'),
|
114 |
gr.components.Checkbox(label='Was the driver caught driving with negligence (example switching lanes in an unsafe manner)?'),
|
115 |
gr.components.Slider(minimum=1, step=1, label='Number of offences committed'),
|
|
|
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'), #'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 |
+
'SILVER SPRING', #gr.components.Dropdown(label='Choose the driver city', choices=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 |
+
'TOYOTA', #gr.components.Dropdown(label='Vehicle Make', choices=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'),
|