-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-18206][ML]Add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR #15671
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
Conversation
|
Test build #67700 has finished for PR 15671 at commit
|
|
Test build #67703 has finished for PR 15671 at commit
|
|
Test build #67704 has finished for PR 15671 at commit
|
|
Test build #67706 has finished for PR 15671 at commit
|
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.
These are already logged inside of RandomForest.run
7c74241 to
05e2f4d
Compare
|
@sethah Thanks. I have revert those changes in Tree-Algos. |
|
Test build #67741 has finished for PR 15671 at commit
|
|
@jkbradley @yanboliang Could you please make a reivew? |
|
Minor: would you mind changing the title to "Add instrumentation logs to ML training algorithms". I initially thought this PR was adding them to the old MLlib API, so I think it's a bit more clear. |
sethah
left a comment
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.
Left mostly minor comments. Let's create a JIRA for other meta algorithms like CrossValidator, TrainValidationSplit, and OneVSRest. Thanks for doing this!
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.
In general, we are trying to log all params that are useful, but not params that could overload logs. Since MLP has a initialWeights parameter that could potentially be very large, we should not include it here.
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.
ok, I will update it here, and other algos which support a initalModel
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.
nit: remove empty line
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.
Likewise here we probably should not log docConcentration.
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.
minor: instr.logSuccess(model)
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.
maybe we should not log quantileProbabilities? I am not familiar with this algorithm so I'm not sure if these can ever be too large.
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.
minor: move the logSuccess call after the copyValues. That way if we ever do something in logSuccess like logging parameters of the model, the call will reflect the copied parameters.
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.
Also, would you mind changing the doc in Instrumentation.logSuccess from:
"Logs the successful completion of the training session and the value of the learned model."
to
"Logs the successful completion of the training session."
Since we currently don't do anything other than log a string inside logSuccess.
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.
minor: move logSuccess after setSummary
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.
We need to log success if we enter the WeightedLeastSquares branch above as well. Maybe we can refactor the code to use if else instead of an if with a return. That way we only need to log success in one place.
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.
minor: move logSuccess after setSummary, here and elsewhere.
05e2f4d to
df8734e
Compare
|
@sethah Thanks for your reviewing. I have made changes according to your comments. And I will create JIRAs for meta algos. |
|
Test build #67878 has finished for PR 15671 at commit
|
|
I just made a subtask for the algs covered here. Can you please link this PR to SPARK-18206 in the title instead of the umbrella task? |
|
So, if we consistently use For now, I think I lean towards manually selecting which params to log rather than logging all params. If we add more params later we will have to remember to add them to the logging. What are others' thoughts? Alternatively, we could use a filter on certain types of params - like |
|
Good point. I agree with you about logging selected Params only. |
|
@sethah @jkbradley OK, I will link this pr to the subtask and change algos which use |
df8734e to
6d2d13f
Compare
|
Test build #67947 has finished for PR 15671 at commit
|
|
IMO, the way we're doing this logging right now is unsustainable. It requires too much manual work. We can leave this discussion for a different JIRA, but what we could do is modify the |
sethah
left a comment
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.
A few minor comments otherwise LGTM. Still, we definitely need to find a way to make this more sustainable.
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.
would you mind rewriting this if statement to:
val model = if (familyObj == Gaussian && linkObj == Identity) {
...
} else {
...
}
instr.logSuccess(model)
modelThen we can avoid the code duplication?
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.
OK, I will change this.
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.
add aggregationDepth
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.
OK, Thanks
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.
add aggregationDepth
6d2d13f to
e77bdc4
Compare
|
@sethah I have make changes according to the comments. Thanks for your reviewing. |
|
@sethah I agree that manually listing traceable params is prone to mistake. I think we can log all params expect some params which are labeled |
|
Test build #68039 has finished for PR 15671 at commit
|
|
I created SPARK-18253 to track it. We may have to get to it after 2.1 QA period. |
|
I don't want to truncate Param strings because it would create invalid JSON in case people want to try to catch and parse the logs. I like the idea of allowing exceptions and possibly adding unit tests to ensure the logs do not blow up. |
3e54b1f to
c8693d8
Compare
|
@jkbradley Update according to your comments, including adding |
|
Test build #70901 has finished for PR 15671 at commit
|
|
Test build #71064 has finished for PR 15671 at commit
|
|
ping @jkbradley |
|
Thanks for the updates! For docConcentration and quantileProbabilities, I agree it could be problematic if these are too large. How about:
|
|
Test build #71285 has finished for PR 15671 at commit
|
|
@jkbradley Updated. Thanks for reviewing! |
|
re-ping @jkbradley |
|
LGTM pending one more run of the tests Jenkins test this please |
|
Test build #3537 has finished for PR 15671 at commit
|
|
Merging with master |
…,LiR ## What changes were proposed in this pull request? add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR ## How was this patch tested? local test in spark-shell Author: Zheng RuiFeng <[email protected]> Author: Ruifeng Zheng <[email protected]> Closes apache#15671 from zhengruifeng/lir_instr.
…,LiR ## What changes were proposed in this pull request? add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR ## How was this patch tested? local test in spark-shell Author: Zheng RuiFeng <[email protected]> Author: Ruifeng Zheng <[email protected]> Closes apache#15671 from zhengruifeng/lir_instr.
What changes were proposed in this pull request?
add instrumentation for MLP,NB,LDA,AFT,GLM,Isotonic,LiR
How was this patch tested?
local test in spark-shell