Go to the documentation of this file.
15 #ifndef MLPACK_METHODS_BAYESIAN_LINEAR_REGRESSION_HPP
16 #define MLPACK_METHODS_BAYESIAN_LINEAR_REGRESSION_HPP
21 namespace regression {
115 const bool scaleData =
false,
116 const size_t nIterMax = 50,
117 const double tol = 1e-4);
128 const arma::rowvec& responses);
139 arma::rowvec& predictions)
const;
151 arma::rowvec& predictions,
152 arma::rowvec&
std)
const;
162 double RMSE(
const arma::mat& data,
163 const arma::rowvec& responses)
const;
170 const arma::colvec&
Omega()
const {
return omega; }
178 double Alpha()
const {
return alpha; }
186 double Beta()
const {
return beta; }
200 const arma::colvec&
DataOffset()
const {
return dataOffset; }
208 const arma::colvec&
DataScale()
const {
return dataScale; }
220 template<
typename Archive>
237 arma::colvec dataOffset;
240 arma::colvec dataScale;
243 double responsesOffset;
258 arma::mat matCovariance;
270 double CenterScaleData(
const arma::mat& data,
271 const arma::rowvec& responses,
273 arma::rowvec& responsesProc);
281 void CenterScaleDataPred(
const arma::mat& data,
282 arma::mat& dataProc)
const;
288 #include "bayesian_linear_regression_impl.hpp"
double Beta() const
Get the precision (or inverse variance) beta of the model.
BayesianLinearRegression(const bool centerData=true, const bool scaleData=false, const size_t nIterMax=50, const double tol=1e-4)
Set the parameters of Bayesian Ridge regression object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Linear algebra utility functions, generally performed on matrices or vectors.
double Variance() const
Get the estimated variance.
const arma::colvec & DataScale() const
Get the vector of standard deviations computed on the features over the training points.
A Bayesian approach to the maximum likelihood estimation of the parameters of the linear regression ...
double RMSE(const arma::mat &data, const arma::rowvec &responses) const
Compute the Root Mean Square Error between the predictions returned by the model and the true respons...
const arma::colvec & DataOffset() const
Get the mean vector computed on the features over the training points.
double Alpha() const
Get the precision (or inverse variance) of the gaussian prior.
void serialize(Archive &ar, const unsigned int)
Serialize the BayesianLinearRegression model.
void Predict(const arma::mat &points, arma::rowvec &predictions) const
Predict for each data point in the given data matrix using the currently-trained Bayesian Ridge mode...
double Train(const arma::mat &data, const arma::rowvec &responses)
Run BayesianLinearRegression.
const arma::colvec & Omega() const
Get the solution vector.
double ResponsesOffset() const
Get the mean value of the train responses.
void Predict(const arma::mat &points, arma::rowvec &predictions, arma::rowvec &std) const
Predict and the standard deviation of the predictive posterior distribution for each data point in t...