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>
36 const arma::Row<size_t>& 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;
128 #include "logistic_regression_function_impl.hpp" 130 #endif // MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP The log-likelihood function for the logistic regression objective function.
Linear algebra utility functions, generally performed on matrices or vectors.
arma::mat initialPoint
The initial point, from which to start the optimization.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization.
const MatType & predictors
The matrix of data points (predictors).
double & Lambda()
Modify the regularization parameter (lambda).
const double & Lambda() const
Return the regularization parameter (lambda).
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.
const arma::Row< size_t > & responses
The vector of responses to the input data points.
double Evaluate(const arma::mat ¶meters) const
Evaluate the logistic regression log-likelihood function with the given parameters.
const arma::mat & InitialPoint() const
Return the initial point for the optimization.
arma::mat & InitialPoint()
Modify the initial point for the optimization.
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 lambda
The regularization parameter for L2-regularization.
const MatType & Predictors() const
Return the matrix of predictors.
LogisticRegressionFunction(const MatType &predictors, const arma::Row< size_t > &responses, const double lambda=0)