|
MLPACK
1.0.4
|
A simple linear regression algorithm using ordinary least squares. More...
Public Member Functions | |
| LinearRegression (arma::mat &predictors, const arma::vec &responses) | |
| Creates the model. | |
| LinearRegression (const std::string &filename) | |
| Initialize the model from a file. | |
| LinearRegression (const LinearRegression &linearRegression) | |
| Copy constructor. | |
| LinearRegression () | |
| Default constructor. | |
| ~LinearRegression () | |
| Destructor - no work done. | |
| const arma::vec & | Parameters () const |
| Return the parameters (the b vector). | |
| arma::vec & | Parameters () |
| Modify the parameters (the b vector). | |
| void | Predict (const arma::mat &points, arma::vec &predictions) |
| Calculate y_i for each data point in points. | |
Private Attributes | |
| arma::vec | parameters |
| The calculated B. | |
A simple linear regression algorithm using ordinary least squares.
Definition at line 33 of file linear_regression.hpp.
| mlpack::regression::LinearRegression::LinearRegression | ( | arma::mat & | predictors, |
| const arma::vec & | responses | ||
| ) |
Creates the model.
| predictors | X, matrix of data points to create B with. |
| responses | y, the measured data for each point in X |
| mlpack::regression::LinearRegression::LinearRegression | ( | const std::string & | filename | ) |
Initialize the model from a file.
| filename | the name of the file to load the model from. |
| mlpack::regression::LinearRegression::LinearRegression | ( | const LinearRegression & | linearRegression | ) |
Copy constructor.
| linearRegression | the other instance to copy parameters from. |
Default constructor.
Definition at line 61 of file linear_regression.hpp.
Destructor - no work done.
| const arma::vec& mlpack::regression::LinearRegression::Parameters | ( | ) | const [inline] |
Return the parameters (the b vector).
Definition at line 78 of file linear_regression.hpp.
References parameters.
| arma::vec& mlpack::regression::LinearRegression::Parameters | ( | ) | [inline] |
Modify the parameters (the b vector).
Definition at line 80 of file linear_regression.hpp.
References parameters.
| void mlpack::regression::LinearRegression::Predict | ( | const arma::mat & | points, |
| arma::vec & | predictions | ||
| ) |
Calculate y_i for each data point in points.
| points | the data points to calculate with. |
| predictions | y, will contain calculated values on completion. |
arma::vec mlpack::regression::LinearRegression::parameters [private] |
The calculated B.
Initialized and filled by constructor to hold the least squares solution.
Definition at line 87 of file linear_regression.hpp.
Referenced by Parameters().
1.7.6.1