Skip to content

Commit

Permalink
compute stability
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Apr 5, 2024
1 parent f095d58 commit 43dd9c9
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fun main() {
// MAX_UNIQUE = 1_000
TIMEOUT_MS = 30_000
MIN_TOKENS = 3
MAX_TOKENS = 50
MAX_RADIUS = 2
MAX_TOKENS = 80
// MAX_RADIUS = 2
CFG_THRESH = 10_000
evaluateBarHillelRepairOnStackOverflow()
// evaluateSeq2ParseRepair()
Expand Down Expand Up @@ -208,10 +208,8 @@ fun evaluateBarHillelRepairOnStackOverflow() {
levBlanket = updateLevenshteinBlanket(levBlanket, it.tokenizeByWhitespace())
}

val totalHoles = levBlanket.count { it == "_" }.toDouble() / toRepair.size
val normalizer = levDist.toDouble() / toRepair.size
val mutabilityStatistic = (100 * totalHoles / normalizer).roundToInt()
editLocationsByLenAndDist.getOrPut(lenBucket to levDist) { S2PMetrics() }.top1 += mutabilityStatistic
val stability = ((levBlanket.count { it != "_" }.toDouble() / toRepair.size) * 100).roundToInt()
editLocationsByLenAndDist.getOrPut(lenBucket to levDist) { S2PMetrics() }.top1 += stability
println("Mutability profile\n=============")
println(editLocationsByLenAndDist.summarizeLenAndDist())
}
Expand Down

0 comments on commit 43dd9c9

Please sign in to comment.