OETverskySim¶
class OETverskySim : public OEGraphSim::OESimFuncBase
This class represents OETverskySim
that
calculates the Tversky
similarity score.
Formula:
\(Sim_{Tversky}(A,B) = \frac{bothAB}{\alpha * onlyA + \beta * onlyB + bothAB}\)
The following methods are publicly inherited from OESimFuncBase
:
Constructors¶
OETverskySim(float a=0.95f)
Default constructor (\(\alpha = 0.95\), \(\beta = 1.0 - \alpha = 0.05\))
OETverskySim(float a, float b)
Constructor with arbitrary \(\alpha\) and \(\beta\) parameters.
operator()¶
float operator()(const OEGraphSim::OEFingerPrint &fpA,
const OEGraphSim::OEFingerPrint &fpB) const
Returns the Tversky
similarity coefficient of the two given
OEFingerPrint
objects.
CreateCopy¶
OEGraphSim::OESimFuncBase *CreateCopy() const
Deep copy constructor that returns a copy of the object. The memory
for the returned OETverskySim
object is
dynamically allocated and owned by the caller.
GetAlpha¶
float GetAlpha() const
Returns the \(\alpha\) parameter of the
Tversky
similarity
calculation.
GetBeta¶
float GetBeta() const
Returns the \(\beta\) parameter of the
Tversky
similarity
calculation.
GetSimTypeString¶
std::string GetSimTypeString() const
Returns a string representation of the
OETverskySim
class.