chore: des prints partout
This commit is contained in:
parent
7c1e115951
commit
3a50f1d83d
1 changed files with 12 additions and 4 deletions
16
Probas.py
16
Probas.py
|
@ -71,6 +71,7 @@ def stats_NFBP_iter(R, N):
|
|||
HSumVariance = [0 for _ in range(N)]
|
||||
# number of items in the i-th bin
|
||||
Sum_T = [0 for _ in range(N)]
|
||||
TSumVariance = [0 for _ in range(N)]
|
||||
# size of the first item in the i-th bin
|
||||
Sum_V = [0 for _ in range(N)]
|
||||
|
||||
|
@ -88,9 +89,16 @@ def stats_NFBP_iter(R, N):
|
|||
T.append(0)
|
||||
V.append(0)
|
||||
Sum_T = [x + y for x, y in zip(Sum_T, T)]
|
||||
TSumVariance = [x + y**2 for x, y in zip(TSumVariance, T)]
|
||||
Sum_V = [x + y for x, y in zip(Sum_V, V)]
|
||||
|
||||
Sum_T = [x / R for x in Sum_T]
|
||||
print(min(Sum_T[0:20]))
|
||||
print(mean(Sum_T[0:35]))
|
||||
print(Sum_T[0])
|
||||
TVariance = sqrt(TSumVariance[0] / (R - 1) - Sum_T[0]**2) # Variance
|
||||
print(TVariance)
|
||||
|
||||
Sum_V = [round(x / R, 2) for x in Sum_V]
|
||||
# print(Sum_V)
|
||||
I = ISum / R
|
||||
|
@ -125,7 +133,7 @@ def stats_NFBP_iter(R, N):
|
|||
color="red",
|
||||
)
|
||||
ax.set(
|
||||
xlim=(0, N), xticks=np.arange(0, N), ylim=(0, 3), yticks=np.linspace(0, 3, 5)
|
||||
xlim=(0, N), xticks=np.arange(0, N,N/10), ylim=(0, 3), yticks=np.linspace(0, 3, 4)
|
||||
)
|
||||
ax.set_ylabel("Items")
|
||||
ax.set_xlabel("Bins (1-{})".format(N))
|
||||
|
@ -143,7 +151,7 @@ def stats_NFBP_iter(R, N):
|
|||
color="orange",
|
||||
)
|
||||
bx.set(
|
||||
xlim=(0, N), xticks=np.arange(0, N), ylim=(0, 1), yticks=np.linspace(0, 1, 10)
|
||||
xlim=(0, N), xticks=np.arange(0, N,N/10), ylim=(0, 1), yticks=np.linspace(0, 1, 10)
|
||||
)
|
||||
bx.set_ylabel("First item size")
|
||||
bx.set_xlabel("Bins (1-{})".format(N))
|
||||
|
@ -162,7 +170,7 @@ def stats_NFBP_iter(R, N):
|
|||
color="green",
|
||||
)
|
||||
cx.set(
|
||||
xlim=(0, N), xticks=np.arange(0, N), ylim=(0, 10), yticks=np.linspace(0, N, 5)
|
||||
xlim=(0, N), xticks=np.arange(0, N,N/10), ylim=(0, 10), yticks=np.linspace(0, N, 5)
|
||||
)
|
||||
cx.set_ylabel("Bin ranking of n-item")
|
||||
cx.set_xlabel("n-item (1-{})".format(N))
|
||||
|
@ -367,7 +375,7 @@ def basic_demo():
|
|||
)
|
||||
|
||||
|
||||
stats_NFBP_iter(10**3, 10)
|
||||
stats_NFBP_iter(2 *10**0, 50)
|
||||
print("\n\n")
|
||||
stats_NFDBP(10**3, 10, 1)
|
||||
|
||||
|
|
Loading…
Reference in a new issue