Using ELKI on Custom Objects and Presenting Results
I am trying to use ELKI SLINK implementation of hierarchical clustering in my program.
I have a set of objects (my own type) that need to be clustered. To do this, I convert them to object vectors before clustering.
This is how I currently got it to run and get some output (the 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 Clustering
, which contains elements of type Model
. I can deduce them, but I don't know how to understand this result, especially since it SLINK
returns type models DendrogramModel
that don't seem to be parameterizable.
Specifically, how can I bind the results to my original elements (the ones from which I created the variable featureVectors
earlier)?
My guess is that I need to create some kind of custom model or somehow maintain some kind of reference to the original elements through initialization and running an algorithm to extract from the result. I can't seem to find where to start though.
I know that including ELKI in your own programs is not recommended. However, it looks like calling ELKI in some other way would be no different: I need to copy and map the results to my objects while my program is running.
source to share