Skip to content

[ML] adding prediction_field_type to inference config#55128

Merged
benwtrent merged 6 commits intoelastic:masterfrom
benwtrent:feature/ml-inference-handle-different-target-field-typs
Apr 15, 2020
Merged

[ML] adding prediction_field_type to inference config#55128
benwtrent merged 6 commits intoelastic:masterfrom
benwtrent:feature/ml-inference-handle-different-target-field-typs

Conversation

@benwtrent
Copy link
Copy Markdown
Member

Data frame analytics dynamically determines the classification field type. This field type then dictates the encoded JSON that is written to Elasticsearch.

Inference needs to know about this field type so that it may provide the EXACT SAME predicted values as analytics.

Here is added a new field prediction_field_type which indicates the desired type. Options are: string (DEFAULT), number, boolean (where close_to(1.0) == true, false otherwise).

Analytics provides the default prediction_field_type when the model is created from the process.

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core (:ml)

@benwtrent
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@przemekwitek przemekwitek self-requested a review April 14, 2020 12:28
…' of github.com:benwtrent/elasticsearch into feature/ml-inference-handle-different-target-field-typs
(Optional, string)
include::{docdir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field]

`prediction_field_type`::::
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

prediction_field_type

Not a big deal, but these properties are typically sorted alphabetically, and this seems to fall out of that sort order.

@benwtrent benwtrent requested a review from przemekwitek April 14, 2020 19:07
Copy link
Copy Markdown

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

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

LGTM

throw new IllegalArgumentException(
"Cannot transform numbers other than 0.0 or 1.0 to boolean. Provided number [" + value + "]");
}
return (1.0D - value) <= EPS;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could areClose be used here as well for clarity?

import java.util.Locale;

/**
* The type of the predicted field.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

s/predicted/prediction/
?

@benwtrent
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@benwtrent benwtrent merged commit c1afda4 into elastic:master Apr 15, 2020
@benwtrent benwtrent deleted the feature/ml-inference-handle-different-target-field-typs branch April 15, 2020 12:32
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Apr 15, 2020
Data frame analytics dynamically determines the classification field type. This field type then dictates the encoded JSON that is written to Elasticsearch. 

Inference needs to know about this field type so that it may provide the EXACT SAME predicted values as analytics. 

Here is added a new field `prediction_field_type` which indicates the desired type. Options are: `string` (DEFAULT), `number`, `boolean` (where close_to(1.0) == true, false otherwise). 

Analytics provides the default `prediction_field_type` when the model is created from the process.
benwtrent added a commit that referenced this pull request Apr 15, 2020
…55230)

* [ML] adding prediction_field_type to inference config (#55128)

Data frame analytics dynamically determines the classification field type. This field type then dictates the encoded JSON that is written to Elasticsearch. 

Inference needs to know about this field type so that it may provide the EXACT SAME predicted values as analytics. 

Here is added a new field `prediction_field_type` which indicates the desired type. Options are: `string` (DEFAULT), `number`, `boolean` (where close_to(1.0) == true, false otherwise). 

Analytics provides the default `prediction_field_type` when the model is created from the process.
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.

5 participants