explain_comment: explain_comment

Description Usage Arguments Value

View source: R/explain_comment.R

Description

Using the xgboost model and explainer from the build_topic_explainer function, this function explains how the algorithm reached its prediction.

Usage

1
2
3
4
5
6
7
explain_comment(
  xgbmodel,
  explainer,
  unlabelled_dtm,
  comment_index,
  threshold = 0.02
)

Arguments

xgbmodel

Xgbmodel output from the build_topic_explainer function.

explainer

Explainer output from the build_topic_explainer function.

unlabelled_dtm

Unlabelled document-term matrix.

comment_index

The index of the comment in the unlabelled dataset that the user wants to explore.

threshold

The waterfall chart will group all variables with absolute impact less than the threshold into a variable called 'Other'. Default: 0.02

Value

A waterfall chart that demonstrates how the inclusion/exclusion of certain words informed its decision.


rosepeglershare/TagR documentation built on Dec. 31, 2020, 3:12 a.m.