Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
type Vector[T comparable] struct { // contains filtered or unexported fields }
Vector represents a sparse vector.
func (*Vector[T]) CosineSimilarity ¶
CosineSimilarity calculates the cosine similarity between two vectors. It returns an error if either vector has zero magnitude.
type Vectorizer ¶
type Vectorizer[T comparable] struct { // contains filtered or unexported fields }
Vectorizer is a structure that manages dimensions for vectors.
func New ¶
func New[T comparable](size int) *Vectorizer[T]
New creates a new Vectorizer with an initial size.
func (*Vectorizer[T]) ApplyTo ¶
func (vz *Vectorizer[T]) ApplyTo(v *Vector[T], key T, value float64)
ApplyTo applies a value to the vector at the specified key.
 Click to show internal directories. 
   Click to hide internal directories.