12 #ifndef MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP 13 #define MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP 20 namespace distribution {
52 const arma::vec& responses) :
53 RegressionDistribution(predictors, arma::rowvec(responses.t()))
64 const arma::rowvec& responses)
66 rf.
Train(predictors, responses);
76 template<
typename Archive>
79 ar & BOOST_SERIALIZATION_NVP(rf);
80 ar & BOOST_SERIALIZATION_NVP(err);
98 void Train(
const arma::mat& observations);
106 const arma::vec& weights);
113 void Train(
const arma::mat& observations,
const arma::rowvec& weights);
120 double Probability(
const arma::vec& observation)
const;
138 arma::vec& predictions)
const;
146 void Predict(
const arma::mat& points, arma::rowvec& predictions)
const;
A single multivariate Gaussian distribution.
void Train(const arma::mat &observations)
Estimate the Gaussian distribution directly from the given observations.
A simple linear regression algorithm using ordinary least squares.
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack_deprecated void Predict(const arma::mat &points, arma::vec &predictions) const
Calculate y_i for each data point in points.
#define mlpack_deprecated
void Train(const arma::mat &predictors, const arma::rowvec &responses, const bool intercept=true)
Train the LinearRegression model on the given data.
RegressionDistribution(const arma::mat &predictors, const arma::rowvec &responses)
Create a Conditional Gaussian distribution with conditional mean function obtained by running Regress...
double LogProbability(const arma::vec &observation) const
Evaluate log probability density function of given observation.
const arma::vec & Parameters() const
Return the parameters (the b vector).
mlpack_deprecated RegressionDistribution(const arma::mat &predictors, const arma::vec &responses)
Create a Conditional Gaussian distribution with conditional mean function obtained by running Regress...
RegressionDistribution()
Default constructor, which creates a Gaussian with zero dimension.
size_t Dimensionality() const
Return the dimensionality.
void serialize(Archive &ar, const unsigned int)
Serialize the distribution.
A class that represents a univariate conditionally Gaussian distribution.
const GaussianDistribution & Err() const
Return error distribution.
GaussianDistribution & Err()
Modify error distribution.
double ComputeError(const arma::mat &points, const arma::rowvec &responses) const
Calculate the L2 squared error on the given predictors and responses using this linear regression mod...
const regression::LinearRegression & Rf() const
Return regression function.
const arma::mat & Covariance() const
Return the covariance matrix.
double Probability(const arma::vec &observation) const
Evaluate probability density function of given observation.
const arma::vec & Parameters() const
Return the parameters (the b vector).
regression::LinearRegression & Rf()
Modify regression function.