.\" Text automatically generated by txt2man .TH mlpack_softmax_regression 1 "12 December 2020" "mlpack-3.4.2" "User Commands" .SH NAME \fBmlpack_softmax_regression \fP- softmax regression .SH SYNOPSIS .nf .fam C \fBmlpack_softmax_regression\fP [\fB-m\fP \fIunknown\fP] [\fB-l\fP \fIstring\fP] [\fB-r\fP \fIdouble\fP] [\fB-n\fP \fIint\fP] [\fB-N\fP \fIbool\fP] [\fB-c\fP \fIint\fP] [\fB-T\fP \fIstring\fP] [\fB-L\fP \fIstring\fP] [\fB-t\fP \fIstring\fP] [\fB-V\fP \fIbool\fP] [\fB-M\fP \fIunknown\fP] [\fB-p\fP \fIstring\fP] [\fB-h\fP \fB-v\fP] .fam T .fi .fam T .fi .SH DESCRIPTION This program performs softmax regression, a generalization of logistic regression to the multiclass case, and has support for L2 regularization. The program is able to train a model, load an existing model, and give predictions (and optionally their accuracy) for test data. .PP Training a softmax regression model is done by giving a file of training points with the '\fB--training_file\fP (\fB-t\fP)' parameter and their corresponding labels with the '\fB--labels_file\fP (\fB-l\fP)' parameter. The number of classes can be manually specified with the '\fB--number_of_classes\fP (\fB-c\fP)' parameter, and the maximum number of iterations of the L-BFGS optimizer can be specified with the \(cq\fB--max_iterations\fP (\fB-n\fP)' parameter. The L2 regularization constant can be specified with the '\fB--lambda\fP (\fB-r\fP)' parameter and if an intercept term is not desired in the model, the '\fB--no_intercept\fP (\fB-N\fP)' parameter can be specified. .PP The trained model can be saved with the '\fB--output_model_file\fP (\fB-M\fP)' output parameter. If training is not desired, but only testing is, a model can be loaded with the '\fB--input_model_file\fP (\fB-m\fP)' parameter. At the current time, a loaded model cannot be trained further, so specifying both '\fB--input_model_file\fP (\fB-m\fP)' and '\fB--training_file\fP (\fB-t\fP)' is not allowed. .PP The program is also able to evaluate a model on test data. A test dataset can be specified with the '\fB--test_file\fP (\fB-T\fP)' parameter. Class predictions can be saved with the '\fB--predictions_file\fP (\fB-p\fP)' output parameter. If labels are specified for the test data with the '\fB--test_labels_file\fP (\fB-L\fP)' parameter, then the program will print the accuracy of the predictions on the given test set and its corresponding labels. .PP For example, to train a softmax regression model on the data 'dataset.csv' with labels 'labels.csv' with a maximum of 1000 iterations for training, saving the trained model to 'sr_model.bin', the following command can be used: .RE .PP .RS $ \fBmlpack_softmax_regression\fP \fB--training_file\fP dataset.csv \fB--labels_file\fP labels.csv \fB--output_model_file\fP sr_model.bin .PP Then, to use 'sr_model.bin' to classify the test points in 'test_points.csv', saving the output predictions to 'predictions.csv', the following command can be used: .PP $ \fBmlpack_softmax_regression\fP \fB--input_model_file\fP sr_model.bin \fB--test_file\fP test_points.csv \fB--predictions_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--info\fP [\fIstring\fP] Print help on a specific option. Default value ''. .TP .B \fB--input_model_file\fP (\fB-m\fP) [\fIunknown\fP] File containing existing model (parameters). .TP .B \fB--labels_file\fP (\fB-l\fP) [\fIstring\fP] A matrix containing labels (0 or 1) for the points in the training set (y). The labels must order as a row. .TP .B \fB--lambda\fP (\fB-r\fP) [\fIdouble\fP] L2-regularization constant Default value 0.0001. .TP .B \fB--max_iterations\fP (\fB-n\fP) [\fIint\fP] Maximum number of iterations before termination. Default value 400. .TP .B \fB--no_intercept\fP (\fB-N\fP) [\fIbool\fP] Do not add the intercept term to the model. .TP .B \fB--number_of_classes\fP (\fB-c\fP) [\fIint\fP] Number of classes for classification; if unspecified (or 0), the number of classes found in the labels will be used. Default value 0. .TP .B \fB--test_file\fP (\fB-T\fP) [\fIstring\fP] Matrix containing test dataset. .TP .B \fB--test_labels_file\fP (\fB-L\fP) [\fIstring\fP] Matrix containing test labels. .TP .B \fB--training_file\fP (\fB-t\fP) [\fIstring\fP] A matrix containing the training set (the matrix of predictors, X). .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_model_file\fP (\fB-M\fP) [\fIunknown\fP] File to save trained softmax regression model to. .TP .B \fB--predictions_file\fP (\fB-p\fP) [\fIstring\fP] Matrix to save predictions for test dataset into. .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.