Plot
This commit is contained in:
parent
7c428075a4
commit
5189f40f7e
@ -12,7 +12,6 @@ train = pd.read_csv('train.csv')
|
||||
test = pd.read_csv('test.csv')
|
||||
validate = pd.read_csv('validate.csv')
|
||||
|
||||
# # podział train set
|
||||
X_train = train.loc[:, train.columns != 'suicides_no']
|
||||
y_train = train[['suicides_no']]
|
||||
X_test = test.loc[:, train.columns != 'suicides_no']
|
||||
@ -36,3 +35,20 @@ error = mean_squared_error(y_test, predictions)
|
||||
|
||||
with open('results.txt', 'a') as f:
|
||||
f.write(str(error) + "\n")
|
||||
|
||||
with open('results.txt', 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
fig = plt.figure(figsize=(10, 5))
|
||||
chart = fig.add_subplot()
|
||||
|
||||
chart.set_ylabel("Mean Squared Error")
|
||||
chart.set_xlabel("Build number")
|
||||
|
||||
x = np.arange(0, len(lines), 1)
|
||||
|
||||
y = [float(val) for val in lines]
|
||||
|
||||
plt.plot(x, y, "bo")
|
||||
|
||||
plt.savefig("plot.png")
|
||||
|
Loading…
Reference in New Issue
Block a user