22 #ifndef __MLPACK_METHODS_LINEAR_REGRESSION_LINEAR_REGRESSION_HPP
23 #define __MLPACK_METHODS_LINEAR_REGRESSION_LINEAR_REGRESSION_HPP
28 namespace regression {
45 const arma::vec& responses,
73 void Predict(
const arma::mat& points, arma::vec& predictions)
const;
93 const arma::vec& responses)
const;
125 #endif // __MLPACK_METHODS_LINEAR_REGRESSCLIN_HPP
void Predict(const arma::mat &points, arma::vec &predictions) const
Calculate y_i for each data point in points.
Linear algebra utility functions, generally performed on matrices or vectors.
A simple linear regression algorithm using ordinary least squares.
double & Lambda()
Modify the Tikhonov regularization parameter for ridge regression.
arma::vec parameters
The calculated B.
double ComputeError(const arma::mat &points, const arma::vec &responses) const
Calculate the L2 squared error on the given predictors and responses using this linear regression mod...
double Lambda() const
Return the Tikhonov regularization parameter for ridge regression.
double lambda
The Tikhonov regularization parameter for ridge regression (0 for linear regression).
const arma::vec & Parameters() const
Return the parameters (the b vector).
LinearRegression()
Empty constructor.
std::string ToString() const
arma::vec & Parameters()
Modify the parameters (the b vector).