-
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] Data Frame Analytics creation wizard: add validation step (Part 1) #93478
[ML] Data Frame Analytics creation wizard: add validation step (Part 1) #93478
Conversation
Pinging @elastic/ml-ui (:ml) |
fadfb1e
to
a3bf34b
Compare
x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts
Show resolved
Hide resolved
]; | ||
return ( | ||
<> | ||
<EuiFlexGroup style={{ width: '70%' }}> |
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.
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.
Adding this to be done in a follow up 👍
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.
LGTM. Once this and the follow-ups in #88248 are in, we can continue to test with larger data sets. Currently I don't have a clear idea on whether the thresholds used in the tests need refining, but they worked fine on my local setup.
This part 1 PR has been updated and is ready for a final look when you get a chance cc @jgowdyelastic 🙏 |
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.
Some strings were complete sentences and others were not, so I synched on the former. Otherwise, text LGTM
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_frame_analytics/validation.ts
Outdated
Show resolved
Hide resolved
switch (status) { | ||
case VALIDATION_STATUS.INFO: | ||
return 'primary'; | ||
break; |
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.
nit, the breaks are redundant in these switch
statements as you're returning from inside the case
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.
just noticed this is moved code. might be worth updating it still.
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.
Updated in a7e5fc69c41f0b104667516fc53457eebf0a649d
import { EuiLoadingSpinner, EuiSpacer } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { ml } from '../../../../../services/ml_api_service'; |
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.
for new code we should be using the context which provides this.
import { useMlApiContext } from '../../../../../contexts/kibana';
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.
Updated in a7e5fc69c41f0b104667516fc53457eebf0a649d
@@ -166,4 +166,12 @@ export const dataFrameAnalytics = { | |||
method: 'GET', | |||
}); | |||
}, | |||
validateDataFrameAnalytics(analyticsConfig: DeepPartial<DataFrameAnalyticsConfig>) { | |||
const body = JSON.stringify(analyticsConfig); | |||
return http<any>({ |
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.
can we replace any
with the return type here?
should be the return type of validateAnalyticsJob
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.
Updated in 943882adedeeaf1254d355f87d7b8549051e6c37
}; | ||
|
||
function getTrainingPercentMessage(trainingDocs: number) { | ||
let trainingPercentMessage; |
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.
trainingPercentMessage
probably isn't needed as we could return from within the if
statement below.
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.
Updated in a7e5fc69c41f0b104667516fc53457eebf0a649d
} | ||
|
||
try { | ||
const { body }: { body: ValidationSearchResult } = await asCurrentUser.search({ |
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.
you should be able to use the generic on search
here.
something like
const { body } = await asCurrentUser.search<ValidationSearchResult>(
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.
Updated in a7e5fc69c41f0b104667516fc53457eebf0a649d
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.
Text strings LGTM!
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.
LGTM
943882a
to
9e15668
Compare
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…1) (elastic#93478) * wip: create validationStep component * wip: trainingPercent check, analysisFields check. Step details * move validation check to server * handle no training percent in validation * move callout component to shared dir * use shared Callout component in AD val and update message headings * update types * adds functional tests for validation * adds api integration test for validate endpoint * consolidate messages for depvar and fields * fix accessibility test * update license * update validation messages * update types in validation model * add jobValidationReturnType
…1) (#93478) (#93869) * wip: create validationStep component * wip: trainingPercent check, analysisFields check. Step details * move validation check to server * handle no training percent in validation * move callout component to shared dir * use shared Callout component in AD val and update message headings * update types * adds functional tests for validation * adds api integration test for validate endpoint * consolidate messages for depvar and fields * fix accessibility test * update license * update validation messages * update types in validation model * add jobValidationReturnType
Summary
Related meta issue #88248
Also addresses: #78637
Adds a validation step to the Data Frame Analytics creation wizard.
Adds functional tests for validation step.
Adds api integration test for validate endpoint.
Dependent variable checks
Training Percent
Analysis fields
Current limitations used to validate
Regression/Classification example with warning messages:
Regression/Classification example success:
Outlier detection with warning messages:
Outlier detection success:
Checklist
Delete any items that are not applicable to this PR.