Icon

Machine Learning and LIME

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, Neuronal 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

training a local GLM for each input instance to generate a Local Inter. Model-agn. Explanation
Compute LIME
collects explanations
Loop End
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
VisualizeLIME
Bar Chart
Organizedata to getone averagecoefficientper word
Words
train the model
XGBoost Tree Ensemble Learner
score samples
XGBoost Predictor
Excel Reader
AssessAccuracy, and F
Scorer
Pre-processingBag of words(unigrams) aspredictivefeatures
Text Processing

Nodes

Extensions

Links