Skip to content

Commit eaf1470

Browse files
committed
[ML] MML calculator enhancements for multi-metric job wizard (#54573)
* [ML] fix fieldNames provided to calculateModelMemoryLimit * [ML] calculateModelMemoryLimit when the influencers are changed
1 parent 388303b commit eaf1470

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,11 @@ export class MultiMetricJobCreator extends JobCreator {
9292
// not split field, use the default
9393
this.modelMemoryLimit = DEFAULT_MODEL_MEMORY_LIMIT;
9494
} else {
95-
const fieldNames = this._detectors.map(d => d.field_name).filter(fn => fn !== undefined);
9695
const { modelMemoryLimit } = await ml.calculateModelMemoryLimit({
9796
indexPattern: this._indexPatternTitle,
9897
splitFieldName: this._splitField.name,
9998
query: this._datafeed_config.query,
100-
fieldNames,
99+
fieldNames: this.fields.map(f => f.id),
101100
influencerNames: this._influencers,
102101
timeFieldName: this._job_config.data_description.time_field,
103102
earliestMs: this._start,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export const Influencers: FC = () => {
2525
useEffect(() => {
2626
jobCreator.removeAllInfluencers();
2727
influencers.forEach(i => jobCreator.addInfluencer(i));
28+
if (jobCreator instanceof MultiMetricJobCreator) {
29+
jobCreator.calculateModelMemoryLimit();
30+
}
2831
jobCreatorUpdate();
2932
}, [influencers.join()]);
3033

0 commit comments

Comments
 (0)