Computes the attributions to predictions for a (given) number of dates at all possible sentiment dimensions, based on the coefficients associated to each sentiment measure, as estimated in the provided model object.
attributions( model, sento_measures, do.lags = TRUE, do.normalize = FALSE, refDates = NULL, factor = NULL )
| model | a |
|---|---|
| sento_measures | the |
| do.lags | a |
| do.normalize | a |
| refDates | the dates (as |
| factor | the factor level as a single |
A list of class attributions, with "documents", "lags", "lexicons",
"features" and "time" as attribution dimensions. The last four dimensions are
data.tables having a "date" column and the other columns the different components of the dimension, with
the attributions as values. Document-level attribution is further decomposed into a data.table per date, with
"id", "date" and "attrib" columns. If do.lags = FALSE, the "lags" element is set
to NULL.
See sento_model for an elaborate modeling example including the calculation and plotting of
attributions. The attribution for logistic models is represented in terms of log odds. For binomial models, it is
calculated with respect to the last factor level or factor column. A NULL value for document-level attribution
on a given date means no documents are directly implicated in the associated prediction.
Samuel Borms, Keven Bluteau