From 9fed5bc6647ab6a3fb54cfeee7cfe3c821c7a543 Mon Sep 17 00:00:00 2001 From: Steve Reis <stevereis93@gmail.com> Date: Thu, 11 Aug 2022 18:16:19 +0200 Subject: [PATCH] fix: Missing algorithm in list --- api/src/common/utils/shared.utils.ts | 2 ++ .../connectors/exareme/transformations/algorithms/index.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/common/utils/shared.utils.ts b/api/src/common/utils/shared.utils.ts index 8d9b507..a696ec7 100644 --- a/api/src/common/utils/shared.utils.ts +++ b/api/src/common/utils/shared.utils.ts @@ -111,6 +111,8 @@ export const isPlainObject = (fn: any): fn is object => { export const isFunction = (val: any): boolean => typeof val === 'function'; export const isString = (val: any): val is string => typeof val === 'string'; export const isNumber = (val: any): val is number => typeof val === 'number'; +export const formatNumber = (val: any, precision = 4): number | string => + isNumber(val) ? val.toPrecision(precision) : val; export const isConstructor = (val: any): boolean => val === 'constructor'; export const isNil = (val: any): val is null | undefined => isUndefined(val) || val === null; diff --git a/api/src/engine/connectors/exareme/transformations/algorithms/index.ts b/api/src/engine/connectors/exareme/transformations/algorithms/index.ts index c723eba..6d71217 100644 --- a/api/src/engine/connectors/exareme/transformations/algorithms/index.ts +++ b/api/src/engine/connectors/exareme/transformations/algorithms/index.ts @@ -12,7 +12,7 @@ const transformToAlgorithms = jsonata(` 'LOGISTIC_REGRESSION','TTEST_INDEPENDENT','TTEST_PAIRED', 'PEARSON','ID3','KMEANS','NAIVE_BAYES', 'TTEST_ONESAMPLE','PCA','CALIBRATION_BELT','CART', - 'KAPLAN_MEIER','THREE_C', 'ONE_WAY_ANOVA', 'PEARSON', 'LINEAR_REGRESSION_CV']; + 'KAPLAN_MEIER','THREE_C', 'ONE_WAY_ANOVA', 'PEARSON_CORRELATION', 'LINEAR_REGRESSION_CV']; $linkedVars:= ['positive_class', 'positive_level', 'negative_level', 'outcome_neg', 'outcome_pos']; $linkedCoVars:= ['referencevalues', 'xlevels']; $truthy:= function($val) {( -- GitLab