.\" Text automatically generated by txt2man .TH mlpack_nbc 1 "12 December 2020" "mlpack-3.4.2" "User Commands" .SH NAME \fBmlpack_nbc \fP- parametric naive bayes classifier .SH SYNOPSIS .nf .fam C \fBmlpack_nbc\fP [\fB-I\fP \fIbool\fP] [\fB-m\fP \fIunknown\fP] [\fB-l\fP \fIstring\fP] [\fB-T\fP \fIstring\fP] [\fB-t\fP \fIstring\fP] [\fB-V\fP \fIbool\fP] [\fB-o\fP \fIstring\fP] [\fB-M\fP \fIunknown\fP] [\fB--output_probs_file\fP \fIstring\fP] [\fB-a\fP \fIstring\fP] [\fB-p\fP \fIstring\fP] [\fB-h\fP \fB-v\fP] .fam T .fi .fam T .fi .SH DESCRIPTION This program trains the Naive Bayes classifier on the given labeled training set, or loads a model from the given model file, and then may use that trained model to classify the points in a given test set. .PP The training set is specified with the '\fB--training_file\fP (\fB-t\fP)' parameter. Labels may be either the last row of the training set, or alternately the \(cq\fB--labels_file\fP (\fB-l\fP)' parameter may be specified to pass a separate matrix of labels. .PP If training is not desired, a pre-existing model may be loaded with the \(cq\fB--input_model_file\fP (\fB-m\fP)' parameter. .RE .PP .RS The '\fB--incremental_variance\fP (\fB-I\fP)' parameter can be used to force the training to use an incremental algorithm for calculating variance. This is slower, but can help avoid loss of precision in some cases. .PP If classifying a test set is desired, the test set may be specified with the \(cq\fB--test_file\fP (\fB-T\fP)' parameter, and the classifications may be saved with the \(cq\fB--predictions_file\fP (\fB-a\fP)'predictions parameter. If saving the trained model is desired, this may be done with the '\fB--output_model_file\fP (\fB-M\fP)' output parameter. .PP Note: the '\fB--output_file\fP (\fB-o\fP)' and '\fB--output_probs_file\fP' parameters are deprecated and will be removed in mlpack 4.0.0. Use '\fB--predictions_file\fP (\fB-a\fP)' and '\fB--probabilities_file\fP (\fB-p\fP)' instead. .PP For example, to train a Naive Bayes classifier on the dataset 'data.csv' with labels 'labels.csv' and save the model to 'nbc_model.bin', the following command may be used: .PP $ \fBmlpack_nbc\fP \fB--training_file\fP data.csv \fB--labels_file\fP labels.csv \fB--output_model_file\fP nbc_model.bin .PP Then, to use 'nbc_model.bin' to predict the classes of the dataset \(cqtest_set.csv' and save the predicted classes to 'predictions.csv', the following command may be used: .PP $ \fBmlpack_nbc\fP \fB--input_model_file\fP nbc_model.bin \fB--test_file\fP test_set.csv \fB--output_file\fP predictions.csv .RE .PP .SH OPTIONAL INPUT OPTIONS .TP .B \fB--help\fP (\fB-h\fP) [\fIbool\fP] Default help info. .TP .B \fB--incremental_variance\fP (\fB-I\fP) [\fIbool\fP] The variance of each class will be calculated incrementally. .TP .B \fB--info\fP [\fIstring\fP] Print help on a specific option. Default value ''. .TP .B \fB--input_model_file\fP (\fB-m\fP) [\fIunknown\fP] Input Naive Bayes model. .TP .B \fB--labels_file\fP (\fB-l\fP) [\fIstring\fP] A file containing labels for the training set. .TP .B \fB--test_file\fP (\fB-T\fP) [\fIstring\fP] A matrix containing the test set. .TP .B \fB--training_file\fP (\fB-t\fP) [\fIstring\fP] A matrix containing the training set. .TP .B \fB--verbose\fP (\fB-v\fP) [\fIbool\fP] Display informational messages and the full list of parameters and timers at the end of execution. .TP .B \fB--version\fP (\fB-V\fP) [\fIbool\fP] Display the version of mlpack. .SH OPTIONAL OUTPUT OPTIONS .TP .B \fB--output_file\fP (\fB-o\fP) [\fIstring\fP] The matrix in which the predicted labels for the test set will be written (deprecated). .TP .B \fB--output_model_file\fP (\fB-M\fP) [\fIunknown\fP] File to save trained Naive Bayes model to. \fB--output_probs_file\fP [\fIstring\fP] The matrix in which the predicted probability of labels for the test set will be written (deprecated). .TP .B \fB--predictions_file\fP (\fB-a\fP) [\fIstring\fP] The matrix in which the predicted labels for the test set will be written. .TP .B \fB--probabilities_file\fP (\fB-p\fP) [\fIstring\fP] The matrix in which the predicted probability of labels for the test set will be written. .SH ADDITIONAL INFORMATION For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.