mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
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:
@@ -47,10 +47,25 @@ public final class CardArchetypeLDAGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ldaPools.put(format, formatMap);
|
ldaPools.put(format, formatMap);
|
||||||
ldaArchetypes.put(format, lda);
|
ldaArchetypes.put(format, pruneArchetypes(lda));
|
||||||
return true;
|
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{
|
public static Map<String,List<List<Pair<String, Double>>>> loadFormat(List<Archetype> lda) throws Exception{
|
||||||
|
|
||||||
List<List<Pair<String, Double>>> topics = new ArrayList<>();
|
List<List<Pair<String, Double>>> topics = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user