Open mralamdari opened 2 years ago
if you don't change
mystring = list(X_test)[221]
to this code:
mystring = X_test[221]
while running these part:
exp = explainer.explain_instance(mystring, c.predict_proba, num_features=6)
it will raise this Error:
TypeError: expected string or bytes-like object
This issue is resolved in this PR #133
Problem
in Part 2: Using Lime to interpret predictions,
there is an extra list and it gives this error:
and this error refers to this line of the code in the clean function:
doc = doc.replace("</br>", " ")
Solution:
this problem can easily be solved by removing the list part and changing the code to this:
mystring = X_test[221] print(c.predict_proba([mystring])