| BOW_test | R Documentation |
This function takes a character vector of new documents and transforms it into a DFM that has the exact same features as a pre-fitted training DFM, ensuring consistency for prediction.
BOW_test(doc, fit)
doc |
A character vector of new documents to be processed. |
fit |
A fitted BoW object returned by |
A quanteda dfm aligned to the training features.
train_txt <- c("apple orange banana", "apple apple")
fit <- BOW_train(train_txt, weighting_scheme = "bow")
new_txt <- c("banana pear", "orange apple")
test_dfm <- BOW_test(new_txt, fit)
test_dfm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.