From 29b449a9e3f71e957213938324da301225382760 Mon Sep 17 00:00:00 2001 From: Simon Let Date: Tue, 10 Sep 2019 02:49:13 +0200 Subject: [PATCH] minor tweeks because I hate sleep and because I hate future myself --- evaluate/resh-evaluate-plot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/evaluate/resh-evaluate-plot.py b/evaluate/resh-evaluate-plot.py index 8999e0b..9197906 100755 --- a/evaluate/resh-evaluate-plot.py +++ b/evaluate/resh-evaluate-plot.py @@ -23,19 +23,22 @@ for record in data["Records"]: cmd_count[record["firstWord"]] += 1 cmdLine_count[record["cmdLine"]] += 1 +cmdTmp = sorted(cmd_count.items(), key=lambda x: x[1], reverse=True)[:50] +cmdFrq = list(map(lambda x: x[1] / cmdTmp[0][1], cmdTmp)) -cmdFrq = list(map(lambda x: x[1] / len(data["Records"]), sorted(cmd_count.items(), key=lambda x: x[1], reverse=True))) -cmdLineFrq = list(map(lambda x: x[1] / len(data["Records"]), sorted(cmdLine_count.items(), key=lambda x: x[1], reverse=True))) +cmdLineTmp = sorted(cmdLine_count.items(), key=lambda x: x[1], reverse=True)[:50] +cmdLineFrq = list(map(lambda x: x[1] / cmdLineTmp[0][1], cmdLineTmp)) print(cmdFrq) print("#################") #print(cmdLineFrq_rank) -plt.plot(range(1, len(cmdFrq)+1), cmdFrq) +plt.plot(range(1, len(cmdFrq)+1), cmdFrq, 'o-') plt.title("Command frequency") +plt.yticks() #plt.xticks(range(1, len(cmdFrq)+1)) plt.show() -plt.plot(range(1, len(cmdLineFrq)+1), cmdLineFrq) +plt.plot(range(1, len(cmdLineFrq)+1), cmdLineFrq, 'o-') plt.title("Commandline frequency") plt.show() \ No newline at end of file