Skip to content

Commit

Permalink
Add counts by library (#16)
Browse files Browse the repository at this point in the history
This is for Table 1 in the paper.
  • Loading branch information
hainest committed Nov 7, 2022
1 parent e35a6c6 commit 61845b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions library_counts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3

import sqlite3

con = sqlite3.connect("results.sqlite3")
cur = con.cursor()

def counts(table, fnc):
filter = "original<>changed" if fnc else "original=changed"
cur.execute(
f"""
select a,b, count(distinct original) from {table} where {filter} group by a,b
"""
)
return cur.fetchall()


print("Number of libraries by predictor and filename cases")
print("-" * 70)
for t in ("two_predictors", "three_predictors"):
for fnc in (True, False):
print("{0:s} {1:s}changed".format(t, "" if fnc else "un"))
for r in counts(t,fnc):
print(" ", r)

0 comments on commit 61845b9

Please sign in to comment.