superviseddescent  0.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
Public Member Functions | List of all members
superviseddescent::Regressor Class Referenceabstract

#include <regressors.hpp>

Inheritance diagram for superviseddescent::Regressor:
superviseddescent::LinearRegressor< Solver >

Public Member Functions

virtual bool learn (cv::Mat data, cv::Mat labels)=0
 
virtual double test (cv::Mat data, cv::Mat labels)=0
 
virtual cv::Mat predict (cv::Mat values)=0
 

Detailed Description

Abstract base class for regressor-like learning algorithms to be used with the SupervisedDescentOptimiser.

Classes that implement this minimal set of functions can be used with the SupervisedDescentOptimiser.

Member Function Documentation

virtual bool superviseddescent::Regressor::learn ( cv::Mat  data,
cv::Mat  labels 
)
pure virtual

Learning function that takes a matrix of data, with one example per row, and a corresponding matrix of labels, with one or multiple labels per training datum.

Parameters
[in]dataTraining data matrix, one example per row.
[in]labelsLabels corresponding to the training data.
Returns
Returns whether the learning was successful.

Implemented in superviseddescent::LinearRegressor< Solver >.

virtual cv::Mat superviseddescent::Regressor::predict ( cv::Mat  values)
pure virtual

Predicts the regressed value for one given sample.

Parameters
[in]valuesOne data point as a row vector.
Returns
The predicted value(s).

Implemented in superviseddescent::LinearRegressor< Solver >.

virtual double superviseddescent::Regressor::test ( cv::Mat  data,
cv::Mat  labels 
)
pure virtual

Test the learned regressor, using the given data (one row for every element) and corresponding labels. Calculates the normalised least squares residual \( \frac{\|\mathbf{prediction}-\mathbf{labels}\|}{\|\mathbf{labels}\|} \).

Parameters
[in]dataTest data matrix.
[in]labelsCorresponding label information.
Returns
The normalised least squares residual.

Implemented in superviseddescent::LinearRegressor< Solver >.


The documentation for this class was generated from the following file: