read_test_data | R Documentation |
This function takes a MetaNLP object (the training data) and the test data. The function creates the document-term matrix from the test data and matches the columns of the given training MetaNLP object with the columns of the test document-term matrix. This means that columns, which do appear in the test document-term matrix but not in the training document-term matrix are removed; columns that appear in the training document-term matrix but not in the test document-term matrix are added as a column consisting of zeros.
read_test_data(object, ...)
## S4 method for signature 'MetaNLP'
read_test_data(object, file, ...)
object |
The MetaNLP object created from the training data. |
... |
Further arguments to |
file |
Either the path to the test data csv, the data frame containing the papers or a MetaNLP object |
An object of class MetaNLP
path_train <- system.file("extdata", "test_data.csv", package = "MetaNLP", mustWork = TRUE)
path_test <- system.file("extdata", "test_data_changed.csv", package = "MetaNLP", mustWork = TRUE)
obj_train <- MetaNLP(path_train)
obj_test <- MetaNLP(path_test)
to_test_obj <- read_test_data(obj_train, obj_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.