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

Package org.apache.lucene.search.similarities

# Class Independence

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

Direct Known Subclasses:
  `IndependenceChiSquared`, `IndependenceSaturated`, `IndependenceStandardized`

public abstract class Independence extends Object
Computes the measure of divergence from independence for DFI scoring functions.

See http://trec.nist.gov/pubs/trec21/papers/irra.web.nb.pdf for more information on different methods.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Independence()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract double`
  `score(double freq, double expected)`
  Computes distance from independence
  `abstract String`
  `toString()`

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

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

- ## Constructor Details

  - ### Independence

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

- ## Method Details

  - ### score

    public abstract double score(double freq, double expected)
    Computes distance from independence
    Parameters:
      `freq` - actual term frequency
      `expected` - expected term frequency

  - ### toString

    public abstract String toString()
    Overrides:
      `toString` in class `Object`