13 #ifndef MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP 14 #define MLPACK_CORE_DISTRIBUTIONS_REGRESSION_DISTRIBUTION_HPP 21 namespace distribution {
53 const arma::vec& responses) :
54 RegressionDistribution(predictors, arma::rowvec(responses.t()))
65 const arma::rowvec& responses)
67 rf.
Train(predictors, responses);
77 template<
typename Archive>
99 void Train(
const arma::mat& observations);
108 const arma::vec& weights);
116 void Train(
const arma::mat& observations,
const arma::rowvec& weights);
123 double Probability(
const arma::vec& observation)
const;
142 arma::vec& predictions)
const;
150 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.
Linear algebra utility functions, generally performed on matrices or vectors.
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 serialize(Archive &ar, const uint32_t)
Serialize the distribution.
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.
A class that represents a univariate conditionally Gaussian distribution.
const GaussianDistribution & Err() const
Return error distribution.
double Train(const arma::mat &predictors, const arma::rowvec &responses, const bool intercept=true)
Train the LinearRegression model on the given data.
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.