Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.65 KB

custom_classifier.md

File metadata and controls

29 lines (20 loc) · 1.65 KB

Adding a Custom Segment Classifier

The PSM allows to use other classifiers besides the quartile-based and median-proportional. That can be done by injecting a jar file with the custom classifier inplementation into Java classpath.

Guide

  1. Create a new Java or Scala project
  2. Add the PSM jar as a dependency
  3. Implement your own classifier by extending org.processmining.scala.log.common.enhancment.segments.common.AbstractDurationClassifier
  4. Build a jar file
  5. Add the jar file to the PSM class path
  6. Run the PSM
  7. Provide the fully qualified class name of your custom classifier in the pre-processing dialog

Example (for Java)

  1. Extend your class with AbstractDurationClassifier: public class SegmentClassifierExample extends AbstractDurationClassifier
  2. Define a constructor as follows: public SegmentClassifierExample(final String path). path is a full path to the event log file or file description, or an empty string in case of running in ProM mode.
  3. Implement method classify, which provides segment attributes and segment descriptove statistics as arguments
  4. Implement legend to return a legend with the classifier name and class names separated by %, e.g. "Example%Class_0%Class_1"
  5. Specify class number in classCount
  6. If required show a UI dialog in method initialize to configure classifier parameters.

A working example can be found here: org.processmining.scala.viewers.spectrum.view.SegmentClassifierExample.

Custom classifier