差异模式统计函数基于给定的多属性字段样本,在给定的判别条件下,分析出影响该条件划分的差异化模式集合,帮助您快速诊断导致当前判别条件差异的原因。

pattern_diff

函数格式:
select pattern_diff(array_char_value, array_char_name, array_numeric_value, array_numeric_name, condition, supportScore,posSampleRatio,negSampleRatio ) 
参数说明如下:
参数 说明 取值
array_char_value 字符型数据的输入列。 数组形式,例如:array[clientIP, sourceIP, path, logstore]。
array_char_name 字符型数据的输入列的对应名称。 数组形式,例如:array['clientIP', 'sourceIP', 'path', 'logstore']。
array_numeric_value 数值型数据的输入列。 数组形式,例如:array[Inflow, OutFlow]。
array_numeric_name 数值型数据的输入列的对应名称。 数组形式,例如array['Inflow', 'OutFlow']。
condition 筛选数据的条件。条件为True则为正样本,条件为False则为负样本。 例如:Latency <= 300。
supportScore 正负样本在进行模式挖掘时的支持度。 double类型,取值为(0,1]。
posSampleRatio 正样本的采样率。默认为0.5,表示只取50%正样本集合。 double类型,取值为(0,1]。
negSampleRatio 负样本的采样率,默认为0.5,表示只取50%负样本集合。 double类型,取值为(0,1]。
示例:
  • 查询分析:
    * | select pattern_diff(array[ Category, ClientIP, ProjectName, LogStore, Method, Source, UserAgent ], array[ 'Category', 'ClientIP', 'ProjectName', 'LogStore', 'Method', 'Source', 'UserAgent' ], array[ InFlow, OutFlow ], array[ 'InFlow', 'OutFlow' ], Latency > 300, 0.2, 0.1, 1.0) limit 1000 
  • 输出结果:



显示项如下:
显示项 说明
possupport 挖掘出来的模式在正样本中的支持度。
posconfidence 挖掘出来的模式在正样本中的置信度。
negsupport 挖掘出来的模式在负样本中的支持度。
diffpattern 挖掘出来的具体模式内容。