[ML] Fixing exclude frequent in advanced wizard (#81121)

* [ML] Fixing exclude frequent in advanced wizard

* updating description

* adding exclude_frequent to test
This commit is contained in:
James Gowdy 2020-10-20 14:00:29 +01:00 committed by GitHub
parent 8162b961e9
commit 6db108b914
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 3 deletions

View file

@ -58,7 +58,12 @@ const emptyOption: EuiComboBoxOptionOption = {
label: '',
};
const excludeFrequentOptions: EuiComboBoxOptionOption[] = [{ label: 'all' }, { label: 'none' }];
const excludeFrequentOptions: EuiComboBoxOptionOption[] = [
{ label: 'all' },
{ label: 'none' },
{ label: 'by' },
{ label: 'over' },
];
export const AdvancedDetectorModal: FC<Props> = ({
payload,

View file

@ -142,7 +142,7 @@ export const ExcludeFrequentDescription: FC = memo(({ children }) => {
description={
<FormattedMessage
id="xpack.ml.newJob.wizard.pickFieldsStep.advancedDetectorModal.excludeFrequent.description"
defaultMessage="If true will automatically identify and exclude frequently occurring entities which may otherwise have dominated results."
defaultMessage="If set, it will automatically identify and exclude frequently occurring entities which may otherwise have dominated results."
/>
}
>

View file

@ -26,6 +26,8 @@ const detectorSchema = schema.object({
over_field_name: schema.maybe(schema.string()),
partition_field_name: schema.maybe(schema.string()),
detector_description: schema.maybe(schema.string()),
exclude_frequent: schema.maybe(schema.string()),
use_null: schema.maybe(schema.boolean()),
/** Custom rules */
custom_rules: customRulesSchema,
});

View file

@ -35,7 +35,13 @@ export default ({ getService }: FtrProviderContext) => {
groups: [],
analysis_config: {
bucket_span: '15m',
detectors: [{ function: 'mean', field_name: 'products.discount_amount' }],
detectors: [
{
function: 'mean',
field_name: 'products.discount_amount',
exclude_frequent: 'none',
},
],
influencers: [],
summary_count_field_name: 'doc_count',
},