-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotting.py
More file actions
32 lines (27 loc) · 1.03 KB
/
Copy pathplotting.py
File metadata and controls
32 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pandas as pd
import matplotlib.pyplot as plt
import os
class Plot:
def data_box_plot(self, data, col1, col2):
# Group the data based on the first column (status)
status_data = data.groupby(col1)
return status_data.boxplot(column=col2)
def data_density_plot(self, data, col1, col2):
# Group the data and use the data from col2 of each group
data.groupby(col1)[col2].plot(kind='density', legend=True)
def nn_acc_plot(self, acc):
plt.figure()
plt.plot(acc)
plt.ylabel('Accuracy')
plt.xlabel('Epoch')
plt.savefig(os.path.join('images', 'epoch_acc.png'))
plt.close()
def tree_count_plot(self, trees, train_accuracy, test_accuracy):
plt.figure()
plt.plot(trees, train_accuracy, label='Training')
plt.plot(trees, test_accuracy, label='Testing')
plt.ylabel('Accuracy')
plt.xlabel('Num of Trees')
plt.legend()
plt.savefig(os.path.join('images', 'tree_accuracy.png'))
plt.close()