Developers: adding a new preference learning algorithm - TAPeri/pl-toolbox GitHub Wiki
When adding a new algorithm to the tool, you should create a dedicated package under plt.plalgorithm
. Within this package, you should include at least three classes:
- Extend
plt.algorithm.Model
: this abstract class provides the basic routines to use a preference learning model. When creating a new model, you will have to define a method to calculate the outputs of the model (calculatePreference
), a method to save the model in a file (save
) and a method to copy the model (clone
). is used to query the outputs of a preference model and save it to a file - Extend
plt.algorithm.PLAlgorithm
: this abstract class provides basic access to set up and run a training algorithm. When creating a new algorithm, you will have to define a method to test the correctness of the parameters selected by the user (testParameters
), a method to initialise the training procedure (beforeRun
), a method to run the training process (run
) and a method to obtain a textual description of the algorithm parameters (getProperties
). - Implement
plt.gui.algorithms.GUIconfigurator
: this interface defines the connection between the GUI and the preference learning algorithm. When creating a new algorithm, you will have to define a method that creates the necessary GUI elements to set up all parameters of the algorithm (ui
) and a method that initialises the algorithm using the parameters given through the GUI (algorithm
).
In addition to those three classes, you will have to modify the class plt.gui.algorithms.SupportedAlgorithms
: this class contains the label given to the algorithms on the GUI and connects it to the relevant extension of the class plt.gui.algorithms.GUIconfigurator
.