Skip to content

Commit

Permalink
[ML] Fixing exclude frequent in advanced wizard (#81121)
Browse files Browse the repository at this point in the history
* [ML] Fixing exclude frequent in advanced wizard

* updating description

* adding exclude_frequent to test
  • Loading branch information
jgowdyelastic authored Oct 20, 2020
1 parent 8162b96 commit 6db108b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit 6db108b

Please sign in to comment.