Fix NaN check in anomaly score calculation (#21149)
Stelios Fragkakis committed
Oct 15, 2025 at 16:05 UTC
88983f0dfd1e6ed841dcd681d8d98b580bca97c2
1 file changed
+1
-1
src/ml/ml.cc
+1
-1
@@ -800,7 +800,7 @@ ml_dimension_predict(ml_dimension_t *dim, calculated_number_t value, bool exists
800
models_consulted++;
801
802
calculated_number_t anomaly_score = ml_kmeans_anomaly_score(&km_ctx, features.preprocessed_features[0]);
803
- if (anomaly_score == std::numeric_limits<calculated_number_t>::quiet_NaN())
803
+ if (std::isnan(anomaly_score))
804
continue;
805
806
if (anomaly_score < (100 * Cfg.dimension_anomaly_score_threshold)) {