-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] DF Analytics Regression results: rerun evaluate endpoint for search bar queries #50991
[ML] DF Analytics Regression results: rerun evaluate endpoint for search bar queries #50991
Conversation
Pinging @elastic/ml-ui (:ml) |
💚 Build Succeeded
|
7e774c6
to
a7c10fe
Compare
💔 Build Failed
|
a7c10fe
to
393cc6e
Compare
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
...me_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, added a bunch of TS related questions/suggestions.
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts
Outdated
Show resolved
Hide resolved
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
...me_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx
Outdated
Show resolved
Hide resolved
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Outdated
Show resolved
Hide resolved
...me_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx
Outdated
Show resolved
Hide resolved
...e_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
Show resolved
Hide resolved
@@ -0,0 +1,3 @@ | |||
.mlDataFrameAnalyticsRegression__evaluateStat span.euiToolTipAnchor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvarezmelissa87 Don't forget that you can pass custom classnames to EuiToolTip anchors with the prop anchorClassName
. It's safer than targeting the .eui
class directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder 😄 Updated to use anchorClassName
instead - 629d3fd
💔 Build Failed |
retest |
💚 Build Succeeded |
}) => { | ||
const results: LoadEvaluateResult = { success: false, eval: null, error: null }; | ||
const defaultPredictionField = `${dependentVariable}_prediction`; | ||
const predictedField = `${resultsField}.${ | ||
predictionFieldName ? predictionFieldName : defaultPredictionField | ||
}`; | ||
|
||
const query = { term: { [`${resultsField}.is_training`]: { value: isTraining } } }; | ||
const query = getEvalQueryBody({ resultsField, isTraining, searchQuery, ignoreDefaultQuery }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the query matches just one document, I've seen that r_squared
is returned by the evaluate endpoint as -Infinity
. Can you check if this is correct, and if so, getValuesFromResponse
needs to handle this case as currently it throws an error when calling toPrecision
and the stats show up as --
(the mean_squared_error is a value and could be displayed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is caused because if there is only one doc variance is 0 - this was then being divided by 0 in the calculation to get rSquared. Instead of dividing by 0, 0 should just be returned.
A fix for this is up already elastic/elasticsearch#49439
We shouldn't need to do any additional checking in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with latest changes and LGTM.
When we switch the EUI table search bar to a KQL one, we should consider changing the layout to move the error stats into the main panel below the search bar. This will make it clearer that these errors relate to the same search as the table, and remove the duplication of the job ID / status which is duplicated in the current two panels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes LGTM 🎈
💚 Build Succeeded |
…rch bar queries (elastic#50991) * update evaluate panel values * re-evaluate endpoint with subquery * wip: add document count for training/gen evaluate * add document count for training/gen evaluate continued * use toolTipIcon, remove unnecessary comment * typescript improvements * use anchorClassName instead of targetin eui class directly
…rch bar queries (#50991) (#51316) * update evaluate panel values * re-evaluate endpoint with subquery * wip: add document count for training/gen evaluate * add document count for training/gen evaluate continued * use toolTipIcon, remove unnecessary comment * typescript improvements * use anchorClassName instead of targetin eui class directly
Summary
Fetch regression job results from
_evaluate
endpoint for queries created by the results table search bar.is_training
, re-fetch results for both training/generalization for queried data. Doc count is updated.is_training
, fetch results for queried data only for selected training subset (training or generalization). Doc count is also updated.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorials- [ ] This was checked for keyboard-only and screenreader accessibilityFor 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