From 66208fb73e2dc79503569cdaaa8c0e2250de6bd9 Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Mon, 20 Jul 2020 16:12:57 +0100 Subject: [PATCH] [ML] Fixes display of regression stop stats if one is NaN (#72412) --- .../public/application/data_frame_analytics/common/analytics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts index 06254f0de092e..561e8642772f0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts @@ -446,7 +446,7 @@ export function getValuesFromResponse(response: RegressionEvaluateResponse) { if (response.regression.hasOwnProperty(statType)) { let currentStatValue = response.regression[statType as keyof RegressionEvaluateResponse['regression']]?.value; - if (currentStatValue) { + if (currentStatValue && !isNaN(currentStatValue)) { currentStatValue = Number(currentStatValue.toPrecision(DEFAULT_SIG_FIGS)); } results[statType as keyof RegressionEvaluateExtractedResponse] = currentStatValue;