View source: R/textmodel_affinity.R
influence.predict.textmodel_affinity | R Documentation |
Computes the influence of features on scaled textmodel_affinity()
applications.
## S3 method for class 'predict.textmodel_affinity'
influence(model, subset = !train, ...)
model |
a predicted textmodel_affinity() object |
subset |
whether to use all data or a subset (for instance, exclude the training set) |
... |
unused |
a named list classed as influence.predict.textmodel_affinity that contains
norm
a document by feature class sparse matrix of normalised influence
measures
count
a vector of counts of each non-zero feature in the input matrix
rate
the normalised feature count for each non-zero feature in the input
matrix
mode
an integer vector of 1 or 2 indicating the class which the feature
is influencing, for each non-zero feature
levels
a character vector of the affinity class labels
subset
a logical vector indicating whether the document was included in
the computation of influence; FALSE
for documents assigned a class label
in training the model
support
logical vector for each feature matching the same return from
predict.textmodel_affinity
influence.lm()
tmod <- textmodel_affinity(quanteda::data_dfm_lbgexample, y = c("L", NA, NA, NA, "R", NA))
pred <- predict(tmod)
influence(pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.