From b4f33b07cff363f4e0e6ec8b47d68ef27499330f Mon Sep 17 00:00:00 2001 From: Eukanj827 Date: Tue, 2 Aug 2022 14:44:04 +0800 Subject: [PATCH] Update average_base.py --- .../significance_detection/average_base.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py b/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py index 4f19f701c..8742adbf9 100644 --- a/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py +++ b/src/gausskernel/dbmind/tools/app/diagnosis/query/slow_sql/significance_detection/average_base.py @@ -12,17 +12,16 @@ # See the Mulan PSL v2 for more details. alpha = 1e-10 +#Define a minimum number of errors +#function name: detect +#description: Calculate whether the data has abrupt changes based on the average value +#arguments: data1, data2, threshold,method +#return value: bool +#date: 2022/8/ +#contact: 1865997821 def detect(data1, data2, threshold=0.5, method='bool'): - """ - Calculate whether the data has abrupt changes based on the average value - :param data1: input data array - :param data2: input data array - :param threshold: Mutation rate - :param method: The way to calculate the mutation - :return: bool - """ if not isinstance(data1, list) or not isinstance(data2, list): raise TypeError("The format of the input data is wrong.") avg1 = sum(data1) / len(data1) if data1 else 0