diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-04-26 12:34:28 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-04-26 12:34:28 +0200 |
commit | d5d53957f4686398727469e0f5b1774a5b6560fe (patch) | |
tree | 6f9e7f8271ac149e888dc905f81de3d8a7e0b7c8 /resources/tools/presentation/generator_CPTA.py | |
parent | 1090a73a99ea3980fd6bbc9b8acd4ccc47b4fb61 (diff) |
Trending: use 2*stdev
Change-Id: I24ba8d268a25d5b5c249cde47a13468dfab57a4b
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_CPTA.py')
-rw-r--r-- | resources/tools/presentation/generator_CPTA.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py index e3cc55f8cf..d72be3d589 100644 --- a/resources/tools/presentation/generator_CPTA.py +++ b/resources/tools/presentation/generator_CPTA.py @@ -172,13 +172,13 @@ def _evaluate_results(trimmed_data, window=10): if first: first = False continue - if (np.isnan(value) \ - or np.isnan(tmm[build_nr]) \ + if (np.isnan(value) + or np.isnan(tmm[build_nr]) or np.isnan(tmstd[build_nr])): results.append(0.0) - elif value < (tmm[build_nr] - 3 * tmstd[build_nr]): + elif value < (tmm[build_nr] - 2 * tmstd[build_nr]): results.append(0.33) - elif value > (tmm[build_nr] + 3 * tmstd[build_nr]): + elif value > (tmm[build_nr] + 2 * tmstd[build_nr]): results.append(1.0) else: results.append(0.66) @@ -187,10 +187,10 @@ def _evaluate_results(trimmed_data, window=10): try: tmm = np.median(trimmed_data) tmstd = np.std(trimmed_data) - if trimmed_data.values[-1] < (tmm - 3 * tmstd): + if trimmed_data.values[-1] < (tmm - 2 * tmstd): results.append(0.33) - elif (tmm - 3 * tmstd) <= trimmed_data.values[-1] <= ( - tmm + 3 * tmstd): + elif (tmm - 2 * tmstd) <= trimmed_data.values[-1] <= ( + tmm + 2 * tmstd): results.append(0.66) else: results.append(1.0) |