elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
68.54k stars 24.34k forks source link

[ML] Inconsistent validation of detectors between Java and C++ #29843

Open elasticmachine opened 6 years ago

elasticmachine commented 6 years ago

Original comment by @davidkyle:

The x-pack plugin allows you to use the non_null_sum function with an over_field

But when you open the job autodetect rejects this configuration

EMAIL REDACTED Function non_null_sum() cannot be used with an 'over' field
EMAIL REDACTED Failed to process token 'non_null_sum(derivative)'

bool CFieldConfig::isPopulation(EFunction function) returns false for this function

Resolve this conflict.

elasticmachine commented 6 years ago

Original comment by @tveasey:

This needs updating on the Java side IMO: sum / non_null_sum are equivalent for population analysis. Arguably it would be cleaner to only support non_zero_count/non_null_sum for population analysis, but this will create backwards compatibility issues. I don't think this is confusing enough to warrant a breaking change.

elasticmachine commented 6 years ago

Original comment by @davidkyle:

The docs also say non_null_sum cannot be used with an over field

elasticmachine commented 6 years ago

Original comment by @davidkyle:

According to the docs these functions cannot be used with an over field by that isn't enforced in code.

freq_rare requires an over field in code but not according to the docs

elasticmachine commented 6 years ago

Original comment by @droberts195:

In the case of freq_rare it’s the docs that are wrong. This function only makes sense with both a by and over field.

I agree that for the other 3 it’s better to change the validation in the Java code, due to BWC reasons.

elasticmachine commented 6 years ago

Original comment by @davidkyle:

I updated the docs for freq_rare

elasticmachine commented 6 years ago

Original comment by @davidkyle:

Relates to LINK REDACTED

elasticsearchmachine commented 1 week ago

Pinging @elastic/ml-core (Team:ML)