Gaia
|
This class computes a distance that is the linear combination of any number of other DistanceFunctions. More...
#include <linearcombinationdistance.h>
Public Member Functions | |
LinearCombinationDistance (const PointLayout &layout, const ParameterMap ¶ms) | |
void | addDistance (DistanceFunction *f, Real coeff) |
Real | operator() (const Point &p1, const Point &p2, int seg1, int seg2) const |
This function computes the distance between the two given points. More... | |
Public Member Functions inherited from gaia2::DistanceFunction | |
DistanceFunction (const PointLayout &layout, const ParameterMap ¶ms) | |
const PointLayout & | layout () const |
const Region & | checkFixedLength (const Region ®ion) const |
Checks that the given Region only contains fixed-length descriptors and throws an exception if not. More... | |
Protected Attributes | |
QVector< QPair< DistanceFunction *, Real > > | _weights |
Protected Attributes inherited from gaia2::DistanceFunction | |
PointLayout | _layout |
ParameterMap | _params |
Region | _region |
Additional Inherited Members | |
Public Attributes inherited from gaia2::DistanceFunction | |
QString | name |
Name for the metric, usually the key that was used to instantiate it from the factory. | |
QStringList | validParams |
List of valid parameters this analyzer accepts. More... | |
This class computes a distance that is the linear combination of any number of other DistanceFunctions.
For instance, in a recommender system, a set of weights could be seen as a user profile, each user having its own preferences regarding which distance is more useful to him.
parameterMap | the parameterMap passed as argument should contain mapping from a name to a map containing the following fields: "distance", "params" and "weight". |
distance | the name of the metric to create. |
params | the ParameterMap to be used when creating the specified metric. |
weight | the weight to be assigned to this metric in the linear combination. |
|
virtual |
This function computes the distance between the two given points.
It needs to be implemented in each subclass. It takes as optional arguments the number of the segments on which to operate.
Implements gaia2::DistanceFunction.