Based on the given multi-attribute field samples and conditions, the differential pattern statistical function analyzes the set of differential patterns affecting the conditions. This helps you quickly diagnose the causes for the differences between the conditions.

pattern_diff

Function format:
select pattern_diff(array_char_value, array_char_name, array_numeric_value, array_numeric_name, condition, supportScore,posSampleRatio,negSampleRatio) 
The following table describes the parameters.
Parameter Description Value
array_char_value Input column composed of character type values Values in array format, for example, array[clientIP, sourceIP, path, logstore]
array_char_name Name corresponding to the input column composed of character type values Values in array format, for example, array['clientIP', 'sourceIP', 'path', 'logstore']
array_numeric_value Input column composed of numeric values Values in array format, for example, array[Inflow, OutFlow]
array_numeric_name Name corresponding to the input column composed of numeric values Values in array format, for example, array['Inflow', 'OutFlow']
condition Data filtering condition. True indicates positive samples, and False indicates negative samples. For example: latency ≤ 300
supportScore Support degree of positive and negative samples for pattern mining Double type values. Range: (0,1].
posSampleRatio Sampling ratio of positive samples with a default value of 0.5, which indicates that only half of the positive samples are used Double type values. Range: (0,1].
negSampleRatio Sampling ratio of negative samples with a default value of 0.5, which indicates that only half of the negative samples are used Double type values. Range: (0,1].
Example:
  • Statement for query and analysis:
    * | 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 
  • Result:



The following table describes the display items.
Display item Description
possupport Support level of positive samples for the mined pattern
posconfidence Confidence of positive samples for the mined pattern
negsupport Support level of negative samples for the mined pattern
diffpattern Content of the mined pattern