Ranking SVM algorithm with support for custom kernels.
More...
#include <libcmaes/surrogates/rankingsvm.hpp>
|
void | train (dMat &x, const int &niter, const dMat &covinv, const dVec &xmean) |
| trains a ranker from a set of points
|
|
void | predict (dVec &fit, dMat &x_test, dMat &x_train, const dMat &covinv, const dVec &xmean) |
| predicts a ranking from a learnt ranker
|
|
void | encode (dMat &x, const dMat &covinv, const dVec &xmean) |
| encoding a set of point in a transformed space
|
|
void | compute_training_kernel (dMat &x) |
| pre-computation of the kernel values for every examples and coordinates
|
|
void | optimize (const dMat &x, const int &niter) |
| optimizes a ranker's model given a training set x
|
|
double | error (dMat &x_test, dMat &x_train, const dVec &ref_fit, const dMat &covinv, const dVec &xmean) |
| computes the ranker's error over a dataset
|
|
|
bool | _encode = false |
|
dMat | _K |
|
dVec | _alpha |
|
dMat | _dKij |
|
dMat | _C |
|
double | _Cval = 1e6 |
|
double | _epsilon = 1.0 |
|
TKernel | _kernel |
|
std::mt19937 | _rng |
|
std::uniform_real_distribution | _udist |
|
template<class TKernel = RBFKernel>
class RankingSVM< TKernel >
Ranking SVM algorithm with support for custom kernels.
◆ compute_training_kernel()
template<class TKernel = RBFKernel>
void RankingSVM< TKernel >::compute_training_kernel |
( |
dMat & |
x | ) |
|
|
inline |
pre-computation of the kernel values for every examples and coordinates
- Parameters
-
x | training set as a point per column of the matrix |
◆ encode()
template<class TKernel = RBFKernel>
void RankingSVM< TKernel >::encode |
( |
dMat & |
x, |
|
|
const dMat & |
covinv, |
|
|
const dVec & |
xmean |
|
) |
| |
|
inline |
encoding a set of point in a transformed space
- Parameters
-
x | the points to be transformed, one per column of the matrix |
covinv | the inverse sqrt covariance of the points in the training set |
training | set mean distribution if available along with covariance matrix |
◆ error()
template<class TKernel = RBFKernel>
double RankingSVM< TKernel >::error |
( |
dMat & |
x_test, |
|
|
dMat & |
x_train, |
|
|
const dVec & |
ref_fit, |
|
|
const dMat & |
covinv, |
|
|
const dVec & |
xmean |
|
) |
| |
|
inline |
computes the ranker's error over a dataset
- Parameters
-
x_test | testing dataset, with one point per column of the matrix |
x_train | the initial training dataset, used by encode() if needed |
ref_fit | the reference ranking fit against which to test the prediction |
covinv | the inverse sqrt covariance of the points in the training set, if available and needed, encode() function. |
training | set mean distribution if available along with covariance matrix, and needed, see encode() function |
- See also
- encode
◆ optimize()
template<class TKernel = RBFKernel>
void RankingSVM< TKernel >::optimize |
( |
const dMat & |
x, |
|
|
const int & |
niter |
|
) |
| |
|
inline |
optimizes a ranker's model given a training set x
- Parameters
-
training | set as a set of points in column of the matrix |
niter | the number of iterations allowed for optimization |
◆ predict()
template<class TKernel = RBFKernel>
void RankingSVM< TKernel >::predict |
( |
dVec & |
fit, |
|
|
dMat & |
x_test, |
|
|
dMat & |
x_train, |
|
|
const dMat & |
covinv, |
|
|
const dVec & |
xmean |
|
) |
| |
|
inline |
predicts a ranking from a learnt ranker
- Parameters
-
fit | the final ranking fitted by the ranker |
x_test | points to be ranked, one per column of the matrix |
x_train | the initial training set, possibly used by kernel computation |
covinv | the inverse sqrt covariance of the points in the training set, if available and needed, encode() function. |
training | set mean distribution if available along with covariance matrix, and needed, see encode() function |
- See also
- encode
◆ train()
template<class TKernel = RBFKernel>
void RankingSVM< TKernel >::train |
( |
dMat & |
x, |
|
|
const int & |
niter, |
|
|
const dMat & |
covinv, |
|
|
const dVec & |
xmean |
|
) |
| |
|
inline |
trains a ranker from a set of points
- Parameters
-
x | matrix in which every column represents a point from the training set |
covinv | the inverse sqrt covariance of the points in the training set, if available and needed, encode() function. |
training | set mean distribution if available along with covariance matrix, and needed, see encode() function |
- See also
- encode
◆ _alpha
template<class TKernel = RBFKernel>
vector of Ranking SVM parameters over ranking constraints.
◆ _C
template<class TKernel = RBFKernel>
constraint violation weights.
◆ _Cval
template<class TKernel = RBFKernel>
constraing violation base weight value.
◆ _encode
template<class TKernel = RBFKernel>
whether to use encoding from inverse sqrt covariance matrix of points.
◆ _K
template<class TKernel = RBFKernel>
pre-computed matrix of kernel values for a given training set.
◆ _kernel
template<class TKernel = RBFKernel>
The documentation for this class was generated from the following file: