notan3xit
notan3xit

Reputation: 2436

Using ELKI on custom objects and making sense of results

I am trying to use ELKI's SLINK implementation of hierarchical clustering in my program.

I have a set of objects (of my own type) that need to be clustered. For that, I convert them to feature vectors before clustering.

This is how I currently got it to run and produce some result (code is in Scala):

val clusterer = new SLINK(CosineDistanceFunction.STATIC, 3)
val connection = new ArrayAdapterDatabaseConnection(featureVectors)
val database = new StaticArrayDatabase(connection, null)
database.initialize()

val result = clusterer.run(database).asInstanceOf[Clustering[_ <: Model]]

Now, the result is a Clustering that contains elements of type Model. I can output them, but I don't know how to make sense of this result, especially since SLINK returns models of type DendrogramModel which does not seem to be parametrizable.

Specifically, how can I link the results back to my original elements (the ones from which I created the variable featureVectors earlier)?

I assume I need to create some kind of custom model or somehow maintain some link to the original elements through initialization and execution of the algorithm to retrieve from the result. I cannot find where to get started on this though.

I am aware that embedding ELKI into own programs is discouraged. However, it seems that calling ELKI in some other way would not be any different: I need to cluster and map the results back to my objects during runtime of my program.

Upvotes: 1

Views: 507

Answers (1)

Erich Schubert
Erich Schubert

Reputation: 8715

The DendrogramModel does not include the objects in the cluster. Models are additional meta data on the clusters.

Use the getIDs() method to access the members of a Cluster instance.

Upvotes: 2

Related Questions