Interface ClassificationScheme.Classifier

Enclosing class:
ClassificationScheme

public static interface ClassificationScheme.Classifier
Resolves the class of a query record from a set of neighbors.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addValue(ClassificationScheme.Distance distance, double value)
    Specifies a new neighbor value and the distance to that neighbor.
    double
    Gets the classification to assign based on the specified neighbors.
    void
    Initialize the state of the classifier.
  • Method Details

    • initialize

      void initialize()
      Initialize the state of the classifier. Called once for each query record.
    • addValue

      void addValue(ClassificationScheme.Distance distance, double value)
      Specifies a new neighbor value and the distance to that neighbor.

      Called once per neighbor for each query record. Neighbors will be provided in order of increasing distance. That is, the first value is always of the nearest neighbor.

      Parameters:
      distance - the distance to the neighbor
      value - the neighbor's classification
    • getClassification

      double getClassification()
      Gets the classification to assign based on the specified neighbors. Called once for each query record.
      Returns:
      the resulting classification