-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrapher.py
More file actions
40 lines (31 loc) · 673 Bytes
/
Grapher.py
File metadata and controls
40 lines (31 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import numpy as np
import matplotlib.pyplot as plt
sizes = np.array([1,3,6,10,15,21,28,36,45,55,66,78])
counts = np.array([
1747909344,
1531822,
1845065935,
806772,
672096,
812867,
62521,
9415,
6,
9380,
4,
1
], dtype=np.int64)
# CCDF calculation
ccdf = np.cumsum(counts[::-1])[::-1]
for s, c in zip(sizes, ccdf):
print(f"Size ≥ {s}: {c} features")
plt.figure()
plt.scatter(sizes, ccdf)
plt.plot(sizes, ccdf)
plt.xscale("log")
plt.yscale("log")
plt.xlabel("Feature Size")
plt.ylabel("Number of Features ≥ Size")
plt.title("Complementary Cumulative Distribution (CCDF)")
plt.grid(True, which="both")
plt.show()