org.apache.ignite.ml.knn.ann

## Class KNNModelFormat

- java.lang.Object
- - org.apache.ignite.ml.knn.ann.KNNModelFormat

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    ANNModelFormat

      public class KNNModelFormat
      extends Object
      implements Serializable

  kNN model representation.
  See Also:
    `KNNClassificationModel`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DistanceMeasure` | `distanceMeasure` Distance measure.
    `protected int` | `k` Amount of nearest neighbors.
    `protected boolean` | `weighted` Weighted or not.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KNNModelFormat()`
    `KNNModelFormat(int k, DistanceMeasure measure, boolean weighted)` Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `DistanceMeasure` | `getDistanceMeasure()` Gets distance measure.
    `int` | `getK()` Gets amount of nearest neighbors.
    `int` | `hashCode()`
    `boolean` | `isWeighted()` Weighted or not.

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### k

          protected int k

      Amount of nearest neighbors.

    - #### distanceMeasure

          protected DistanceMeasure distanceMeasure

      Distance measure.

    - #### weighted

          protected boolean weighted

      Weighted or not.

  - ### Constructor Detail

    - #### KNNModelFormat

          public KNNModelFormat()

    - #### KNNModelFormat

          public KNNModelFormat(int k,
                                DistanceMeasure measure,
                                boolean weighted)

      Creates an instance.
      Parameters:
        `k` - Amount of nearest neighbors.
        `measure` - Distance measure.
        `weighted` - Weighted or not.

  - ### Method Detail

    - #### getK

          public int getK()

      Gets amount of nearest neighbors.

    - #### getDistanceMeasure

          public DistanceMeasure getDistanceMeasure()

      Gets distance measure.

    - #### isWeighted

          public boolean isWeighted()

      Weighted or not.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021