Interface DecayFunction


public interface DecayFunction
Implement this interface to provide a decay function that is executed on a distance. For example, this could be an exponential drop of, a triangle function or something of the kind. This is used, for example, by GaussDecayFunctionBuilder.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    evaluate(double value, double scale)
     
    org.apache.lucene.search.Explanation
    explainFunction(String valueString, double value, double scale)
     
    double
    processScale(double scale, double decay)
    The final scale parameter is computed from the scale parameter given by the user and a value.
  • Method Details

    • evaluate

      double evaluate(double value, double scale)
    • explainFunction

      org.apache.lucene.search.Explanation explainFunction(String valueString, double value, double scale)
    • processScale

      double processScale(double scale, double decay)
      The final scale parameter is computed from the scale parameter given by the user and a value. This value is the value that the decay function should compute if document distance and user defined scale equal. The scale parameter for the function must be adjusted accordingly in this function
      Parameters:
      scale - the raw scale value given by the user
      decay - the value which decay function should take once the distance reaches this scale