Go to the documentation of this file.
8 #ifndef NUKLEI_KERNEL_LOGISTIC_REGRESSOR_H
9 #define NUKLEI_KERNEL_LOGISTIC_REGRESSOR_H
41 const std::vector<int>& labels);
55 const GMatrix& gramMatrix,
56 const std::vector<int>& labels);
69 const std::vector<int>& labels);
78 void train(
const double delta = 0.0001,
const unsigned itrNewton = 5);
85 return static_cast<bool>(vklr_);
109 NUKLEI_TRACE_BEGIN();
115 void computeGramMatrix();
119 std::vector<int> labels_;
120 boost::optional<GMatrix> vklr_;
bool isTrained()
Returns true if the classifier has been trained.
This class acts as a vector-like container for kernels. It also provides methods related to kernel de...
void train(const double delta=0.0001, const unsigned itrNewton=5)
Computes KLR weights.
void setData(const KernelCollection &data, const std::vector< int > &labels)
Imports input from data and labels, and computes the Gram matrix of the data.
const GMatrix & vklr() const
Returns KLR weights.
#define NUKLEI_ASSERT(expression)
Throws an Error if expression is not true.
Polymorphic kernel class.
Vector2 test(const kernel::base &t) const
Returns a pair of values which indicate the probability of classes 1 and 2.
Implements kernel logistic regression.