CALIPSO-project / SPINacc

A spinup acceleration procedure for land surface models (LSM) . Developer team Mandresy Rasolonjatovo, Tianzhang Cai, Matthew Archer, Daniel Goll
4 stars 0 forks source link

Error in MLeval.evaluation_map during the calculation of linear regression #22

Open vbast opened 1 year ago

vbast commented 1 year ago

When I perform the ML training and evaluation (task 4), the tool passes OK all carbon variables. But when it goes through the first biomass pool (biomass_01), it covers PFTs 2-8 only, and crashes on PFT9 in function "MLeval.evaluation_map" on the line: slope, intercept, r_value, p_value, std_err = stats.linregress(comp_Y[:,0],comp_Y[:,1]) with error: ValueError: Cannot calculate a linear regression if all x values are identical

To bypass the error I added an exception in MLeval.evaluation_map in case when all values of comp_Y[:,0] and directly assign slope=1.

However, when I check the values of comp_Y[:,0], I see that they are all equal to zero. So perhaps, there is a problem somewhere else (to be further checked).

dsgoll123 commented 1 year ago

I can confirm this happens for CNP v1.3 too.