|
Algorithm 2 Randomized crossover with information gain weighting |
|
Require:
|
-
1:
function crossooverPair
-
2:
if |item1| < |item2| then
-
3:
swap(item1, item2)
-
4:
end if
-
5:
intermediate ← item & item2 ▹ Intersection of genes
-
6:
rest ← item1 ⊕ item2 ▹ Bitwise XOR, features present in exactly one item
-
7:
addNum ← onGeneScaling(abs(|item1| - |item2|))
-
8:
▹ Scale the number of new features according to provided function
-
9:
additional ← rSelect(addNum, informationEntropy, rest)
-
10:
▹ Randomly select addNum features, weighted by precalculated entropy
-
11:
mated ← intermediate | additional ▹ Add selected features
-
12:
return mated
-
13:
end function
|