import matplotlib.pyplot as plt
import numpy as np

methods = {
    'LINEAR': [0.8926654740608229, 0.889087656529517, 0.9051878354203936, 0.8855098389982111, 0.8982142857142857],
    'POLY': [0.9409660107334525, 0.9373881932021467, 0.9338103756708408, 0.9123434704830053, 0.9160714285714285],
    'RBF': [0.8389982110912343, 0.8121645796064401, 0.8425760286225402, 0.8193202146690519, 0.8178571428571428]
}
gammas_time = sorted({
    0.05: [0.8604651162790697, 0.8336314847942755, 0.8622540250447227, 0.8354203935599285, 0.8357142857142857],
    0.1: [0.9069767441860465, 0.8926654740608229, 0.9159212880143113, 0.889087656529517, 0.8928571428571429],
    0.15: [0.924865831842576, 0.9266547406082289, 0.9338103756708408, 0.9123434704830053, 0.9053571428571429],
    0.2: [0.9230769230769231, 0.9338103756708408, 0.9409660107334525, 0.9177101967799642, 0.9089285714285714],
    0.25: [0.9266547406082289, 0.9284436493738819, 0.9391771019677997, 0.9105545617173524, 0.9160714285714285],
    0.3: [0.9230769230769231, 0.9338103756708408, 0.9338103756708408, 0.8998211091234347, 0.9142857142857143],
    0.35: [0.9159212880143113, 0.9302325581395349, 0.9320214669051878, 0.8962432915921288, 0.9089285714285714],
    0.40: [0.9033989266547406, 0.9159212880143113, 0.9302325581395349, 0.8926654740608229, 0.9053571428571429],
    0.45: [0.889087656529517, 0.9033989266547406, 0.9069767441860465, 0.8711985688729875, 0.8964285714285715],
    0.50: [0.8568872987477638, 0.8819320214669052, 0.8801431127012522, 0.8407871198568873, 0.8910714285714286],
    # 0.55: [0.8211091234347049, 0.8443649373881932, 0.8586762075134168, 0.815742397137746, 0.8660714285714286],
    # 0.6: [0.7978533094812165, 0.8085867620751341, 0.8211091234347049, 0.7710196779964222, 0.8410714285714286],
    # 0.65: [0.7656529516994633, 0.7853309481216458, 0.7799642218246869, 0.7441860465116279, 0.8142857142857143],
    # 0.7: [0.7459749552772809, 0.7459749552772809, 0.7567084078711985, 0.7191413237924866, 0.7839285714285714],
    # 0.75: [0.7084078711985689, 0.7084078711985689, 0.7155635062611807, 0.6923076923076923, 0.7553571428571428],
    # 0.80: [0.6654740608228981, 0.6762075134168157, 0.6851520572450805, 0.6493738819320215, 0.7053571428571429],
}.items(), key=lambda x: x[0])

