|
Algorithm 3 Gene purging algorithm |
| Require: |
-
1:
functionpurgeParetoFront
-
2:
newFront = ← Dict.empty ▹ Empty dictionary representing new Pareto Front
-
3:
for item in front do
-
4:
if |item| == 1 then
-
5:
continue ▹ Items with only one feature cannot be reduced
-
6:
end if
-
7:
baseResult ← item.result ▹ Score acquired by using all features from item
-
8:
scoreDecrease ← [] ▹ Score decrease for each feature
-
9:
for geneInd in item.genes WHERE ISSET(item.genes[geneInd]) do ▹ Check only set genes
-
10:
newScore ← evalF(item.model, item.genes, geneInd)
▹ Evaluate existing trained model on test data set, where values of feature geneInd are randomly shuffled
-
11:
scoreDecrease[geneInd] ← baseResult - newScore
-
12:
end for
-
13:
bestInd ← argmin(scoreDecrease)
▹ Take the gene which showed smallest score decrease when shuffled
-
14:
newItem ← Item(genes=unsetBit(item.genes, bestInd))
▹ Create new item where the gene with the smallest score decrease is unset
-
15:
newFront[|newItem|] ← Evaluate(newItem, evalF)
▹ Evaluate newly created item (train and test model)
-
16:
end for
-
17:
front ← front ∪ newFront ▹ Update current front with newly calculated items
-
18:
front ←removeDominated(front) ▹ Remove unoptimal items from Pareto front
-
19:
return front
-
20:
end function
|