-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain_SR_plot_occd.py
31 lines (25 loc) · 1017 Bytes
/
main_SR_plot_occd.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
import matplotlib.pyplot as plt
import numpy as np
from load_data import get_data
from Codes import k_cross_validation
import os
DATA_NAME = "concentric_circle_noise"
traindata, trainlabel, testdata, testlabel = get_data(DATA_NAME)
FOLD_NO = 5
INITIAL_NEURAL_ACTIVITY = [0.23]
DISCRIMINATION_THRESHOLD = [0.97]
EPSILON = np.arange(0.001, 1.001, 0.001)
FSCORE, Q, B, EPS, EPSILON = k_cross_validation(FOLD_NO, traindata, trainlabel, testdata, testlabel, INITIAL_NEURAL_ACTIVITY, DISCRIMINATION_THRESHOLD, EPSILON, DATA_NAME)
PATH = os.getcwd()
RESULT_PATH = PATH + '/SR-PLOTS/' + DATA_NAME + '/NEUROCHAOS-RESULTS/'
plt.figure(figsize=(10,10))
plt.plot(EPSILON,FSCORE[0,0,:],'-*k', markersize = 10)
plt.xticks(fontsize=20)
plt.yticks(fontsize=20)
plt.grid(True)
plt.xlabel('Noise intensity', fontsize=20)
plt.ylabel('Average F1-score', fontsize=20)
plt.ylim(0, 1)
plt.tight_layout()
plt.savefig(RESULT_PATH+"/Chaosnet-"+DATA_NAME+"-SR_plot.jpg", format='jpg', dpi=200)
plt.show()