Skip to content

Commit

Permalink
[ML] MML calculator enhancements for multi-metric job wizard (elastic…
Browse files Browse the repository at this point in the history
…#54573)

* [ML] fix fieldNames provided to calculateModelMemoryLimit

* [ML] calculateModelMemoryLimit when the influencers are changed
  • Loading branch information
darnautov committed Jan 14, 2020
1 parent 388303b commit eaf1470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ export class MultiMetricJobCreator extends JobCreator {
// not split field, use the default
this.modelMemoryLimit = DEFAULT_MODEL_MEMORY_LIMIT;
} else {
const fieldNames = this._detectors.map(d => d.field_name).filter(fn => fn !== undefined);
const { modelMemoryLimit } = await ml.calculateModelMemoryLimit({
indexPattern: this._indexPatternTitle,
splitFieldName: this._splitField.name,
query: this._datafeed_config.query,
fieldNames,
fieldNames: this.fields.map(f => f.id),
influencerNames: this._influencers,
timeFieldName: this._job_config.data_description.time_field,
earliestMs: this._start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export const Influencers: FC = () => {
useEffect(() => {
jobCreator.removeAllInfluencers();
influencers.forEach(i => jobCreator.addInfluencer(i));
if (jobCreator instanceof MultiMetricJobCreator) {
jobCreator.calculateModelMemoryLimit();
}
jobCreatorUpdate();
}, [influencers.join()]);

Expand Down

0 comments on commit eaf1470

Please sign in to comment.