-
Notifications
You must be signed in to change notification settings - Fork 25k
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] adding prediction_field_type to inference config #55128
[ML] adding prediction_field_type to inference config #55128
Conversation
Pinging @elastic/ml-core (:ml) |
@elasticmachine update branch |
...src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PredictedFieldType.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PredictedFieldType.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PredictedFieldType.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PredictedFieldType.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PredictedFieldType.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java
Outdated
Show resolved
Hide resolved
.../ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsResultProcessor.java
Outdated
Show resolved
Hide resolved
…' of github.com:benwtrent/elasticsearch into feature/ml-inference-handle-different-target-field-typs
@@ -382,6 +382,10 @@ include::{docdir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] | |||
`top_classes_results_field`:::: | |||
(Optional, string) | |||
include::{docdir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field] | |||
|
|||
`prediction_field_type`:::: |
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.
prediction_field_type
Not a big deal, but these properties are typically sorted alphabetically, and this seems to fall out of that sort order.
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
throw new IllegalArgumentException( | ||
"Cannot transform numbers other than 0.0 or 1.0 to boolean. Provided number [" + value + "]"); | ||
} | ||
return (1.0D - value) <= EPS; |
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.
Could areClose
be used here as well for clarity?
import java.util.Locale; | ||
|
||
/** | ||
* The type of the predicted field. |
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.
s/predicted/prediction/
?
@elasticmachine update branch |
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.
…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.
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.