.\" Text automatically generated by txt2man .TH mlpack_perceptron 1 "18 November 2018" "mlpack-3.0.4" "User Commands" .SH NAME \fBmlpack_perceptron \fP- perceptron .SH SYNOPSIS .nf .fam C \fBmlpack_perceptron\fP [\fB-m\fP \fIunknown\fP] [\fB-l\fP \fIstring\fP] [\fB-n\fP \fIint\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-h\fP \fB-v\fP] .fam T .fi .fam T .fi .SH DESCRIPTION This program implements a perceptron, which is a single level neural network. The perceptron makes its predictions based on a linear predictor function combining a set of weights with the feature vector. The perceptron learning rule is able to converge, given enough iterations (specified using the \(cq\fB--max_iterations\fP (\fB-n\fP)' parameter), if the data supplied is linearly separable. The perceptron is parameterized by a matrix of weight vectors that denote the numerical weights of the neural network. .PP This program allows loading a perceptron from a model (via the \(cq\fB--input_model_file\fP (\fB-m\fP)' parameter) or training a perceptron given training data (via the '\fB--training_file\fP (\fB-t\fP)' parameter), or both those things at once. In addition, this program allows classification on a test dataset (via the \(cq\fB--test_file\fP (\fB-T\fP)' parameter) and the classification results on the test set may be saved with the '\fB--output_file\fP (\fB-o\fP)'output parameter. The perceptron model may be saved with the '\fB--output_model_file\fP (\fB-M\fP)' output parameter. .PP The training data given with the '\fB--training_file\fP (\fB-t\fP)' option may have class labels as its last dimension (so, if the training data is in CSV format, labels should be the last column). Alternately, the '\fB--labels_file\fP (\fB-l\fP)' parameter may be used to specify a separate matrix of labels. .PP All these options make it easy to train a perceptron, and then re-use that perceptron for later classification. The invocation below trains a perceptron on 'training_data.csv' with labels 'training_labels.csv', and saves the model to 'perceptron_model.bin'. .PP $ perceptron \fB--training_file\fP training_data.csv \fB--labels_file\fP training_labels.csv \fB--output_model_file\fP perceptron_model.bin .PP Then, this model can be re-used for classification on the test data \(cqtest_data.csv'. The example below does precisely that, saving the predicted classes to 'predictions.csv'. .PP $ perceptron \fB--input_model_file\fP perceptron_model.bin \fB--test_file\fP test_data.csv \fB--output_file\fP predictions.csv .PP Note that all of the options may be specified at once: predictions may be calculated right after training a model, and model training can occur even if an existing perceptron model is passed with the '\fB--input_model_file\fP (\fB-m\fP)' parameter. However, note that the number of classes and the dimensionality of all data must match. So you cannot pass a perceptron model trained on 2 classes and then re-train with a 4-class dataset. Similarly, attempting classification on a 3-dimensional dataset with a perceptron that has been trained on 8 dimensions will cause an error. .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] Get help on a specific module or option. Default value ''. .TP .B \fB--input_model_file\fP (\fB-m\fP) [\fIunknown\fP] Input perceptron model. Default value ''. .TP .B \fB--labels_file\fP (\fB-l\fP) [\fIstring\fP] A matrix containing labels for the training set. Default value ''. .TP .B \fB--max_iterations\fP (\fB-n\fP) [\fIint\fP] The maximum number of iterations the perceptron is to be run Default value 1000. .TP .B \fB--test_file\fP (\fB-T\fP) [\fIstring\fP] A matrix containing the test set. Default value ''. .TP .B \fB--training_file\fP (\fB-t\fP) [\fIstring\fP] A matrix containing the training set. Default value ''. .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. Default value ''. .TP .B \fB--output_model_file\fP (\fB-M\fP) [\fIunknown\fP] Output for trained perceptron model. Default value ''. .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.