Spaces:
Build error
Build error
Test
Browse files
app.py
CHANGED
|
@@ -37,6 +37,7 @@ def trainme(MedInc, HouseAge, AveRooms, AveBedrms, Population, AveOccup, Latitud
|
|
| 37 |
'Longitude of the block']
|
| 38 |
|
| 39 |
#Create a lime object, regression mode
|
|
|
|
| 40 |
explainer = lime_tabular.LimeTabularExplainer(X, mode="regression", feature_names=clean_features)
|
| 41 |
|
| 42 |
#Create the expl
|
|
@@ -157,8 +158,8 @@ def trainme(MedInc, HouseAge, AveRooms, AveBedrms, Population, AveOccup, Latitud
|
|
| 157 |
final_list = [first_phrase, second_phrase, third_phrase, forth_phrase]
|
| 158 |
|
| 159 |
return final_list
|
| 160 |
-
|
| 161 |
-
|
| 162 |
|
| 163 |
input = [gr.inputs.Slider(0.5, 15, default=4.406300, label='Median income'),
|
| 164 |
gr.inputs.Slider(1, 52, default=13, label='Median house age'),
|
|
@@ -181,4 +182,4 @@ iface = gr.Interface(fn=trainme,
|
|
| 181 |
outputs=output,
|
| 182 |
title = '🔮 Explain me like I\'m 5',
|
| 183 |
description="Get explanations from a model prediction")
|
| 184 |
-
iface.launch()
|
|
|
|
| 37 |
'Longitude of the block']
|
| 38 |
|
| 39 |
#Create a lime object, regression mode
|
| 40 |
+
from lime import lime_tabular
|
| 41 |
explainer = lime_tabular.LimeTabularExplainer(X, mode="regression", feature_names=clean_features)
|
| 42 |
|
| 43 |
#Create the expl
|
|
|
|
| 158 |
final_list = [first_phrase, second_phrase, third_phrase, forth_phrase]
|
| 159 |
|
| 160 |
return final_list
|
| 161 |
+
|
| 162 |
+
#Define gradio UI
|
| 163 |
|
| 164 |
input = [gr.inputs.Slider(0.5, 15, default=4.406300, label='Median income'),
|
| 165 |
gr.inputs.Slider(1, 52, default=13, label='Median house age'),
|
|
|
|
| 182 |
outputs=output,
|
| 183 |
title = '🔮 Explain me like I\'m 5',
|
| 184 |
description="Get explanations from a model prediction")
|
| 185 |
+
iface.launch(debug=True)
|