Hellisotherpeople
commited on
Commit
•
a0d6aa6
1
Parent(s):
c6aa028
Update app.py
Browse files
app.py
CHANGED
@@ -256,7 +256,11 @@ if task == "Classification":
|
|
256 |
target_feature_names = text_clf['clf'].classes_
|
257 |
#target_feature_names = pd.unique(df[labels_column_name])
|
258 |
target_feature_names_list = list(target_feature_names)
|
259 |
-
|
|
|
|
|
|
|
|
|
260 |
else:
|
261 |
t_pred = te.explain_prediction(top = top_features, top_targets = top_targets)
|
262 |
html = format_as_html(t_pred)
|
|
|
256 |
target_feature_names = text_clf['clf'].classes_
|
257 |
#target_feature_names = pd.unique(df[labels_column_name])
|
258 |
target_feature_names_list = list(target_feature_names)
|
259 |
+
try:
|
260 |
+
t_pred = te.explain_prediction(target_names = target_feature_names_list, top = top_features, top_targets = top_targets)
|
261 |
+
except TypeError:
|
262 |
+
st.error("Unable to get target label names - most likely due to a numeric label feature type")
|
263 |
+
t_pred = te.explain_prediction(top = top_features, top_targets = top_targets)
|
264 |
else:
|
265 |
t_pred = te.explain_prediction(top = top_features, top_targets = top_targets)
|
266 |
html = format_as_html(t_pred)
|