gammas_time_fft = sorted({
    0.1: [0.9230769230769231, 0.924865831842576, 0.9230769230769231, 0.9123434704830053, 0.9089285714285714],
    0.15: [0.9302325581395349, 0.9409660107334525, 0.9373881932021467, 0.9284436493738819, 0.9232142857142858],
    0.2: [0.9338103756708408, 0.9463327370304114, 0.9427549194991055, 0.9266547406082289, 0.925],
    0.25: [0.9284436493738819, 0.9463327370304114, 0.9445438282647585, 0.9159212880143113, 0.9232142857142858],
    0.3: [0.9141323792486583, 0.9320214669051878, 0.9338103756708408, 0.9016100178890877, 0.9267857142857143],
    0.35: [0.8944543828264758, 0.9266547406082289, 0.9069767441860465, 0.8729874776386404, 0.9178571428571428],
    0.4: [0.8676207513416816, 0.8926654740608229, 0.8676207513416816, 0.8300536672629696, 0.8964285714285715],
    0.45: [0.8300536672629696, 0.851520572450805, 0.8372093023255814, 0.7889087656529516, 0.8785714285714286],
    0.5: [0.7853309481216458, 0.813953488372093, 0.7889087656529516, 0.7620751341681574, 0.8446428571428571],
    0.55: [0.7495527728085868, 0.7584973166368515, 0.7584973166368515, 0.7209302325581395, 0.8],
    0.6: [0.6994633273703041, 0.7048300536672629, 0.7101967799642218, 0.6797853309481217, 0.7375],
    # 0.1: [0.8855098389982111, 0.8640429338103757, 0.8837209302325582, 0.8604651162790697, 0.8642857142857143],
    # 0.15: [0.9069767441860465, 0.9087656529516994, 0.9177101967799642, 0.8980322003577818, 0.8928571428571429],
    # 0.2: [0.9141323792486583, 0.9302325581395349, 0.9338103756708408, 0.9159212880143113, 0.9089285714285714],
    # 0.25: [0.9230769230769231, 0.9338103756708408, 0.9427549194991055, 0.9212880143112702, 0.9160714285714285],
    # 0.30: [0.924865831842576, 0.9409660107334525, 0.9427549194991055, 0.9212880143112702, 0.9232142857142858],
    # 0.35: [0.924865831842576, 0.9409660107334525, 0.9445438282647585, 0.9212880143112702, 0.9214285714285714],
    # 0.4: [0.924865831842576, 0.9427549194991055, 0.9445438282647585, 0.9123434704830053, 0.9196428571428571],
    # 0.45: [0.9266547406082289, 0.9427549194991055, 0.9409660107334525, 0.9069767441860465, 0.9178571428571428],
    # 0.5: [0.9177101967799642, 0.9391771019677997, 0.9427549194991055, 0.9033989266547406, 0.9160714285714285],
    # 0.55: [0.9105545617173524, 0.9391771019677997, 0.9373881932021467, 0.8998211091234347, 0.9214285714285714],
    # 0.6: [0.9016100178890877, 0.9302325581395349, 0.9320214669051878, 0.8926654740608229, 0.9232142857142858],
}.items(), key=lambda x: x[0])

gammas_fft = sorted({  # scaling coefficient=12.0
    0.3: [0.8998211091234347, 0.889087656529517, 0.889087656529517, 0.8676207513416816, 0.8803571428571428],
    0.35: [0.9016100178890877, 0.9087656529516994, 0.8998211091234347, 0.8801431127012522, 0.8892857142857142],
    0.4: [0.9105545617173524, 0.9123434704830053, 0.9069767441860465, 0.8837209302325582, 0.9],
    0.45: [0.9123434704830053, 0.9141323792486583, 0.9087656529516994, 0.8855098389982111, 0.9035714285714286],
    0.5: [0.9141323792486583, 0.9177101967799642, 0.9087656529516994, 0.8908765652951699, 0.9089285714285714],
    0.55: [0.9123434704830053, 0.9177101967799642, 0.9105545617173524, 0.889087656529517, 0.9125],
    0.6: [0.9105545617173524, 0.9159212880143113, 0.9105545617173524, 0.8837209302325582, 0.9125],
    0.65: [0.9069767441860465, 0.9105545617173524, 0.9033989266547406, 0.8729874776386404, 0.9107142857142857],
    0.7: [0.8998211091234347, 0.9051878354203936, 0.8908765652951699, 0.8694096601073346, 0.9053571428571429],
    0.75: [0.8908765652951699, 0.8908765652951699, 0.8819320214669052, 0.8586762075134168, 0.8964285714285715],
    0.8: [0.8819320214669052, 0.8747763864042933, 0.8694096601073346, 0.851520572450805, 0.8946428571428572],
}.items(), key=lambda x: x[0])

i = 0
types = []
color = ['black', 'darkorange', 'darkgreen', 'royalblue', 'blueviolet']
means = []
for i, (_, value) in enumerate(methods.items()):
    for k, v in enumerate(value):
        t = plt.scatter(i, v, color=color[k])
        if i == 0: types.append(t)
    means.append(np.mean(value))
plt.plot(np.arange(len(methods)), means, marker='s', color='firebrick')
plt.xticks(np.arange(len(methods)), methods.keys())
plt.xlabel("Kernel Methods")
plt.ylabel("Evaluation Accuracy")
plt.title("Evaluation Accuracy of SVM models with Different Kernel Methods")
plt.legend(types, [f"Fold_{j}" for j in range(5)], loc="lower left")
plt.show()

plt.plot(np.linspace(0.05, 0.50, 10), [np.mean(v) for k, v in gammas_time], marker='s', label="Time Features")
plt.plot(np.linspace(0.3, 0.8, 11), [np.mean(v) for k, v in gammas_fft], marker='d', label="Frequency Features")
plt.plot(np.linspace(0.1, 0.6, 11), [np.mean(v) for k, v in gammas_time_fft], marker='o', label="Time Features + Frequency Features")
plt.xticks(np.linspace(0.05, 0.80, 16))
plt.yticks(np.linspace(0.7, 1.0, 13))
plt.grid()
plt.legend(loc="lower right")
plt.xlabel("Gamma values")
plt.ylabel("Evaluation Accuracy")
plt.title("Evaluation Accuracy of SVM models with Different Gamma Values")
plt.show()

613cd5550bca12670e10550731b98b34e025918e
<mask token>

<mask token>
for i, (_, value) in enumerate(methods.items()):
    for k, v in enumerate(value):
        t = plt.scatter(i, v, color=color[k])
        if i == 0:
            types.append(t)
    means.append(np.mean(value))
plt.plot(np.arange(len(methods)), means, marker='s', color='firebrick')
plt.xticks(np.arange(len(methods)), methods.keys())
plt.xlabel('Kernel Methods')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Kernel Methods')
plt.legend(types, [f'Fold_{j}' for j in range(5)], loc='lower left')
plt.show()
plt.plot(np.linspace(0.05, 0.5, 10), [np.mean(v) for k, v in gammas_time],
    marker='s', label='Time Features')
plt.plot(np.linspace(0.3, 0.8, 11), [np.mean(v) for k, v in gammas_fft],
    marker='d', label='Frequency Features')
plt.plot(np.linspace(0.1, 0.6, 11), [np.mean(v) for k, v in gammas_time_fft
    ], marker='o', label='Time Features + Frequency Features')
plt.xticks(np.linspace(0.05, 0.8, 16))
plt.yticks(np.linspace(0.7, 1.0, 13))
plt.grid()
plt.legend(loc='lower right')
plt.xlabel('Gamma values')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Gamma Values')
plt.show()

<mask token>
methods = {'LINEAR': [0.8926654740608229, 0.889087656529517, 
    0.9051878354203936, 0.8855098389982111, 0.8982142857142857], 'POLY': [
    0.9409660107334525, 0.9373881932021467, 0.9338103756708408, 
    0.9123434704830053, 0.9160714285714285], 'RBF': [0.8389982110912343, 
    0.8121645796064401, 0.8425760286225402, 0.8193202146690519, 
    0.8178571428571428]}
gammas_time = sorted({(0.05): [0.8604651162790697, 0.8336314847942755, 
    0.8622540250447227, 0.8354203935599285, 0.8357142857142857], (0.1): [
    0.9069767441860465, 0.8926654740608229, 0.9159212880143113, 
    0.889087656529517, 0.8928571428571429], (0.15): [0.924865831842576, 
    0.9266547406082289, 0.9338103756708408, 0.9123434704830053, 
    0.9053571428571429], (0.2): [0.9230769230769231, 0.9338103756708408, 
    0.9409660107334525, 0.9177101967799642, 0.9089285714285714], (0.25): [
    0.9266547406082289, 0.9284436493738819, 0.9391771019677997, 
    0.9105545617173524, 0.9160714285714285], (0.3): [0.9230769230769231, 
    0.9338103756708408, 0.9338103756708408, 0.8998211091234347, 
    0.9142857142857143], (0.35): [0.9159212880143113, 0.9302325581395349, 
    0.9320214669051878, 0.8962432915921288, 0.9089285714285714], (0.4): [
    0.9033989266547406, 0.9159212880143113, 0.9302325581395349, 
    0.8926654740608229, 0.9053571428571429], (0.45): [0.889087656529517, 
    0.9033989266547406, 0.9069767441860465, 0.8711985688729875, 
    0.8964285714285715], (0.5): [0.8568872987477638, 0.8819320214669052, 
    0.8801431127012522, 0.8407871198568873, 0.8910714285714286]}.items(),
    key=lambda x: x[0])
gammas_time_fft = sorted({(0.1): [0.9230769230769231, 0.924865831842576, 
    0.9230769230769231, 0.9123434704830053, 0.9089285714285714], (0.15): [
    0.9302325581395349, 0.9409660107334525, 0.9373881932021467, 
    0.9284436493738819, 0.9232142857142858], (0.2): [0.9338103756708408, 
    0.9463327370304114, 0.9427549194991055, 0.9266547406082289, 0.925], (
    0.25): [0.9284436493738819, 0.9463327370304114, 0.9445438282647585, 
    0.9159212880143113, 0.9232142857142858], (0.3): [0.9141323792486583, 
    0.9320214669051878, 0.9338103756708408, 0.9016100178890877, 
    0.9267857142857143], (0.35): [0.8944543828264758, 0.9266547406082289, 
    0.9069767441860465, 0.8729874776386404, 0.9178571428571428], (0.4): [
    0.8676207513416816, 0.8926654740608229, 0.8676207513416816, 
    0.8300536672629696, 0.8964285714285715], (0.45): [0.8300536672629696, 
    0.851520572450805, 0.8372093023255814, 0.7889087656529516, 
    0.8785714285714286], (0.5): [0.7853309481216458, 0.813953488372093, 
    0.7889087656529516, 0.7620751341681574, 0.8446428571428571], (0.55): [
    0.7495527728085868, 0.7584973166368515, 0.7584973166368515, 
    0.7209302325581395, 0.8], (0.6): [0.6994633273703041, 
    0.7048300536672629, 0.7101967799642218, 0.6797853309481217, 0.7375]}.
    items(), key=lambda x: x[0])
gammas_fft = sorted({(0.3): [0.8998211091234347, 0.889087656529517, 
    0.889087656529517, 0.8676207513416816, 0.8803571428571428], (0.35): [
    0.9016100178890877, 0.9087656529516994, 0.8998211091234347, 
    0.8801431127012522, 0.8892857142857142], (0.4): [0.9105545617173524, 
    0.9123434704830053, 0.9069767441860465, 0.8837209302325582, 0.9], (0.45
    ): [0.9123434704830053, 0.9141323792486583, 0.9087656529516994, 
    0.8855098389982111, 0.9035714285714286], (0.5): [0.9141323792486583, 
    0.9177101967799642, 0.9087656529516994, 0.8908765652951699, 
    0.9089285714285714], (0.55): [0.9123434704830053, 0.9177101967799642, 
    0.9105545617173524, 0.889087656529517, 0.9125], (0.6): [
    0.9105545617173524, 0.9159212880143113, 0.9105545617173524, 
    0.8837209302325582, 0.9125], (0.65): [0.9069767441860465, 
    0.9105545617173524, 0.9033989266547406, 0.8729874776386404, 
    0.9107142857142857], (0.7): [0.8998211091234347, 0.9051878354203936, 
    0.8908765652951699, 0.8694096601073346, 0.9053571428571429], (0.75): [
    0.8908765652951699, 0.8908765652951699, 0.8819320214669052, 
    0.8586762075134168, 0.8964285714285715], (0.8): [0.8819320214669052, 
    0.8747763864042933, 0.8694096601073346, 0.851520572450805, 
    0.8946428571428572]}.items(), key=lambda x: x[0])
i = 0
types = []
color = ['black', 'darkorange', 'darkgreen', 'royalblue', 'blueviolet']
means = []
for i, (_, value) in enumerate(methods.items()):
    for k, v in enumerate(value):
        t = plt.scatter(i, v, color=color[k])
        if i == 0:
            types.append(t)
    means.append(np.mean(value))
plt.plot(np.arange(len(methods)), means, marker='s', color='firebrick')
plt.xticks(np.arange(len(methods)), methods.keys())
plt.xlabel('Kernel Methods')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Kernel Methods')
plt.legend(types, [f'Fold_{j}' for j in range(5)], loc='lower left')
plt.show()
plt.plot(np.linspace(0.05, 0.5, 10), [np.mean(v) for k, v in gammas_time],
    marker='s', label='Time Features')
plt.plot(np.linspace(0.3, 0.8, 11), [np.mean(v) for k, v in gammas_fft],
    marker='d', label='Frequency Features')
plt.plot(np.linspace(0.1, 0.6, 11), [np.mean(v) for k, v in gammas_time_fft
    ], marker='o', label='Time Features + Frequency Features')
plt.xticks(np.linspace(0.05, 0.8, 16))
plt.yticks(np.linspace(0.7, 1.0, 13))
plt.grid()
plt.legend(loc='lower right')
plt.xlabel('Gamma values')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Gamma Values')
plt.show()

import matplotlib.pyplot as plt
import numpy as np
methods = {'LINEAR': [0.8926654740608229, 0.889087656529517, 
    0.9051878354203936, 0.8855098389982111, 0.8982142857142857], 'POLY': [
    0.9409660107334525, 0.9373881932021467, 0.9338103756708408, 
    0.9123434704830053, 0.9160714285714285], 'RBF': [0.8389982110912343, 
    0.8121645796064401, 0.8425760286225402, 0.8193202146690519, 
    0.8178571428571428]}
gammas_time = sorted({(0.05): [0.8604651162790697, 0.8336314847942755, 
    0.8622540250447227, 0.8354203935599285, 0.8357142857142857], (0.1): [
    0.9069767441860465, 0.8926654740608229, 0.9159212880143113, 
    0.889087656529517, 0.8928571428571429], (0.15): [0.924865831842576, 
    0.9266547406082289, 0.9338103756708408, 0.9123434704830053, 
    0.9053571428571429], (0.2): [0.9230769230769231, 0.9338103756708408, 
    0.9409660107334525, 0.9177101967799642, 0.9089285714285714], (0.25): [
    0.9266547406082289, 0.9284436493738819, 0.9391771019677997, 
    0.9105545617173524, 0.9160714285714285], (0.3): [0.9230769230769231, 
    0.9338103756708408, 0.9338103756708408, 0.8998211091234347, 
    0.9142857142857143], (0.35): [0.9159212880143113, 0.9302325581395349, 
    0.9320214669051878, 0.8962432915921288, 0.9089285714285714], (0.4): [
    0.9033989266547406, 0.9159212880143113, 0.9302325581395349, 
    0.8926654740608229, 0.9053571428571429], (0.45): [0.889087656529517, 
    0.9033989266547406, 0.9069767441860465, 0.8711985688729875, 
    0.8964285714285715], (0.5): [0.8568872987477638, 0.8819320214669052, 
    0.8801431127012522, 0.8407871198568873, 0.8910714285714286]}.items(),
    key=lambda x: x[0])
gammas_time_fft = sorted({(0.1): [0.9230769230769231, 0.924865831842576, 
    0.9230769230769231, 0.9123434704830053, 0.9089285714285714], (0.15): [
    0.9302325581395349, 0.9409660107334525, 0.9373881932021467, 
    0.9284436493738819, 0.9232142857142858], (0.2): [0.9338103756708408, 
    0.9463327370304114, 0.9427549194991055, 0.9266547406082289, 0.925], (
    0.25): [0.9284436493738819, 0.9463327370304114, 0.9445438282647585, 
    0.9159212880143113, 0.9232142857142858], (0.3): [0.9141323792486583, 
    0.9320214669051878, 0.9338103756708408, 0.9016100178890877, 
    0.9267857142857143], (0.35): [0.8944543828264758, 0.9266547406082289, 
    0.9069767441860465, 0.8729874776386404, 0.9178571428571428], (0.4): [
    0.8676207513416816, 0.8926654740608229, 0.8676207513416816, 
    0.8300536672629696, 0.8964285714285715], (0.45): [0.8300536672629696, 
    0.851520572450805, 0.8372093023255814, 0.7889087656529516, 
    0.8785714285714286], (0.5): [0.7853309481216458, 0.813953488372093, 
    0.7889087656529516, 0.7620751341681574, 0.8446428571428571], (0.55): [
    0.7495527728085868, 0.7584973166368515, 0.7584973166368515, 
    0.7209302325581395, 0.8], (0.6): [0.6994633273703041, 
    0.7048300536672629, 0.7101967799642218, 0.6797853309481217, 0.7375]}.
    items(), key=lambda x: x[0])
gammas_fft = sorted({(0.3): [0.8998211091234347, 0.889087656529517, 
    0.889087656529517, 0.8676207513416816, 0.8803571428571428], (0.35): [
    0.9016100178890877, 0.9087656529516994, 0.8998211091234347, 
    0.8801431127012522, 0.8892857142857142], (0.4): [0.9105545617173524, 
    0.9123434704830053, 0.9069767441860465, 0.8837209302325582, 0.9], (0.45
    ): [0.9123434704830053, 0.9141323792486583, 0.9087656529516994, 
    0.8855098389982111, 0.9035714285714286], (0.5): [0.9141323792486583, 
    0.9177101967799642, 0.9087656529516994, 0.8908765652951699, 
    0.9089285714285714], (0.55): [0.9123434704830053, 0.9177101967799642, 
    0.9105545617173524, 0.889087656529517, 0.9125], (0.6): [
    0.9105545617173524, 0.9159212880143113, 0.9105545617173524, 
    0.8837209302325582, 0.9125], (0.65): [0.9069767441860465, 
    0.9105545617173524, 0.9033989266547406, 0.8729874776386404, 
    0.9107142857142857], (0.7): [0.8998211091234347, 0.9051878354203936, 
    0.8908765652951699, 0.8694096601073346, 0.9053571428571429], (0.75): [
    0.8908765652951699, 0.8908765652951699, 0.8819320214669052, 
    0.8586762075134168, 0.8964285714285715], (0.8): [0.8819320214669052, 
    0.8747763864042933, 0.8694096601073346, 0.851520572450805, 
    0.8946428571428572]}.items(), key=lambda x: x[0])
i = 0
types = []
color = ['black', 'darkorange', 'darkgreen', 'royalblue', 'blueviolet']
means = []
for i, (_, value) in enumerate(methods.items()):
    for k, v in enumerate(value):
        t = plt.scatter(i, v, color=color[k])
        if i == 0:
            types.append(t)
    means.append(np.mean(value))
plt.plot(np.arange(len(methods)), means, marker='s', color='firebrick')
plt.xticks(np.arange(len(methods)), methods.keys())
plt.xlabel('Kernel Methods')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Kernel Methods')
plt.legend(types, [f'Fold_{j}' for j in range(5)], loc='lower left')
plt.show()
plt.plot(np.linspace(0.05, 0.5, 10), [np.mean(v) for k, v in gammas_time],
    marker='s', label='Time Features')
plt.plot(np.linspace(0.3, 0.8, 11), [np.mean(v) for k, v in gammas_fft],
    marker='d', label='Frequency Features')
plt.plot(np.linspace(0.1, 0.6, 11), [np.mean(v) for k, v in gammas_time_fft
    ], marker='o', label='Time Features + Frequency Features')
plt.xticks(np.linspace(0.05, 0.8, 16))
plt.yticks(np.linspace(0.7, 1.0, 13))
plt.grid()
plt.legend(loc='lower right')
plt.xlabel('Gamma values')
plt.ylabel('Evaluation Accuracy')
plt.title('Evaluation Accuracy of SVM models with Different Gamma Values')
plt.show()

import matplotlib.pyplot as plt
import numpy as np

methods = {
    'LINEAR': [0.8926654740608229, 0.889087656529517, 0.9051878354203936, 0.8855098389982111, 0.8982142857142857],
    'POLY': [0.9409660107334525, 0.9373881932021467, 0.9338103756708408, 0.9123434704830053, 0.9160714285714285],
    'RBF': [0.8389982110912343, 0.8121645796064401, 0.8425760286225402, 0.8193202146690519, 0.8178571428571428]
}
gammas_time = sorted({
    0.05: [0.8604651162790697, 0.8336314847942755, 0.8622540250447227, 0.8354203935599285, 0.8357142857142857],
    0.1: [0.9069767441860465, 0.8926654740608229, 0.9159212880143113, 0.889087656529517, 0.8928571428571429],
    0.15: [0.924865831842576, 0.9266547406082289, 0.9338103756708408, 0.9123434704830053, 0.9053571428571429],
    0.2: [0.9230769230769231, 0.9338103756708408, 0.9409660107334525, 0.9177101967799642, 0.9089285714285714],
    0.25: [0.9266547406082289, 0.9284436493738819, 0.9391771019677997, 0.9105545617173524, 0.9160714285714285],
    0.3: [0.9230769230769231, 0.9338103756708408, 0.9338103756708408, 0.8998211091234347, 0.9142857142857143],
    0.35: [0.9159212880143113, 0.9302325581395349, 0.9320214669051878, 0.8962432915921288, 0.9089285714285714],
    0.40: [0.9033989266547406, 0.9159212880143113, 0.9302325581395349, 0.8926654740608229, 0.9053571428571429],
    0.45: [0.889087656529517, 0.9033989266547406, 0.9069767441860465, 0.8711985688729875, 0.8964285714285715],
    0.50: [0.8568872987477638, 0.8819320214669052, 0.8801431127012522, 0.8407871198568873, 0.8910714285714286],
    # 0.55: [0.8211091234347049, 0.8443649373881932, 0.8586762075134168, 0.815742397137746, 0.8660714285714286],
    # 0.6: [0.7978533094812165, 0.8085867620751341, 0.8211091234347049, 0.7710196779964222, 0.8410714285714286],
    # 0.65: [0.7656529516994633, 0.7853309481216458, 0.7799642218246869, 0.7441860465116279, 0.8142857142857143],
    # 0.7: [0.7459749552772809, 0.7459749552772809, 0.7567084078711985, 0.7191413237924866, 0.7839285714285714],
    # 0.75: [0.7084078711985689, 0.7084078711985689, 0.7155635062611807, 0.6923076923076923, 0.7553571428571428],
    # 0.80: [0.6654740608228981, 0.6762075134168157, 0.6851520572450805, 0.6493738819320215, 0.7053571428571429],
}.items(), key=lambda x: x[0])

gammas_time_fft = sorted({
    0.1: [0.9230769230769231, 0.924865831842576, 0.9230769230769231, 0.9123434704830053, 0.9089285714285714],
    0.15: [0.9302325581395349, 0.9409660107334525, 0.9373881932021467, 0.9284436493738819, 0.9232142857142858],
    0.2: [0.9338103756708408, 0.9463327370304114, 0.9427549194991055, 0.9266547406082289, 0.925],
    0.25: [0.9284436493738819, 0.9463327370304114, 0.9445438282647585, 0.9159212880143113, 0.9232142857142858],
    0.3: [0.9141323792486583, 0.9320214669051878, 0.9338103756708408, 0.9016100178890877, 0.9267857142857143],
    0.35: [0.8944543828264758, 0.9266547406082289, 0.9069767441860465, 0.8729874776386404, 0.9178571428571428],
    0.4: [0.8676207513416816, 0.8926654740608229, 0.8676207513416816, 0.8300536672629696, 0.8964285714285715],
    0.45: [0.8300536672629696, 0.851520572450805, 0.8372093023255814, 0.7889087656529516, 0.8785714285714286],
    0.5: [0.7853309481216458, 0.813953488372093, 0.7889087656529516, 0.7620751341681574, 0.8446428571428571],
    0.55: [0.7495527728085868, 0.7584973166368515, 0.7584973166368515, 0.7209302325581395, 0.8],
    0.6: [0.6994633273703041, 0.7048300536672629, 0.7101967799642218, 0.6797853309481217, 0.7375],
    # 0.1: [0.8855098389982111, 0.8640429338103757, 0.8837209302325582, 0.8604651162790697, 0.8642857142857143],
    # 0.15: [0.9069767441860465, 0.9087656529516994, 0.9177101967799642, 0.8980322003577818, 0.8928571428571429],
    # 0.2: [0.9141323792486583, 0.9302325581395349, 0.9338103756708408, 0.9159212880143113, 0.9089285714285714],
    # 0.25: [0.9230769230769231, 0.9338103756708408, 0.9427549194991055, 0.9212880143112702, 0.9160714285714285],
    # 0.30: [0.924865831842576, 0.9409660107334525, 0.9427549194991055, 0.9212880143112702, 0.9232142857142858],
    # 0.35: [0.924865831842576, 0.9409660107334525, 0.9445438282647585, 0.9212880143112702, 0.9214285714285714],
    # 0.4: [0.924865831842576, 0.9427549194991055, 0.9445438282647585, 0.9123434704830053, 0.9196428571428571],
    # 0.45: [0.9266547406082289, 0.9427549194991055, 0.9409660107334525, 0.9069767441860465, 0.9178571428571428],
    # 0.5: [0.9177101967799642, 0.9391771019677997, 0.9427549194991055, 0.9033989266547406, 0.9160714285714285],
    # 0.55: [0.9105545617173524, 0.9391771019677997, 0.9373881932021467, 0.8998211091234347, 0.9214285714285714],
    # 0.6: [0.9016100178890877, 0.9302325581395349, 0.9320214669051878, 0.8926654740608229, 0.9232142857142858],
}.items(), key=lambda x: x[0])

gammas_fft = sorted({  # scaling coefficient=12.0
    0.3: [0.8998211091234347, 0.889087656529517, 0.889087656529517, 0.8676207513416816, 0.8803571428571428],
    0.35: [0.9016100178890877, 0.9087656529516994, 0.8998211091234347, 0.8801431127012522, 0.8892857142857142],
    0.4: [0.9105545617173524, 0.9123434704830053, 0.9069767441860465, 0.8837209302325582, 0.9],
    0.45: [0.9123434704830053, 0.9141323792486583, 0.9087656529516994, 0.8855098389982111, 0.9035714285714286],
    0.5: [0.9141323792486583, 0.9177101967799642, 0.9087656529516994, 0.8908765652951699, 0.9089285714285714],
    0.55: [0.9123434704830053, 0.9177101967799642, 0.9105545617173524, 0.889087656529517, 0.9125],
    0.6: [0.9105545617173524, 0.9159212880143113, 0.9105545617173524, 0.8837209302325582, 0.9125],
    0.65: [0.9069767441860465, 0.9105545617173524, 0.9033989266547406, 0.8729874776386404, 0.9107142857142857],
    0.7: [0.8998211091234347, 0.9051878354203936, 0.8908765652951699, 0.8694096601073346, 0.9053571428571429],
    0.75: [0.8908765652951699, 0.8908765652951699, 0.8819320214669052, 0.8586762075134168, 0.8964285714285715],
    0.8: [0.8819320214669052, 0.8747763864042933, 0.8694096601073346, 0.851520572450805, 0.8946428571428572],
}.items(), key=lambda x: x[0])

i = 0
types = []
color = ['black', 'darkorange', 'darkgreen', 'royalblue', 'blueviolet']
means = []
for i, (_, value) in enumerate(methods.items()):
    for k, v in enumerate(value):
        t = plt.scatter(i, v, color=color[k])
        if i == 0: types.append(t)
    means.append(np.mean(value))
plt.plot(np.arange(len(methods)), means, marker='s', color='firebrick')
plt.xticks(np.arange(len(methods)), methods.keys())
plt.xlabel("Kernel Methods")
plt.ylabel("Evaluation Accuracy")
plt.title("Evaluation Accuracy of SVM models with Different Kernel Methods")
plt.legend(types, [f"Fold_{j}" for j in range(5)], loc="lower left")
plt.show()

plt.plot(np.linspace(0.05, 0.50, 10), [np.mean(v) for k, v in gammas_time], marker='s', label="Time Features")
plt.plot(np.linspace(0.3, 0.8, 11), [np.mean(v) for k, v in gammas_fft], marker='d', label="Frequency Features")
plt.plot(np.linspace(0.1, 0.6, 11), [np.mean(v) for k, v in gammas_time_fft], marker='o', label="Time Features + Frequency Features")
plt.xticks(np.linspace(0.05, 0.80, 16))
plt.yticks(np.linspace(0.7, 1.0, 13))
plt.grid()
plt.legend(loc="lower right")
plt.xlabel("Gamma values")
plt.ylabel("Evaluation Accuracy")
plt.title("Evaluation Accuracy of SVM models with Different Gamma Values")
plt.show()
