ELKI: Injecting Custom ResultHandler

I need to implement a custom one ResultHandler

, but I'm confused as to how to actually integrate my custom class into a software package.

I read the following: http://elki.dbs.ifi.lmu.de/wiki/HowTo/InvokingELKIFromJava , but my question is, how are you going to implement a custom result handler so that it appears in the GUI?

The only way I can do this is to extract the elki.jar package and manually insert my custom class into the source, then re-zip the package. However, I am pretty sure this is not how it should be done.

Also, in my resulthandler, I need to output all lines into one text file with a cluster that belongs to each line. How tips on how I can achieve this?

+3


source to share


1 answer


There are two questions here.

  • to make your class instance using user interfaces (both MiniGUI and command line), the classes must implement our Parameterization API. There are two ways to make your class available:

    • Add constructor public

      with no parameters (UI won't know how to set your parameters!)
    • Add an inner static class Parameterizer

      one that handles parameterization
  • to add your class to autocompletion (dropdown menu), the classes must be exposed with MiniGUI / CLI / other interface. ELKI uses two detection methods:

    • for .jar

      files, it reads service files META-INF/elki/interfacename

      . This is the classic approach to a service loader; except that we also allow instances of the order.
    • for directories only, ELKI also scans all files .class

      and checks them. This is mainly intended for design time to avoid having to constantly update service files. For performance reasons, we do not check the contents of the files .jar

      ; they are expected to use service files.


You don't need your class to be in the dropdown - you can always enter the fully qualified class name. If that doesn't work, adding the name to the service file won't help either, but ELKI may either not find the class at all or can't create it.

There is also a tutorial on how to implement a custom result handler , but it doesn't discuss how to add one to a menu. In "development mode" - if there is a folder with files .class

- it will be displayed automatically.

+1


source







All Articles