Closed twVolc closed 2 months ago
Note this is on really bad data - usually R-squared does look reasonable, but there still must be a slight issue
Here is where R-squared is calculated: https://github.com/twVolc/PyCamPermanent/blob/4edfb0ca0b651f07c21951ce248f6114d62a5060/pycam/so2_camera_processor.py#L3909-L3916
This means that (mse / np.var(self.calib_pears.cd_vec))
produces a value that is greater than 1, which either means that mse
is very big or the variablity of the cd_vec
is very small. It would be good to know what the R-squared and mse values are for a few points when it goes negative.
So I have done some looking into this and it is possible to get a negative R2 (based on how it is calculated here). It is an indication that the model fit is very very very poor (for maths reasons), we can trust the R2 calculation.
I'm pretty sure there's a problem with how r-squared is being calculated. It can produce negative numbers, which should be impossible. They aren't seen on the plot below because the axis is fixed between 0-1, but the saved values do drop below 0.