Package org.apache.lucene.search.similarities

## Class BasicModel

- java.lang.Object
- - org.apache.lucene.search.similarities.BasicModel

- Direct Known Subclasses:
    `BasicModelG`, `BasicModelIF`, `BasicModelIn`, `BasicModelIne`

      public abstract class BasicModel
      extends Object

  This class acts as the base class for the specific basic model implementations in the DFR framework. Basic models compute the informative content Inf1 = -log2Prob1 .
  See Also:
    `DFRSimilarity`
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BasicModel()` | Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract Explanation` | `explain​(BasicStats stats, double tfn, double aeTimes1pTfn)` | Returns an explanation for the score.
    `abstract double` | `score​(BasicStats stats, double tfn, double aeTimes1pTfn)` | Returns the informative content score combined with the after effect, more specifically `informationContentScore * aeTimes1pTfn / (1 + tfn)`.
    `abstract String` | `toString()` | Subclasses must override this method to return the code of the basic model formula.

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

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

- - ### Constructor Detail

    - #### BasicModel

          public BasicModel()

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

  - ### Method Detail

    - #### score

          public abstract double score​(BasicStats stats,
                                       double tfn,
                                       double aeTimes1pTfn)

      Returns the informative content score combined with the after effect, more specifically `informationContentScore * aeTimes1pTfn / (1 + tfn)`. This function must be non-decreasing with `tfn`.

    - #### explain

          public abstract Explanation explain​(BasicStats stats,
                                              double tfn,
                                              double aeTimes1pTfn)

      Returns an explanation for the score. Subclasses must override this method.

    - #### toString

          public abstract String toString()

      Subclasses must override this method to return the code of the basic model formula. Refer to the original paper for the list.
      Overrides:
        `toString` in class `Object`