NlpTools API
Interface

NlpTools\Clustering\MergeStrategies\MergeStrategyInterface

interface MergeStrategyInterface

In hierarchical agglomerative clustering each document starts in its own cluster and then it is subsequently merged with the "closest" cluster.

The MergeStrategy defines how a new distance for the merged cluster is
going to be calculated based on the distances of the individual clusters.

Methods

initializeStrategy(DistanceInterface $d, array $docs)

Study the docs and preprocess anything required for computing the merges

array getNextMerge()

Return the next two clusters for merging and assume they are merged (ex.

Details

at line 19
public initializeStrategy(DistanceInterface $d, array $docs)

Study the docs and preprocess anything required for computing the merges

Parameters

DistanceInterface $d
array $docs

at line 27
public array getNextMerge()

Return the next two clusters for merging and assume they are merged (ex.

update a similarity matrix)

Return Value

array An array with two numbers which are the cluster ids