Stabilize pairwise covariance symmetrization - #4963
Conversation
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
|
Closing as low value. The scale-normalized covariance symmetrization is dedicated to entries at or near the maximum finite float64 value, where covariance features and association calculations are not operationally meaningful. The extra per-entry machinery is not warranted for supported tracking scales. |

Summary
float64covariance scalesRoot cause
_symmetrized_covariance_batch()used0.5 * (P + P.T). For a finite covariance entry nearnp.finfo(np.float64).max, the intermediate addition overflows even though the mathematical average remains finite.Impact
Accepted finite covariance stacks could become non-finite before trace normalization, eigendecomposition, or pseudoinversion. In particular, covariance-shape features could return
NaNcosts and similarities for representable inputs, which can contaminate association scores and assignment costs.Fix
The helper now divides each entry pair by the largest absolute magnitude in that pair, averages values bounded by
[-1, 1], and multiplies by the original scale. Zero pairs use a safe unit divisor. The implementation stays entirely in the active backend.Validation
infand yieldingNaNshape features1, log-determinant cost0, and similarityexp(-1)float64main: only the covariance-feature source and focused regression file differThe full supported backend and lint matrices are delegated to GitHub Actions.