Skip to content
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

Evaluate API fails when there is type mismatch between actual and predicted fields. #54079

Closed
przemekwitek opened this issue Mar 24, 2020 · 2 comments · Fixed by #54255
Closed
Assignees
Labels
>bug :ml Machine learning

Comments

@przemekwitek
Copy link
Contributor

If fields (actualField, predictedField) are misconfigured and it happens that their mapping types differ (e.g. long vs boolean) then Evaluate API fails with non-intuitive error message mentioning script failure (the script we are using internally to calculate the metrics).

Example failures:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "runtime error",
        "script_stack" : [
          "java.base/java.lang.Class.cast(Class.java:3604)",
          "doc['mal_count'].value == doc['ml.label_prediction'].value",
          "                                                    ^---- HERE"
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Can't parse boolean value [1337x], expected [true] or [false]"
@przemekwitek przemekwitek added >bug :ml Machine learning labels Mar 24, 2020
@przemekwitek przemekwitek self-assigned this Mar 24, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@przemekwitek
Copy link
Contributor Author

I closed this issue as now the Evaluate API does not throw any strange script-related errors in face of type mismatch situation.

This approach may be revisited in the future. I can imagine adding a validation where we would check upfront what the actual and predicted fields types are and deciding whether this evaluation request makes sense or not.
Also, we may think of matching in a smart manner. E.g.: matching a boolean field (that only has true or false values) with a numeric field (that only has 1 or 0 values).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml Machine learning
Projects
None yet
2 participants