Skip to content

Commit

Permalink
fix eval plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
tztsai committed Sep 19, 2024
1 parent d7bc5de commit e00b304
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DEF_Trunk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
logfile = "log.MLacc_Trunk"
tasks = [
# 2,
4,
# 4,
5
] # 1=test clustering, 2=clustering, 3=compress forcing, 4=ML, 5=evaluation
results_dir = "./EXE_DIR/"
reference_dir = "/home/surface10/mrasolon/files_for_zenodo/reference/EXE_DIR/"
Expand Down
10 changes: 5 additions & 5 deletions Tools/eval_plot_loocv_un.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def plot_metric(data_path, npfts, ipool, subLabel, dims, sect_n, xTickLabel):
# print(subps)
loop_n = len(subLabel)
shape = np.array([npfts, subps])
R22 = np.genfromtxt(data_path + ipool + "_loocv_R2.txt", delimiter=",")[:, :-1]
slope = np.genfromtxt(data_path + ipool + "_loocv_slope.txt", delimiter=",")[:, :-1]
dNRMSE = np.genfromtxt(data_path + ipool + "_loocv_dNRMSE.txt", delimiter=",")[
:, :-1
]
df = pd.read_csv(data_path + "MLacc_results.csv", index_col=[0, 1, 2])
df = df.loc[ipool].round(2)
R22 = df["R2"].unstack().values
slope = df["slope"].unstack().values
dNRMSE = df["dNRMSE"].unstack().values

# print(R22)
yTickLabel = [
Expand Down
8 changes: 5 additions & 3 deletions Tools/eval_plot_un.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def plot_metric(data_path, npfts, ipool, subLabel, dims, sect_n, xTickLabel):
# dims=np.array([0,1])# biomass: [1,0]
# shape=np.array([14*loop_n,4])# biomass: [14,8sect_n,
shape = np.array([npfts, subps])
R22 = np.genfromtxt(data_path + ipool + "_R2.txt", delimiter=",")[:, :-1]
slope = np.genfromtxt(data_path + ipool + "_slope.txt", delimiter=",")[:, :-1]
dNRMSE = np.genfromtxt(data_path + ipool + "_dNRMSE.txt", delimiter=",")[:, :-1]
df = pd.read_csv(data_path + "MLacc_results.csv", index_col=[0, 1, 2])
df = df.loc[ipool].round(2)
R22 = df["R2"].unstack().values
slope = df["slope"].unstack().values
dNRMSE = df["dNRMSE"].unstack().values

print(R22)
yTickLabel = [
Expand Down

0 comments on commit e00b304

Please sign in to comment.