-
The WOWA operator (Torra) is a powerfull aggregation operator that allows to combine multiple input values into a single score. This is particulary interesting for detection and ranking systems that rely on multiple heuristics. The system can use WOWA to produce a single meaningfull score.
A Java implementation of WOWA is available at https://github.com/tdebatty/java-aggregation.
The WOWA operator requires two sets of parameters: p weights and w weights. In this project we use a genetic algorithm to compute the best values for p and w weights. For the training, the algorithm uses a dataset of input vectors together with the expected aggregated score of each vector.
This project is a Java implementation of the PHP wowa-training project.
Using maven :
<dependency> <groupId>be.cylab</groupId> <artifactId>java-wowa-training</artifactId> <version>0.0.3</version> </dependency>
https://mvnrepository.com/artifact/be.cylab/java-wowa-training
public static void main(String[] args) { Logger logger = Logger.getLogger(Trainer.class.getName()); logger.setLevel(Level.INFO); int population_size = 100; int crossover_rate = 60; int mutation_rate = 10; int max_generation = 110; int selection_method = TrainerParameters.SELECTION_METHOD_RWS; int generation_population_method = TrainerParameters.POPULATION_INITIALIZATION_RANDOM; TrainerParameters parameters = new TrainerParameters(logger, population_size, crossover_rate, mutation_rate, max_generation, selection_method, generation_population_method); Trainer trainer = new Trainer(parameters); //Input data List<double[]> data = new ArrayList<double[]>(); data.add(new double[] {0.1, 0.2, 0.3, 0.4}); data.add(new double[] {0.1, 0.8, 0.3, 0.4}); data.add(new double[] {0.2, 0.6, 0.3, 0.4}); data.add(new double[] {0.1, 0.2, 0.5, 0.8}); data.add(new double[] {0.5, 0.1, 0.2, 0.3}); data.add(new double[] {0.1, 0.1, 0.1, 0.1}); //Expected aggregated value for each data vector double[] expected = new double[] {0.1, 0.2, 0.3, 0.4, 0.5, 0.6}; SolutionDistance solution = trainer.run(data, expected); //Display solution System.out.println(solution); }
The example above will produce something like:
SolutionDistance{ weights_w=[0.1403303611048977, 0.416828569516884, 0.12511121306189063, 0.1872211165629538, 0.1305087298401635], weights_p=[0.0123494228072248, 0.10583088288437666, 0.5459452827654444, 0.17470250892324257, 0.1611718492107217], distance=8.114097675242476}
The run method returns a solution object, consisting of p weights and w weights to use with the WOWA operator, plus the total distance between the expected aggregated values that are given as parameter, and the aggregated values computed by WOWA using these weights.
- population_size : size of the population in the algorithm. Suggested value : 100
- crossover_rate : defines the percentage of population generated by crossover. Must be between 1 and 100. Suggested value : 60
- mutation_rate : define the probability of random element change in the population. Must be between 1 and 100. Suggested value : 15
- selection_method : Determine the method used to select element in the population (for generate the next generation). SELECTION_METHOD_RWS for Roulette Wheel Selection and SELECTION_METHOD_TOS for Tournament Selection.
- max_generation : Determine the maximum number of iteration of the algorithm.
- generation_population_method: Determine the method used to generate the initial population. POPULATION_INITIALIZATION_RANDOM for a full random initialization and POPULATION_INITIALIZATION_QUASI_RANDOM for a population with specific elements.

Tibo
authored
Name | Last commit | Last update |
---|---|---|
ressources | ||
src | ||
.gitignore | ||
.gitlab-ci.yml | ||
LICENSE | ||
README.md | ||
checkstyle.xml | ||
java-wowa-training.iml | ||
pom.xml |