logistic_regression_function.hpp

Go to the documentation of this file.
00001 
00024 #ifndef __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP
00025 #define __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP
00026 
00027 #include <mlpack/core.hpp>
00028 
00029 namespace mlpack {
00030 namespace regression {
00031 
00037 class LogisticRegressionFunction
00038 {
00039  public:
00040   LogisticRegressionFunction(const arma::mat& predictors,
00041                              const arma::vec& responses,
00042                              const double lambda = 0);
00043 
00044   LogisticRegressionFunction(const arma::mat& predictors,
00045                              const arma::vec& responses,
00046                              const arma::mat& initialPoint,
00047                              const double lambda = 0);
00048 
00050   const arma::mat& InitialPoint() const { return initialPoint; }
00052   arma::mat& InitialPoint() { return initialPoint; }
00053 
00055   const double& Lambda() const { return lambda; }
00057   double& Lambda() { return lambda; }
00058 
00060   const arma::mat& Predictors() const { return predictors; }
00062   const arma::vec& Responses() const { return responses; }
00063 
00075   double Evaluate(const arma::mat& parameters) const;
00076 
00091   double Evaluate(const arma::mat& parameters, const size_t i) const;
00092 
00100   void Gradient(const arma::mat& parameters, arma::mat& gradient) const;
00101 
00112   void Gradient(const arma::mat& parameters,
00113                 const size_t i,
00114                 arma::mat& gradient) const;
00115 
00117   const arma::mat& GetInitialPoint() const { return initialPoint; }
00118 
00120   size_t NumFunctions() const { return predictors.n_cols; }
00121 
00122  private:
00124   arma::mat initialPoint;
00126   const arma::mat& predictors;
00128   const arma::vec& responses;
00130   double lambda;
00131 };
00132 
00133 }; // namespace regression
00134 }; // namespace mlpack
00135 
00136 #endif // __MLPACK_METHODS_LOGISTIC_REGRESSION_LOGISTIC_REGRESSION_FUNCTION_HPP

Generated on 29 Sep 2016 for MLPACK by  doxygen 1.6.1