<jupyter_start><jupyter_text>Difference in Average Quality<jupyter_code>Algorithms = ["HASBRAIN", 'KLUDCP', 'TRDA']

cmap = plt.get_cmap('copper')

data = {}
for alg in Algorithms:
    temp = df[df['Used_Algorithm'].str.contains(alg)]
    data[alg] = list(map(operator.sub, temp['sim_avg_quality'], temp['opt_avg_quality']))
f = plt.figure(figsize=(9, 6))
ax = f.add_subplot(111)
    
colors = iter(cmap(np.linspace(0,1,len(Algorithms))))
    
for alg in Algorithms:

    temp = data[alg]
    ecdf = ECDF(temp)
    x = np.linspace(min(temp), max(temp))
    y = ecdf(x)
    ax.step(ecdf.x, ecdf.y, label=alg, color=next(colors))

ax.axhline(0.5, alpha=0.3, color="r")
ax.set_xlabel(r"Difference in Average Quality")
ax.set_ylabel("CDF")
ax.grid(True)

ax.set_xlim((-1.3735454123000004, 1.0957099542999997))
ax.set_ylim([0, 1])

plt.annotate(s='HASBRAIN', xy=(0.23,0.92), xytext=(0,0.7), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='TRDA', xy=(-0.41,0.84), xytext=(-1.3,0.85), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='KLUDCP', xy=(-0.15,0.25), xytext=(0.2,0.25), arrowprops=dict(arrowstyle='->'))

for alg in Algorithms:
    ecdf = ECDF(data[alg])
    print("%s: More than 0s avg. quality level: %.2f." % (alg, ecdf.y[np.argmax(ecdf.x > 0.0)]))
    print("-> Maximum increase: %.1f" % ecdf.x[-1])
    print("-> Maximum decrease: %.1f" % ecdf.x[1])<jupyter_output>HASBRAIN: More than 0s avg. quality level: 0.87.
-> Maximum increase: 1.0
-> Maximum decrease: -1.3
KLUDCP: More than 0s avg. quality level: 1.00.
-> Maximum increase: 0.0
-> Maximum decrease: -0.4
TRDA: More than 0s avg. quality level: 0.00.
-> Maximum increase: -0.0
-> Maximum decrease: -1.0<jupyter_text>Difference in Switching Frequency<jupyter_code>f = plt.figure(figsize=(9, 6))
ax = f.add_subplot(111)

colors = iter(cmap(np.linspace(0,1,len(Algorithms))))

data = {}
for alg in Algorithms:
    temp = df[df['Used_Algorithm'].str.contains(alg)]

    quality_switching_freq_sim = temp['sim_nr_of_switches']/((temp['sim_total_stalling_time']+temp['video_length'])/60)
    quality_switching_freq_op = temp['opt_nr_of_switches']/(temp['video_length']/60)

    data[alg] = list(map(operator.sub, quality_switching_freq_sim, quality_switching_freq_op))

for alg in Algorithms:

    temp = data[alg]
    ecdf = ECDF(temp)
    x = np.linspace(min(temp), max(temp))
    y = ecdf(x)
    ax.step(ecdf.x, ecdf.y, label=alg, color=next(colors))

ax.set_xlim(-2.4241893076248902, 22.564417177914109)
ax.axhline(0.5, alpha=0.3, color="r")
ax.set_xlabel(r"Diff. in Switching Freq. [$m^{-1}$]")
ax.set_ylabel("CDF")

ax.set_ylim([0, 1])
ax.grid(True)

plt.annotate(s='HASBRAIN', xy=(0.3,0.9), xytext=(4,0.9), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='TRDA', xy=(1.6,0.7), xytext=(5,0.7), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='KLUDCP', xy=(14,0.4), xytext=(2,0.25), arrowprops=dict(arrowstyle='->'))

for alg in Algorithms:
    ecdf = ECDF(data[alg])
    print("%s: More than 0 m^-1 switching frequency: %.2f." % (alg, ecdf.y[np.argmax(ecdf.x > 0.0)]))
    print("-> Maximum increase: %.1f" % ecdf.x[-1])
    print("-> Maximum decrease: %.1f" % ecdf.x[1])<jupyter_output>HASBRAIN: More than 0 m^-1 switching frequency: 0.89.
