Class CosineSimilarityStrategy

All Implemented Interfaces:
SimilarityStrategy, Serializable

public class CosineSimilarityStrategy
extends Object
implements SimilarityStrategy
A class that compute the similarity between pattern using cosine similarity.
See Also:
Serialized Form
  • Constructor Details

    • CosineSimilarityStrategy

      public CosineSimilarityStrategy()
  • Method Details

    • similarity

      public double similarity​(Vector v0, Vector v1)
      Description copied from interface: SimilarityStrategy
      Returns the similarity value between two vectors.
      Specified by:
      similarity in interface SimilarityStrategy
      v0 - the first vector.
      v1 - the second vector.
      the similarity between vectors.