-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_additional_data.py
56 lines (41 loc) · 2.15 KB
/
plot_additional_data.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
This is the plotting file for the larger binary classification data.
Author: Harikrishnan N B
Email: harikrishnannb07@gmail.com
"""
import numpy as np
import os
import matplotlib.pyplot as plt
## PLOTING
DATA_NAME = "larger_binary_class"
PATH = os.getcwd()
RESULT_PATH = PATH + '/NEUROCHAOS-LTS-RESULTS/' + DATA_NAME + '/LTS/'
FSCORE_NEUROCHAOS = np.load(RESULT_PATH+"/fscore_neurochaos.npy" )
STD_FSCORE_NEUROCHAOS = np.load(RESULT_PATH+"/std_fscore_neurochaos.npy")
FSCORE_SVM = np.load(RESULT_PATH+"/fscore_svm.npy" )
STD_FSCORE_SVM = np.load(RESULT_PATH+"/std_fscore_svm.npy")
SAMPLES_PER_CLASS = np.load(RESULT_PATH+"/samples_per_class.npy")
# Plotting F1-score vs. Samples per class
plt.figure(figsize=(15,10))
plt.plot(SAMPLES_PER_CLASS ,FSCORE_NEUROCHAOS[:,0], linewidth = 2.0, linestyle='solid', color ='r', marker='s',ms=10, label="Neurochaos-SVM")
plt.plot(SAMPLES_PER_CLASS ,FSCORE_SVM[:,0], linewidth = 2.0, linestyle='--', color ='k', marker='o', ms=10, label="SVM (linear)")
plt.xticks(SAMPLES_PER_CLASS,fontsize=22)
plt.yticks(fontsize=22)
plt.grid(True)
plt.xlabel('Number of training samples per class', fontsize=22)
plt.ylabel('Average F1-score', fontsize=22)
plt.legend(loc="upper right", fontsize=22)
plt.savefig(RESULT_PATH+ "/F1_low_training_sample_regime_larger_binary_classification.jpg", format='jpg', dpi=300)
plt.show()
# Plotting Standard deviation of F1-score vs. smaples per class
plt.figure(figsize=(15,10))
plt.plot(SAMPLES_PER_CLASS ,STD_FSCORE_NEUROCHAOS[:,0], linewidth = 2.0, linestyle='solid', color ='r', marker='s',ms=10, label="Neurochaos-SVM")
plt.plot(SAMPLES_PER_CLASS ,STD_FSCORE_SVM[:,0], linewidth = 2.0, linestyle='--', color ='k', marker='o', ms=10, label="SVM (linear)")
plt.xticks(SAMPLES_PER_CLASS,fontsize=22)
plt.yticks(fontsize=22)
plt.grid(True)
plt.xlabel('Number of training samples per class', fontsize=22)
plt.ylabel('Standard deviation of F1-scores', fontsize=22)
plt.legend(loc="upper right", fontsize=22)
plt.savefig(RESULT_PATH+ "/standard_deviation_low_training_sample_regime_larger_binary_classification.jpg", format='jpg', dpi=300)
plt.show()