Skip to content

Add yml test for using AucRoc with the old results format #63107

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/ml-with-security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ yamlRestTest {
'ml/evaluate_data_frame/Test classification auc_roc given actual_field is never equal to fish',
'ml/evaluate_data_frame/Test classification auc_roc given predicted_class_field is never equal to mouse',
'ml/evaluate_data_frame/Test classification auc_roc with missing class_name',
'ml/evaluate_data_frame/Test classification auc_roc with old results format',
'ml/evaluate_data_frame/Test classification accuracy with missing predicted_field',
'ml/evaluate_data_frame/Test regression given evaluation with empty metrics',
'ml/evaluate_data_frame/Test regression given missing actual_field',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/ml/qa/ml-with-security/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ minimal:
# Give all users involved in these tests access to the indices where the data to
# be analyzed is stored, because the ML roles alone do not provide access to
# non-ML indices
- names: [ 'airline-data', 'index-*', 'unavailable-data', 'utopia', 'store' ]
- names: [ 'airline-data', 'index-*', 'unavailable-data', 'utopia*', 'store' ]
privileges:
- create_index
- indices:admin/refresh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ setup:
"foo": 0.24
}

- do:
indices.create:
index: utopia_old_results_format

# This document is indexed to utopia_old_results_format index *without* nested mapping for ml.top_classes field
- do:
index:
index: utopia_old_results_format
body: >
{
"classification_field_act": "cat",
"ml.top_classes": [
{"class_name": "dog", "class_probability": 0.9},
{"class_name": "cat", "class_probability": 0.1}
]
}

- do:
indices.refresh: {}

Expand Down Expand Up @@ -750,6 +767,25 @@ setup:
- match: { classification.auc_roc.doc_count: 8 }
- is_false: classification.auc_roc.curve
---
"Test classification auc_roc with old results format":
- do:
catch: /\[nested\] nested object under path \[ml.top_classes\] is not of nested type/
ml.evaluate_data_frame:
body: >
{
"index": "utopia_old_results_format",
"evaluation": {
"classification": {
"actual_field": "classification_field_act.keyword",
"metrics": {
"auc_roc": {
"class_name": "cat"
}
}
}
}
}
---
"Test classification accuracy with missing predicted_field":
- do:
catch: /\[classification\] must define \[predicted_field\] as required by the following metrics \[accuracy\]/
Expand Down