Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Add checkbox to enable model plot in Advanced job wizard #25468

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Nov 9, 2018

Summary

Related issue: #18164
Follow up to: #24914

Adds an Enable model plot checkbox in the Analysis Configuration tab in the Advanced job creation wizard. Creating a job with this checked sets "model_plot_config":{"enabled":true}. for that job.

Flow:

  • When Enable model plot is checked cardinality check is run. Callout is shown when cardinality is greater than the threshold (100).
  • Cardinality check is re-run when relevant fields change/are updated.
    -- Changes made in Detectors area or from Add detector modal.
  • We keep track of the current detector and model_plot configs in currentConfigs and if changes occur via the Edit JSON tab, we update the ui and run cardinality again if enableModelPlot is set to true and detectors have been updated.
  • If Cardinality validation errors for some reason - still show warning message so user is aware of risk in enabling model plot.
  • Use dedicated index is NOT automatically checked when cardinality returns a warning. This option is in a separate tab and, therefore, may not be seen by the user so we don't change it.
  • Also adds better error handling for MultiMetric + Population wizards by still showing callout with warning message.

screen shot 2018-11-09 at 7 50 24 am

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately
- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

$scope.ui.cardinalityValidator.message = `Creating model plots is resource intensive and not recommended
where the cardinality of the selected fields is greater than 100. Estimated cardinality
for this job is ${validationResult.highCardinality}.
If you enable model plot with this configuration we recommend you use a dedicated results index.`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth adding where that dedicated results index is configured. Something like If you enable model plot with this configuration we recommend you select a dedicated results index on the Job Details tab. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean as a warning callout as well?

$scope.ui.cardinalityValidator.status = STATUS.WARNING;
}
})
.catch((error) => { console.log('Cardinality check error:', error); });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth displaying some sort of warning in the same callout for the error case. Something like An error occurred validating the configuration for running the job with model plot enabled. Creating model plots can be resource intensive and not recommended where the cardinality of the selected fields is high. You may want to select a dedicated results index on the Job Details tab.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, @peteharverson! 😄 I'll go back and add this to the other wizards as well in a subsequent PR

return response;
}

export function getMinimalValidJob() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment to say when this function would be used

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

} from '@elastic/eui';


export const EnableModelPlotCallout = ({ message }) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have a unit test for this component, even though it is fairly simple.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes LGTM

@alvarezmelissa87
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alvarezmelissa87 alvarezmelissa87 merged commit 354d7cc into elastic:master Nov 16, 2018
alvarezmelissa87 added a commit to alvarezmelissa87/kibana that referenced this pull request Nov 16, 2018
…c#25468)

* Move cardinality success check to utils

* enableModelPlot checkbox base added

* Run cardinality check on add/update fields

* Handle changes made via json

* only run cardinality check if model plot enabled

* Handle model plot enabled via EditJSON tab

* show message on cardinality check error

* multi-metric + pop: show message on cardinality check error

* add test for callout component

* Fix flexitem overflow in IE11
@alvarezmelissa87 alvarezmelissa87 deleted the ml-configure-model-plot-advanced branch November 16, 2018 21:48
alvarezmelissa87 added a commit that referenced this pull request Nov 17, 2018
#25831)

* Move cardinality success check to utils

* enableModelPlot checkbox base added

* Run cardinality check on add/update fields

* Handle changes made via json

* only run cardinality check if model plot enabled

* Handle model plot enabled via EditJSON tab

* show message on cardinality check error

* multi-metric + pop: show message on cardinality check error

* add test for callout component

* Fix flexitem overflow in IE11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants