shark::JaakkolaHeuristic Class Reference

Jaakkola's heuristic and related quantities for Gaussian kernel selection. More...

#include <shark/Algorithms/JaakkolaHeuristic.h>

Public Member Functions

template<class InputType >
 JaakkolaHeuristic (LabeledData< InputType, unsigned int > const &dataset, bool nearestFalseNeighbor=true)
 
double sigma (double quantile=0.5)
 
double gamma (double quantile=0.5)
 

Detailed Description

Jaakkola's heuristic and related quantities for Gaussian kernel selection.

Jaakkola's heuristic method for setting the width parameter of the Gaussian radial basis function kernel is to pick a quantile (usually the median) of the distribution of Euclidean distances between points having different labels. The present implementation computes the kernel width \( \sigma \) and the bandwidth

\[ \gamma = \frac{1}{2 \sigma^2} \]

based on the median or on any other quantile of the empirical distribution.

By default, only the distance to the closest point with different label is considered. This behavior can be turned off by an option of the constructor. This is faster andin accordance with the original paper.

Definition at line 65 of file JaakkolaHeuristic.h.

Constructor & Destructor Documentation

◆ JaakkolaHeuristic()

template<class InputType >
shark::JaakkolaHeuristic::JaakkolaHeuristic ( LabeledData< InputType, unsigned int > const &  dataset,
bool  nearestFalseNeighbor = true 
)
inline

Constructor

Parameters
datasetvector-valued input data
nearestFalseNeighborif true, only the nearest neighboring point with different label is considered (default true)

Definition at line 72 of file JaakkolaHeuristic.h.

References shark::LabeledData< InputT, LabelT >::elements().

Member Function Documentation

◆ gamma()

double shark::JaakkolaHeuristic::gamma ( double  quantile = 0.5)
inline

Compute the given quantile (usually the median) of the empirical distribution of Euclidean distances of data pairs with different labels converted into a value usable as the gamma parameter of the GaussianRbfKernel.

Definition at line 186 of file JaakkolaHeuristic.h.

References sigma().

Referenced by main().

◆ sigma()

double shark::JaakkolaHeuristic::sigma ( double  quantile = 0.5)
inline

Compute the given quantile (usually median) of the empirical distribution of Euclidean distances of data pairs with different labels.

Definition at line 155 of file JaakkolaHeuristic.h.

References SHARK_ASSERT.

Referenced by gamma().


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