Distribution (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.search.similarities, class: Distribution

Package org.apache.lucene.search.similarities

# Class Distribution

java.lang.Object
org.apache.lucene.search.similarities.Distribution

Direct Known Subclasses:
  `DistributionLL`, `DistributionSPL`

public abstract class Distribution extends Object
The probabilistic distribution used to model term occurrence in information-based models.

See Also:
  - `IBSimilarity`
WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Distribution()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Explanation`
  `explain(BasicStats stats, double tfn, double lambda)`
  Explains the score.
  `abstract double`
  `score(BasicStats stats, double tfn, double lambda)`
  Computes the score.
  `abstract String`
  `toString()`
  Subclasses must override this method to return the name of the distribution.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Distribution

    public Distribution()
    Sole constructor. (For invocation by subclass constructors, typically implicit.)

- ## Method Details

  - ### score

    public abstract double score(BasicStats stats, double tfn, double lambda)
    Computes the score.

  - ### explain

    public Explanation explain(BasicStats stats, double tfn, double lambda)
    Explains the score. Returns the name of the model only, since both `tfn` and `lambda` are explained elsewhere.

  - ### toString

    public abstract String toString()
    Subclasses must override this method to return the name of the distribution.
    Overrides:
      `toString` in class `Object`