-
Notifications
You must be signed in to change notification settings - Fork 66
[FEATURE][ML] Wire outlier detection into the data_frame_analyzer command #334
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
Merged
tveasey
merged 11 commits into
elastic:feature/analysis-pipeline
from
tveasey:joining-the-dots-2
Dec 11, 2018
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5bfd13
Wire in outlier detection and writing results out from the data_frame…
tveasey 3a5c052
Formatting
tveasey cf8d764
Fix unit test fallout
tveasey bf892f9
Trigger run from end of data
tveasey 5b12af0
Missing include guard
tveasey 4d3cb00
Const correctness for write functions of CRapidJsonWriter*, improve c…
tveasey d618268
Factor out result writing into its own function
tveasey 4f7075c
Logging levels and leave TODOs to revisit error messages
tveasey bfd91e3
More review comments
tveasey 339873d
Still apparently getting occasional hang on linux in test environment…
tveasey 560c092
Use Key function to write JSON keys to make code clearer
tveasey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can the writer change per call? if not, can it be set at construction?
Uh oh!
There was an error while loading. Please reload this page.
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.
This is the object created here so not currently available at construction time of
CDataFrameAnalysisRunner. We could refactor so it is a member ofCDataFrameAnalyzerand only created once (rather than once per analysis, although currently this is equivalent). I think this would be a good idea, but I don't want to make that refactor now.That aside I'm not sure I'd want to make this a member of the
CDataFrameAnalysisRunner. Really, this function shouldn't require state from any implementation object. It isn't static in order to be virtual, because different analyses will want to extract different column values. However, all the information is coming from the row passed in and some local statics. So this feels extrinsic to a particular instance of the class and being forced to always create a row writer whenever you create aCDataFrameAnalysisRunnerobject feels undesirable to me.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.
understood, I am asking because this looks like the other extreme: supplying the write for every row. Looks like the reason for this is the extra wrapping required in
writeResultsOf.What about just accessing the data and doing the json'ification in
writeResultsOf, which would also get rid of forward declarations.Just suggestions.
Uh oh!
There was an error while loading. Please reload this page.
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.
The problem is we'd then need logic in this function for every single type of analysis. I quite like that the CDataFrameAnalyzer class is agnostic to the type of analyses it is running. To keep this it has to somehow pass off writing analysis specific parts of the results to the
CDataFrameAnalysisRunner.If I understand your suggestion correctly, we'd have to have a something like a big switch statement in writeResultsOf and some sort of identifier returned by each analyser.
Equally if all the logic in
writeResultsOfgets pushed down intoCDataFrameAnalysisRunnerimplementations we'd duplicate it for each different analysis.Note as well we capture the writer by reference in the lambda, so we only use one writer to write all rows (not one per row).
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.
sorry, I do not get that. All I see at the moment is writing 1 key and 1 value. No need for a big switch statement.
Uh oh!
There was an error while loading. Please reload this page.
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 mean down the line when we have additional analysis types (regression, etc) and these will all have their own runners (say
CDataFrameXGBoostRunner, etc). Each type of analysis will have its own column names and numbers of columns they want to write. This information can all be in thewriteResultsOf, but not without doing something like a switch statement. Additional analysis types are definitely coming, so this isn't premature generalisation.