-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Refactor change point detection #114289
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
Refactor change point detection #114289
Conversation
|
Pinging @elastic/ml-core (Team:ML) |
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.
Overall LGTM. I think maybe even a little more should move to ChangeDetector than you currently have, as per comments, but happy for you to merge without another review from me.
...ugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregator.java
Outdated
Show resolved
Hide resolved
...ugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregator.java
Outdated
Show resolved
Hide resolved
87ff70e to
07d1dbd
Compare
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. I have one suggestion on the naming
| * ChangeDetector and SpikeAndDipDetector on it. This is the main entrypoint | ||
| * of change point detection. | ||
| */ | ||
| public class ChangePointDetector { |
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.
I know it is in keeping with the aggregation name, but I think we can do better on the naming. For me something like point of interest is better.
| public class ChangePointDetector { | |
| public class PointOfInterestDetector { |
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.
Not sure if "point of interest" is that much better. E.g. it doesn't capture (non-)stationary that well.
Given that the agg is called "Change Point Aggregation" right now, I'd rather keep it like this. If we decide the ES|QL variant will be called differently (suggestions are welcome!), we can always rename it then.
* Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file
* Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file
* Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file
* Refactor change point detection (#114289) * Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file * Fix change point detection for uncertain non-stationary distributions. (#119578) * Fix change point detection for uncertain non-stationary distributions. * Replace -1 by ChangeType.NO_CHANGE_POINT
* Refactor change point detection (#114289) * Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file * Fix change point detection for uncertain non-stationary distributions. (#119578) * Fix change point detection for uncertain non-stationary distributions. * Replace -1 by ChangeType.NO_CHANGE_POINT
* Refactor change point detection (#114289) * Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file * Fix change point detection for uncertain non-stationary distributions. (#119578) * Fix change point detection for uncertain non-stationary distributions. * Replace -1 by ChangeType.NO_CHANGE_POINT
* Refactor change point detection (elastic#114289) * Move change detection code to separate class * Uniformize ChangeDetector and SkipeAndDipDetector * Separate ChangeDetectorTests and ChangePointAggregatorTests. * Public entrypoint for change point detection * Move p-value computation to ChangeDetector * Move main entrypoint to a separate file * Fix change point detection for uncertain non-stationary distributions. (elastic#119578) * Fix change point detection for uncertain non-stationary distributions. * Replace -1 by ChangeType.NO_CHANGE_POINT
The main change is moving change detection to a separate class (out of the aggregator), and creating a single entrypoint for change point detection (
ChangePointAggregator::getChangeType), where an ES|QL implementation can hook into. Futhermore, I refactored a bit to make change detection and spike-and-dip detection more uniform.