Skip to content

Commit dca83a1

Browse files
[ML] Fixing exclude frequent in advanced wizard (#81121) (#81154)
* [ML] Fixing exclude frequent in advanced wizard * updating description * adding exclude_frequent to test
1 parent 80a2a50 commit dca83a1

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/advanced_detector_modal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ const emptyOption: EuiComboBoxOptionOption = {
5858
label: '',
5959
};
6060

61-
const excludeFrequentOptions: EuiComboBoxOptionOption[] = [{ label: 'all' }, { label: 'none' }];
61+
const excludeFrequentOptions: EuiComboBoxOptionOption[] = [
62+
{ label: 'all' },
63+
{ label: 'none' },
64+
{ label: 'by' },
65+
{ label: 'over' },
66+
];
6267

6368
export const AdvancedDetectorModal: FC<Props> = ({
6469
payload,

x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/descriptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const ExcludeFrequentDescription: FC = memo(({ children }) => {
142142
description={
143143
<FormattedMessage
144144
id="xpack.ml.newJob.wizard.pickFieldsStep.advancedDetectorModal.excludeFrequent.description"
145-
defaultMessage="If true will automatically identify and exclude frequently occurring entities which may otherwise have dominated results."
145+
defaultMessage="If set, it will automatically identify and exclude frequently occurring entities which may otherwise have dominated results."
146146
/>
147147
}
148148
>

x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const detectorSchema = schema.object({
2626
over_field_name: schema.maybe(schema.string()),
2727
partition_field_name: schema.maybe(schema.string()),
2828
detector_description: schema.maybe(schema.string()),
29+
exclude_frequent: schema.maybe(schema.string()),
30+
use_null: schema.maybe(schema.boolean()),
2931
/** Custom rules */
3032
custom_rules: customRulesSchema,
3133
});

x-pack/test/api_integration/apis/ml/job_validation/validate.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export default ({ getService }: FtrProviderContext) => {
3535
groups: [],
3636
analysis_config: {
3737
bucket_span: '15m',
38-
detectors: [{ function: 'mean', field_name: 'products.discount_amount' }],
38+
detectors: [
39+
{
40+
function: 'mean',
41+
field_name: 'products.discount_amount',
42+
exclude_frequent: 'none',
43+
},
44+
],
3945
influencers: [],
4046
summary_count_field_name: 'doc_count',
4147
},

0 commit comments

Comments
 (0)