Skip to content

Structure of classes in LAC

bugfoo edited this page Nov 20, 2019 · 3 revisions

LAC is formed by a couple packages, where each one has its own responsibility. Next figure shows the class diagram for LAC.

Class diagram for LAC

  • lac.algorithms includes the base classes for all the algorithms, and one package for each algorithm. Each algorithm is contained in one package with the same name as the algorithm. For example, considering the CBA algorithm, the name of the package must be lac.algorithms.cba. It also contains three important classes: 1) Rule used to represent each obtained rule; 2) Classifier, is the parent class representing a classifier, it contains logic for both to save the set of rules and to predict unseen examples by means of the previous rules, and each algorithm should implement it; 3) Algorithm, is the parent class representing an algorithm, each algorithm should implement it and it contains the logic to transform from a training dataset to a set of rules.

  • lac.data includes several classes to represent the data, and one class for each format of input file. ArrfDataset enables to run LAC on Arff format, DatDataset contains the logic for the KEEL format, and in the same way CsvDataset contains the logic for the CSV format. Attribute contains some basic logic to work with the attributes contained into the dataset, for instance to determine the type or the possible values. Finally, Dataset is the base class from which inherits each type of dataset.

  • lac.metrics includes all the metrics to quantify the quality of the solutions. The following measures are supported: accuracy, cohen's kappa, recall, precision, f-measure, number of rules and average number of attributes per rule. ConfusionMatrix implements an efficient confusion matrix to calculate all the aforementioned measures.

  • lac.reports provides reports to show different results of the algorithms. MetricsReport calculates all the possible metric supported by LAC. KlassReport shows both the predicted and real class in training and test phases. Finally, ClassifierReport enables to obtain all the rules forming the final classifier.

  • lac.runner provides a framework to automate and parallelize the experimental studies. YamlConfig contains the logic to read configuration files in YML format. ConfigExecution is used to represent each configured execution. Runner runs each ConfigExecution in a parallel or sequential way.

  • lac.utils includes some extra and useful methods to work with rule sets.

Clone this wiki locally