From 61f644a6a7d36dc5c15d957c48d10675ab3627ae Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Fri, 30 Oct 2015 17:16:32 -0400 Subject: [hw3] --- hw3/plot.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 hw3/plot.py (limited to 'hw3/plot.py') diff --git a/hw3/plot.py b/hw3/plot.py new file mode 100644 index 0000000..9797985 --- /dev/null +++ b/hw3/plot.py @@ -0,0 +1,18 @@ +import matplotlib.pyplot as plt +import seaborn as sb +from math import sqrt + +sb.set_style("white") + +values = [map(float, line.strip().split()) for line in open("results.txt")] +x, y, z = zip(*values) +y = map(sqrt, y) +z = map(sqrt, z) + +plt.figure(figsize=(9, 6)) +plt.plot(x, y, label="train") +plt.plot(x, z, label="validation") +plt.legend() +plt.xlabel("K") +plt.ylabel("RMSE") +plt.savefig("rmse.pdf") -- cgit v1.2.3-70-g09d2