24 #ifndef __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP 25 #define __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP 30 namespace regression {
45 const arma::vec& responses,
75 double Evaluate(
const arma::mat& parameters)
const;
91 double Evaluate(
const arma::mat& parameters,
const size_t i)
const;
100 void Gradient(
const arma::mat& parameters, arma::mat& gradient)
const;
112 void Gradient(
const arma::mat& parameters,
114 arma::mat& gradient)
const;
136 #endif // __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP The log-likelihood function for the logistic regression objective function.
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization.
const double & Lambda() const
Return the regularization parameter (lambda).
void Gradient(const arma::mat ¶meters, arma::mat &gradient) const
Evaluate the gradient of the logistic regression log-likelihood function with the given parameters...
Linear algebra utility functions, generally performed on matrices or vectors.
arma::mat initialPoint
The initial point, from which to start the optimization.
double & Lambda()
Modify the regularization parameter (lambda).
const arma::vec & Responses() const
Return the vector of responses.
arma::mat & InitialPoint()
Modify the initial point for the optimization.
size_t NumFunctions() const
Return the number of separable functions (the number of predictor points).
const arma::mat & predictors
The matrix of data points (predictors).
const arma::vec & responses
The vector of responses to the input data points.
const arma::mat & Predictors() const
Return the matrix of predictors.
const arma::mat & InitialPoint() const
Return the initial point for the optimization.
LogisticRegressionFunction(const arma::mat &predictors, const arma::vec &responses, const double lambda=0)
double lambda
The regularization parameter for L2-regularization.
double Evaluate(const arma::mat ¶meters) const
Evaluate the logistic regression log-likelihood function with the given parameters.