Adding CP miners

To add a contrast pattern miner, you must create a class that implements IEmergingPatternMiner. The class must be in the following package:

PRFramework.Core.SupervisedClassifiers.EmergingPatterns.Miners 

Parameters

To see a parameter of the algorithm in the GUI, it needs a get and set method following Java Beans style.

In order to edit the parameter, you need to annotate the get method with @OptionMetadata.

The documentation of the annotation is located here. The only required elements are the parameter display name for the GUI and the description.

It is important to set the commandLineParamIsFlag element to true if the parameter type is boolean; otherwise, you will not be able to edit the parameter.

Non primitive type parameters

If one of the parameters of the algorithm is not a Java primitive type, the possible parameter values must correspond to classes that implement the same interface. For example, DecisionTreeBuilder and MultivariateDecisionTreeBuilder both implement  IDecisionTreeBuilder.

You also need to edit two files located in the resources directory. In GenericPropertiesCreator.props, you must add an entry specifying the interface and the package of packages where the classes implementing the interface are located: 

[interface]=package1,package2, ...

Since both classes implementing IDecisionTreeBuilder are located in the package, we add the following entry:

PRFramework.Core.SupervisedClassifiers.DecisionTrees.Builder.IDecisionTreeBuilder=\PRFramework.Core.SupervisedClassifiers.DecisionTrees.Builder

The second file to edit is GUIEditors.props, where you need to add one entry per interface:

[interface]=weka.gui.GenericObjectEditor

For the IDecisionTreeBuilder we add the following entry:

PRFramework.Core.SupervisedClassifiers.DecisionTrees.Builder.IDecisionTreeBuilder=weka.gui.GenericObjectEditor

Hiding parameters

If there is a get method for a property that should not be modified through the Weka GUI, you can use the annotate the get method with @ProgrammaticProperty.

Notes

If you need additional behavior, such as a parameter accepting an array of values, you could check Weka´s documentation

However, some functionality is not described in the manual, so you should check how an existing package, such as AffectiveTweets.

For example, the usage of @OptionMetadata is not described in the manual, but it is described in the Weka blog and you can find it used in the AffectiveTweets package.