Icon

Machine Learning, LIME, and GFI

Building a Sentiment Analysis Predictive Model - Supervised Machine Learning

This workflow uses a subset of the Kaggle Dataset including 14K customer tweets towards six US airlines (https://www.kaggle.com/crowdflower/twitter-airline-sentiment). Contributors annotated the valence of the tweets as positive, negative or neutral. For this example we use only positive and negative.

If you use this workflow, please cite: Villarroel Ordenes, Francisco, Grant Packard, Davide Proserpio, and Jochen Hartmann, “Using Text Analysis in Service Failure and Recovery: Theory, Workflows, and Models”, Journal of Service Research, Forthcoming.

Machine Learning Part. You can change Learner and Predictor Node by your Preferred Algorithm (SVM, BERT, Neural Networks, Random Forest, etc.)

Explanation part (XAI). LIME gives you word coefficients associated to each prediction. In this case the coefficient shows the relation of a word with the category "Positive." Once we have coefficient for all predictions we aggregate the coefficients per word

Global Feature Importance (GFI) Part. We use the capture workflow nodes around the predictor, then feed that to the GFI component (making sure to configure it appropriately).

Airline Tweets
CSV Reader
training a local GLM for each input instance to generate a Local Inter. Model-agn. Explanation
Compute LIME
collects explanations
Loop End
score samples
XGBoost Predictor
Select rowsto explain
Row Sampling
top: 90% train set bottom: 10% test set
Partitioning
score samples
XGBoost Predictor
top input : test set instance rows to be explainedbottom input : test set distribution
LIME Loop Start
Global Feature Importance
Capture Workflow End
Capture Workflow Start
VisualizeLIME
Bar Chart
Organizedata to getone averagecoefficientper word
Words
train the model
XGBoost Tree Ensemble Learner
score samples
XGBoost Predictor
AssessAccuracy, and F
Scorer
Pre-processingBag of words(unigrams) aspredictivefeatures
Text Processing

Nodes

Extensions

Links