14 #ifndef MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP
15 #define MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP
20 namespace regression {
27 template<
typename MatType = arma::mat>
32 const arma::Row<size_t>& responses,
33 const double lambda = 0);
36 const arma::Row<size_t>& responses,
37 const arma::vec& initialPoint,
38 const double lambda = 0);
46 const double&
Lambda()
const {
return lambda; }
53 const arma::vec&
Responses()
const {
return responses; }
66 double Evaluate(
const arma::mat& parameters)
const;
82 double Evaluate(
const arma::mat& parameters,
const size_t i)
const;
91 void Gradient(
const arma::mat& parameters, arma::mat& gradient)
const;
103 void Gradient(
const arma::mat& parameters,
105 arma::mat& gradient)
const;
115 arma::mat initialPoint;
117 const MatType& predictors;
119 const arma::Row<size_t>& responses;
128 #include "logistic_regression_function_impl.hpp"
130 #endif // MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP
LogisticRegressionFunction(const MatType &predictors, const arma::Row< size_t > &responses, const double lambda=0)
The log-likelihood function for the logistic regression objective function.
size_t NumFunctions() const
Return the number of separable functions (the number of predictor points).
const arma::vec & Responses() const
Return the vector of responses.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Gradient(const arma::mat ¶meters, arma::mat &gradient) const
Evaluate the gradient of the logistic regression log-likelihood function with the given parameters...
double Evaluate(const arma::mat ¶meters) const
Evaluate the logistic regression log-likelihood function with the given parameters.
const double & Lambda() const
Return the regularization parameter (lambda).
const MatType & Predictors() const
Return the matrix of predictors.
arma::mat & InitialPoint()
Modify the initial point for the optimization.
const arma::mat & InitialPoint() const
Return the initial point for the optimization.
double & Lambda()
Modify the regularization parameter (lambda).
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization.