aws / random-cut-forest-by-aws

An implementation of the Random Cut Forest data structure for sketching streaming data, with support for anomaly detection, density estimation, imputation, and more.
https://github.com/aws/random-cut-forest-by-aws
Apache License 2.0
213 stars 34 forks source link

fix to issue 374 #376

Closed sudiptoguha closed 1 year ago

sudiptoguha commented 1 year ago

Issue #, if available: 374

Description of changes: Floating point operations are non-commutative and even if addition and subtraction (of single precision numbers) are performed in double precision over large enough dimensions, the floating points may conspire for an anomalous scenario (a reproducible test is provided). That scenario is explicitly ruled out in this change and debug statements are added for future.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.