-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20249][ML][PYSPARK] Add training summary for LinearSVCModel #28884
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 #124333 has finished for PR 28884 at commit
|
zhengruifeng
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.
In general LGTM
this is the first case to use rawPrediction to compute aur/prc in summaries.
| * the current model | ||
| */ | ||
| private[classification] def findSummaryModel(): | ||
| (LinearSVCModel, String, String) = { |
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:
private[classification] def findSummaryModel(): (LinearSVCModel, String, String) = { ?
| /** | ||
| * Abstraction for LinearSVC results for a given model. | ||
| */ | ||
| sealed trait LinearSVCSummary extends BinaryClassificationSummary { |
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: uncessary braces
| * Abstraction for LinearSVC training results. | ||
| */ | ||
| sealed trait LinearSVCTrainingSummary extends LinearSVCSummary with TrainingSummary { | ||
| } |
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.
ditto
| val intercept = if ($(fitIntercept)) rawCoefficients.last else 0.0 | ||
| copyValues(new LinearSVCModel(uid, Vectors.dense(coefficientArray), intercept)) | ||
| val vec = Vectors.dense(coefficientArray) | ||
| return createModel(dataset, vec, intercept, objectiveHistory) |
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'd like: createModel(dataset, Vectors.dense(coefficientArray), intercept, objectiveHistory)
var vec and return are unnecessary
|
Test build #124386 has finished for PR 28884 at commit
|
|
cc @srowen |
|
Looking good. There's really no downside here right? just works like the other summaries, and is adding this for consistency. |
|
Right, it works like the other summaries. I don't see any downside for this. |
|
Thanks! @srowen @zhengruifeng |
What changes were proposed in this pull request?
Add training summary for LinearSVCModel......
Why are the changes needed?
so that user can get the training process status, such as loss value of each iteration and total iteration number.
Does this PR introduce any user-facing change?
Yes
LinearSVCModel.summaryLinearSVCModel.evaluateHow was this patch tested?
new tests