Commit
·
d12b801
1
Parent(s):
f5930ae
Update german_credit_risk/code/processed/app.py
Browse files
german_credit_risk/code/processed/app.py
CHANGED
|
@@ -97,66 +97,66 @@ with gr.Blocks() as demo:
|
|
| 97 |
2. Once completed, click 'Predict' to determine if the client is creditworthy.
|
| 98 |
""")
|
| 99 |
with gr.Accordion('Name'):
|
| 100 |
-
name = gr.
|
| 101 |
with gr.Accordion("Enter your client's information"):
|
| 102 |
with gr.Tab('Account Balance'):
|
| 103 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 104 |
-
x1 = gr.
|
| 105 |
-
x2 = gr.
|
| 106 |
-
x3 = gr.
|
| 107 |
with gr.Tab('Payment status of previous credit'):
|
| 108 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 109 |
-
x4 = gr.
|
| 110 |
-
x5 = gr.
|
| 111 |
with gr.Tab('Purpose'):
|
| 112 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 113 |
-
x6 = gr.
|
| 114 |
-
x7 = gr.
|
| 115 |
with gr.Tab('Value savings/stocks'):
|
| 116 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 117 |
-
x8 = gr.
|
| 118 |
-
x9 = gr.
|
| 119 |
-
x10 = gr.
|
| 120 |
with gr.Tab('Length of current employment'):
|
| 121 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 122 |
-
x11 = gr.
|
| 123 |
-
x12 = gr.
|
| 124 |
with gr.Tab('Instalment per cent'):
|
| 125 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 126 |
-
x13 = gr.
|
| 127 |
with gr.Tab('Guarantors'):
|
| 128 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 129 |
-
x14 = gr.
|
| 130 |
with gr.Tab('Duration in current address'):
|
| 131 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 132 |
-
x15 = gr.
|
| 133 |
-
x16 = gr.
|
| 134 |
with gr.Tab('Most valuable available asset'):
|
| 135 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 136 |
-
x17 = gr.
|
| 137 |
-
x18 = gr.
|
| 138 |
with gr.Tab('Concurrent credits'):
|
| 139 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 140 |
-
x19 = gr.
|
| 141 |
with gr.Tab('Type of apartment'):
|
| 142 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 143 |
-
x20 = gr.
|
| 144 |
with gr.Tab('Number of credits at this Bank'):
|
| 145 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 146 |
-
x21 = gr.
|
| 147 |
with gr.Tab('Occupation'):
|
| 148 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 149 |
-
x22 = gr.
|
| 150 |
predict_button = gr.Button('Predict')
|
| 151 |
-
prediction_output = gr.
|
| 152 |
with gr.Accordion('Metrics and plots'):
|
| 153 |
with gr.Tab('Metrics'):
|
| 154 |
with gr.Row():
|
| 155 |
-
precision_output = gr.
|
| 156 |
with gr.Row():
|
| 157 |
-
recall_output = gr.
|
| 158 |
with gr.Row():
|
| 159 |
-
f1_output = gr.
|
| 160 |
with gr.Tab('Feature Importances'):
|
| 161 |
fimp_output = gr.Plot()
|
| 162 |
with gr.Tab('Confusion Matrix'):
|
|
@@ -170,4 +170,4 @@ with gr.Blocks() as demo:
|
|
| 170 |
[Github](https://github.com/marcilioduarte)
|
| 171 |
@marcilioduarte | Economics and Data Science
|
| 172 |
''')
|
| 173 |
-
demo.launch()
|
|
|
|
| 97 |
2. Once completed, click 'Predict' to determine if the client is creditworthy.
|
| 98 |
""")
|
| 99 |
with gr.Accordion('Name'):
|
| 100 |
+
name = gr.Textbox(lines=1, label='Your name')
|
| 101 |
with gr.Accordion("Enter your client's information"):
|
| 102 |
with gr.Tab('Account Balance'):
|
| 103 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 104 |
+
x1 = gr.Checkbox(1, label='No account')
|
| 105 |
+
x2 = gr.Checkbox(0, label='No balance')
|
| 106 |
+
x3 = gr.Checkbox(0, label='Some balance')
|
| 107 |
with gr.Tab('Payment status of previous credit'):
|
| 108 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 109 |
+
x4 = gr.Checkbox(1, label='Some problems')
|
| 110 |
+
x5 = gr.Checkbox(0, label='No problems in this bank')
|
| 111 |
with gr.Tab('Purpose'):
|
| 112 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 113 |
+
x6 = gr.Checkbox(1, label='New car')
|
| 114 |
+
x7 = gr.Checkbox(0, label='Other')
|
| 115 |
with gr.Tab('Value savings/stocks'):
|
| 116 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 117 |
+
x8 = gr.Checkbox(1, label='No savings')
|
| 118 |
+
x9 = gr.Checkbox(0, label='DM betwenn [100, 1000]')
|
| 119 |
+
x10 = gr.Checkbox(0, label='DM >= 1000')
|
| 120 |
with gr.Tab('Length of current employment'):
|
| 121 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 122 |
+
x11 = gr.Checkbox(1, label='Below 1 year (or unemployed)')
|
| 123 |
+
x12 = gr.Checkbox(0, label='Between 4 and 7 years')
|
| 124 |
with gr.Tab('Instalment per cent'):
|
| 125 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 126 |
+
x13 = gr.Checkbox(0, label='Smaller than 20%')
|
| 127 |
with gr.Tab('Guarantors'):
|
| 128 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 129 |
+
x14 = gr.Checkbox(0, label='No guarantors')
|
| 130 |
with gr.Tab('Duration in current address'):
|
| 131 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 132 |
+
x15 = gr.Checkbox(1, label='Less than a year')
|
| 133 |
+
x16 = gr.Checkbox(0, label='Between 1 and 4 years')
|
| 134 |
with gr.Tab('Most valuable available asset'):
|
| 135 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 136 |
+
x17 = gr.Checkbox(1, label='Not available / no assets')
|
| 137 |
+
x18 = gr.Checkbox(0, label='Ownership of house or land')
|
| 138 |
with gr.Tab('Concurrent credits'):
|
| 139 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 140 |
+
x19 = gr.Checkbox(0, label='No further running credits')
|
| 141 |
with gr.Tab('Type of apartment'):
|
| 142 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 143 |
+
x20 = gr.Checkbox(0, label='Free apartment')
|
| 144 |
with gr.Tab('Number of credits at this Bank'):
|
| 145 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 146 |
+
x21 = gr.Checkbox(0, label='One credit')
|
| 147 |
with gr.Tab('Occupation'):
|
| 148 |
gr.Markdown('Select only one option. Leave all boxes blank if none of the options fits the client.')
|
| 149 |
+
x22 = gr.Checkbox(0, label='Unemployed or unskilled with no permanent')
|
| 150 |
predict_button = gr.Button('Predict')
|
| 151 |
+
prediction_output = gr.Label(num_top_classes=2)
|
| 152 |
with gr.Accordion('Metrics and plots'):
|
| 153 |
with gr.Tab('Metrics'):
|
| 154 |
with gr.Row():
|
| 155 |
+
precision_output = gr.Label()
|
| 156 |
with gr.Row():
|
| 157 |
+
recall_output = gr.Label()
|
| 158 |
with gr.Row():
|
| 159 |
+
f1_output = gr.Label()
|
| 160 |
with gr.Tab('Feature Importances'):
|
| 161 |
fimp_output = gr.Plot()
|
| 162 |
with gr.Tab('Confusion Matrix'):
|
|
|
|
| 170 |
[Github](https://github.com/marcilioduarte)
|
| 171 |
@marcilioduarte | Economics and Data Science
|
| 172 |
''')
|
| 173 |
+
demo.launch()
|