# For example, to train a Naive Bayes classifier on the dataset "data" with
# labels "labels" and save the model to "nbc_model", the following command
# may be used:
if (FALSE) {
output <- nbc(training=data, labels=labels)
nbc_model <- output$output_model
}
# Then, to use "nbc_model" to predict the classes of the dataset "test_set"
# and save the predicted classes to "predictions", the following command may
# be used:
if (FALSE) {
output <- nbc(input_model=nbc_model, test=test_set)
predictions <- output$predictions
}
Run the code above in your browser using DataLab