-> Maximum increase: 0.3
-> Maximum decrease: -1.3
KLUDCP: More than 0 m^-1 switching frequency: 0.00.
-> Maximum increase: 21.4
-> Maximum decrease: 0.1
TRDA: More than 0 m^-1 switching frequency: 0.11.
-> Maximum increase: 3.5
-> Maximum decrease: -0.7<jupyter_text>Stalling Frequency<jupyter_code>f = plt.figure(figsize=(9, 6))
ax = f.add_subplot(111)

colors = iter(cmap(np.linspace(0,1,len(Algorithms))))

data = {}
for alg in Algorithms:
    temp = df[df['Used_Algorithm'].str.contains(alg)]
    data[alg] = temp['sim_nr_of_stallings']/((temp['sim_total_stalling_time']+temp['video_length'])/60)

for alg in Algorithms:

    temp = data[alg]

    ecdf = ECDF(temp)
    x = np.linspace(min(temp), max(temp))
    y = ecdf(x)
    ax.step(ecdf.x, ecdf.y, label=alg, color=next(colors))

ax.axhline(0.5, alpha=0.3, color="r")
ax.set_xlabel(r"Stalling Frequency [$m^{-1}$]")
ax.set_ylabel("CDF")

ax.set_xlim(-0.072575660009438783, 1.5240888601982143)
ax.set_ylim([0, 1])
ax.grid(True)

plt.annotate(s='HASBRAIN', xy=(0.8,0.9), xytext=(0.8,0.7), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='KLUDCP', xy=(0.05,0.25), xytext=(0.2,0.15), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='TRDA', xy=(0.1,0.95), xytext=(0.25,0.7), arrowprops=dict(arrowstyle='->'))

ecdf = ECDF(data["HASBRAIN"])
for v in [0.0, 0.5, 1]:
    print("HASBRAIN: Stalling more than %.1f: %.2f." % (v, ecdf.y[np.argmax(ecdf.x > v)]))<jupyter_output>HASBRAIN: Stalling more than 0.0: 0.73.
HASBRAIN: Stalling more than 0.5: 0.92.
HASBRAIN: Stalling more than 1.0: 0.95.<jupyter_text>Stalling Ratio<jupyter_code>f = plt.figure(figsize=(9, 6))
ax = f.add_subplot(111)

colors = iter(cmap(np.linspace(0,1,len(Algorithms))))

for alg in Algorithms:

    if alg == 'HASBRAIN':
        temp = df[df['Used_Algorithm'].str.contains("HASBRAIN")]
    elif alg == 'KLUDCP':
        temp = df[df['Used_Algorithm'].str.contains("KLUDCP")]
    elif alg == 'TRDA':
        temp = df[df['Used_Algorithm'].str.contains("TRDA")]

    temp = (temp['sim_total_stalling_time']+temp['video_length'])/temp['video_length']
    ecdf = ECDF(temp)
    x = np.linspace(min(temp), max(temp))
    y = ecdf(x)
    ax.step(ecdf.x, ecdf.y, label=alg, color=next(colors))

ax.axhline(0.5, alpha=0.3, color="r")
ax.set_xlabel(r"Stalling Ratio ($\frac{Session\ Duration}{Video\ Duration}$)")
ax.set_ylabel("CDF")

ax.set_xlim(0.96165177117768597, 1.8053128052685952)
ax.set_ylim([0, 1])
ax.grid(True)

plt.annotate(s='HASBRAIN', xy=(1.4,0.95), xytext=(1.4,0.7), arrowprops=dict(arrowstyle='->'))
plt.annotate(s='KLUDCP / TRDA', xy=(1,0.3), xytext=(1.1,0.25), arrowprops=dict(arrowstyle='->'))
#plt.annotate(s='TRDA', xy=(0.2,37), xytext=(0.1,18), arrowprops=dict(arrowstyle='->'))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20771812080536914, 'fraction_numerical': 0.06661073825503355, 'mean_word_length': 5.003021148036254, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '642109', 'license': 'MIT', 'n_tokens_mistral': 2774, 'n_tokens_neox': 2565, 'n_words': 429, 'path': 'datasets/results.ipynb', 'repo_name': 'csieber/hasbrain', 'size': '5960'}