Prune archetypes that are less than 0.1% of meta as these are largely not real decks, but shared characteristics of multiple decks or unique decks not suitable for random generation.

This commit is contained in:
austinio7116
2018-06-11 08:41:51 +01:00
committed by maustin
parent 54f5af72f2
commit 6d24ddc8e6

View File

@@ -47,10 +47,25 @@ public final class CardArchetypeLDAGenerator {
}
}
ldaPools.put(format, formatMap);
ldaArchetypes.put(format, lda);
ldaArchetypes.put(format, pruneArchetypes(lda));
return true;
}
public static List<Archetype> pruneArchetypes(List<Archetype> archetypes){
List<Archetype> pruned = new ArrayList<>();
float deckCount=0;
for(Archetype archetype : archetypes){
deckCount = deckCount + archetype.getDeckCount();
}
for(Archetype archetype : archetypes){
float metaPercent = archetype.getDeckCount().floatValue()/deckCount;
if( metaPercent > 0.001 ){
pruned.add(archetype);
}
}
return pruned;
}
public static Map<String,List<List<Pair<String, Double>>>> loadFormat(List<Archetype> lda) throws Exception{
List<List<Pair<String, Double>>> topics = new ArrayList<>();