.\"Text automatically generated by txt2man .TH linear_regression "1" "" "" .SH NAME \fBlinear_regression \fP- simple linear regression and prediction .SH SYNOPSIS .nf .fam C \fBlinear_regression\fP [\fB-h\fP] [\fB-v\fP] [\fB-i\fP \fIstring\fP] [\fB-r\fP \fIstring\fP] [\fB-l\fP \fIdouble\fP] [\fB-m\fP \fIstring\fP] [\fB-o\fP \fIstring\fP] [\fB-p\fP \fIstring\fP] [\fB-t\fP \fIstring\fP] \fB-V\fP .fam T .fi .fam T .fi .SH DESCRIPTION An implementation of simple linear regression and simple ridge regression using ordinary least squares. This solves the problem .PP .nf .fam C y = X * b + e .fam T .fi where X (\fB--input_file\fP) and y (the last column of \fB--input_file\fP, or \fB--input_responses\fP) are known and b is the desired variable. If the covariance matrix (X'X) is not invertible, or if the solution is overdetermined, then specify a Tikhonov regularization constant (\fB--lambda\fP) greater than 0, which will regularize the covariance matrix to make it invertible. The calculated b is saved to disk (\fB--output_file\fP). .PP Optionally, the calculated value of b is used to predict the responses for another matrix X' (\fB--test_file\fP): .PP .nf .fam C y' = X' * b .fam T .fi and these predicted responses, y', are saved to a file (\fB--output_predictions\fP). This type of regression is related to least-angle regression, which mlpack implements with the 'lars' executable. .SH REQUIRED OPTIONS .SH OPTIONS .TP .B \fB--help\fP (\fB-h\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_file\fP (\fB-i\fP) [\fIstring\fP] File containing X (regressors). Default value ''. .TP .B \fB--input_responses\fP (\fB-r\fP) [\fIstring\fP] Optional file containing y (responses). If not given, the responses are assumed to be the last row of the input file. Default value ''. .TP .B \fB--lambda\fP (\fB-l\fP) [\fIdouble\fP] Tikhonov regularization for ridge regression. If 0, the method reduces to linear regression. Default value 0. .TP .B \fB--model_file\fP (\fB-m\fP) [\fIstring\fP] File containing existing model (parameters). Default value ''. .TP .B \fB--output_file\fP (\fB-o\fP) [\fIstring\fP] File where parameters (b) will be saved. Default value 'parameters.csv'. .TP .B \fB--output_predictions\fP (\fB-p\fP) [\fIstring\fP] If \fB--test_file\fP is specified, this file is where the predicted responses will be saved. Default value 'predictions.csv'. .TP .B \fB--test_file\fP (\fB-t\fP) [\fIstring\fP] File containing X' (test regressors). Default value ''. .TP .B \fB--verbose\fP (\fB-v\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) Display the version of mlpack. .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.