Class: Ai4r::Clusterers::Clusterer

Inherits:
Object
  • Object
show all
Includes:
Data::Parameterizable
Defined in:
lib/ai4r/clusterers/clusterer.rb

Overview

The purpose of this class is to define a common API for Clusterers. All methods in this class (other than eval) must be implemented in subclasses.

Direct Known Subclasses

Diana, KMeans, SingleLinkage

Instance Method Summary collapse

Methods included from Data::Parameterizable

#get_parameters, included, #set_parameters

Instance Method Details

#build(data_set, number_of_clusters) ⇒ Object

Build a new clusterer, using data examples found in data_set. Data items will be clustered in “number_of_clusters” different clusters.

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/ai4r/clusterers/clusterer.rb', line 25

def build(data_set, number_of_clusters)
  raise NotImplementedError
end

#eval(data_item) ⇒ Object

Classifies the given data item, returning the cluster it belongs to.

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/ai4r/clusterers/clusterer.rb', line 30

def eval(data_item)
  raise NotImplementedError
end