Skip to content

Instantly share code, notes, and snippets.

@varrek
Created January 16, 2022 15:06
Show Gist options
  • Save varrek/16cd432be820ee10df835710fcdd0770 to your computer and use it in GitHub Desktop.
Save varrek/16cd432be820ee10df835710fcdd0770 to your computer and use it in GitHub Desktop.
import eli5
from eli5.lime import TextExplainer
target_names = train["targetcat"].unique().tolist()
te = TextExplainer(random_state=42)
te.fit(valid.description.iloc[10], logreg.predict_proba)
te.show_prediction(target_names=target_names)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment