1
$\begingroup$

I trained multiple CNN models, after that, I saved models details (Like , training/Validation Acc/Loss ) by callbacks by using this codes :
tf.keras.callbacks.CSVLogger 

Now I have multiple models training-val acc-loss respective values in different csv files.
I want to plots those in one figure from my csv files. How can I do this?

$\endgroup$
0

1 Answer 1

0
$\begingroup$

Here are the steps I solve my problem:

  • Save Statistical records (Training-Validation Accuraciers, Training-Validation Recall, Training-Validation Precisions, Training-Validation F1) from CSV files of this following code tf.keras.callbacks.CSVLogger after training each fold (I trained for the 3 Folds).

  • And load those csv files in the list:
        import pandas as pd
        l = ["/Records_of_Fold_2.csv" , "/Records_of_Fold_3.csv"]

  • After that, Plot using matplotlib :

    for (k,i) in enumerate(l):
    data = pd.read_csv(i)
    plt.figure(str(k))
    plt.xlabel("x"+str(k))
    plt.ylabel("y"+str(k))
    plt.plot(data["epoch"],data["f1_score"])
    plt.plot(data["epoch"],data["loss"])
    print(k)
    plt.show()
    

    enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.