I have a following problem - I have a rule engine (drools) that evaluates risk score of transactions.If risk is too high (>200) then it is marked as unsafe. Each rule has their weight (1-100) that is assigned to risk score if rule gets executed.
I wanted to have a tool for optimizing the weights. And so I thought of genetic algorithm.
1. I would send batch of test transactions (with additional parameter that tells how they should be marked -> as unsafe or not) to engine to let it evaluate them
2. I would check how many rules were fired (it would determine number of chromosomes in genotype) and let's say if 5 was fired then...
3....I would create first population consisting of 500 genotypes, each having 5 chromosomes (and chromosome having gene with value ranging 1-100)
4. I would repeat step one for all genotypes in population
5. I would check what percent of transactions was marked correctly by using additional parameter I mentioned earlier.
6. I would assign to each genotype fitness function based on percentage of how many transactions were evaluated correctly
7. Repeating the cycle for number of generations until solution is reached (100% transactions are marked correctly) with crossovers, mutations etc.
It is my first time trying to do anything with genetic algorithms, so first thing I would like to clarify is
my understanding of how genotype/chromosome/gene works. In different sites they sometimes use the terms as substitutes of one another and it can be confsuing. I was learning terminology basing on jenetics library cause I was thinking to use it for implementation.
I later realized that I did not take into account one thing - I may evolve values of weights of rules but the weight is not the only thing important - it is also important to which rule the weight will be assigned! but I have no idea where I should put that additional information as to which rule the weight refers to.. somewehre in chromosome? That is the biggest issue for me, I just cannot see where to fit it in equation.