File size: 498 Bytes
4b7d982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pandas as pd
import matplotlib.pyplot as plt
import os

if __name__ == "__main__":
    df = pd.read_csv("logs/scores.csv")

    plt.plot(df["episode"], df["score"], marker='o')
    plt.xlabel("Episode")
    plt.ylabel("Score")
    plt.title("Heuristic Agent Learning Curve")
    plt.grid(True)
    
    # Save the plot explicitly as well
    os.makedirs("logs", exist_ok=True)
    plt.savefig("logs/learning_curve.png")
    
    plt.show()
    print("Plot saved to logs/learning_curve.png")