Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21306][ML] For branch 2.1, OneVsRest should support setWeightCol - #18763
[SPARK-21306][ML] For branch 2.1, OneVsRest should support setWeightCol#18763facaiy wants to merge 3 commits into
Conversation
## What changes were proposed in this pull request? add `setWeightCol` method for OneVsRest. `weightCol` is ignored if classifier doesn't inherit HasWeightCol trait. ## How was this patch tested? + [x] add an unit test. Author: Yan Facai (颜发才) <facai.yan@gmail.com> Closes#18554 from facaiy/BUG/oneVsRest_missing_weightCol. (cherry picked from commit a5a3189) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
## What changes were proposed in this pull request? add `setWeightCol` method for OneVsRest. `weightCol` is ignored if classifier doesn't inherit HasWeightCol trait. ## How was this patch tested? + [x] add an unit test. Author: Yan Facai (颜发才) <facai.yan@gmail.com> Closesapache#18554 from facaiy/BUG/oneVsRest_missing_weightCol. (cherry picked from commit a5a3189) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
ddb83da to
571739dCompare| test("SPARK-21306: OneVsRest should support setWeightCol") { | ||
| val dataset2 = dataset.withColumn("weight", lit(1)) | ||
| val dataset2 = dataset.withColumn("weight", lit(1.0)) |
There was a problem hiding this comment.
@yanboliang@srowen My mistake. It will be better to use double value 1.0 in master / branch-2.2 / branch-2.3 in the same way.
There was a problem hiding this comment.
@facaiy It doesn't matter, since weightCol supports any numeric type and will cast it to double type under the hood.
There was a problem hiding this comment.
OK. Could you test and merge the PR into branch 2.1?
yanboliang
commented
Jul 31, 2017
Jenkins, test this please. |
yanboliang
commented
Jul 31, 2017
@srowen Could you help to trigger this job? Thanks. |
SparkQA
commented
Jul 31, 2017
Test build #3866 has finished for PR 18763 at commit
|
yanboliang
commented
Aug 5, 2017
Jenkins, test this please. |
| weightCol = self.getWeightCol() | ||
| else: | ||
| warnings.warn("weightCol is ignored, " | ||
| "as it is not supported by {} now.".format(classifier)) |
There was a problem hiding this comment.
To pass Python2.6 test, we need to change this line to:
"as it is not supported by {0} now.".format(classifier))
There was a problem hiding this comment.
Modified as suggested, thanks very much!
yanboliang
commented
Aug 7, 2017
ok to test |
yanboliang
commented
Aug 7, 2017
Jenkins, test this please. |
gatorsmile
commented
Aug 7, 2017
ok to test |
SparkQA
commented
Aug 7, 2017
Test build #80345 has finished for PR 18763 at commit
|
The PR is related to #18554, and is modified for branch 2.1. ## What changes were proposed in this pull request? add `setWeightCol` method for OneVsRest. `weightCol` is ignored if classifier doesn't inherit HasWeightCol trait. ## How was this patch tested? + [x] add an unit test. Author: Yan Facai (颜发才) <facai.yan@gmail.com> Closes#18763 from facaiy/BUG/branch-2.1_OneVsRest_support_setWeightCol.
yanboliang
commented
Aug 8, 2017
Merged into branch-2.1. Thanks @facaiy@gatorsmile |
yanboliang
commented
Aug 8, 2017
It seems github can't close this PR automatically. @facaiy Please feel free to close it manually. Thanks. |
facaiy
commented
Aug 8, 2017
Thanks, all. |
The PR is related to apache#18554, and is modified for branch 2.1. add `setWeightCol` method for OneVsRest. `weightCol` is ignored if classifier doesn't inherit HasWeightCol trait. + [x] add an unit test. Author: Yan Facai (颜发才) <facai.yan@gmail.com> Closesapache#18763 from facaiy/BUG/branch-2.1_OneVsRest_support_setWeightCol.
The PR is related to #18554, and is modified for branch 2.1.
What changes were proposed in this pull request?
add
setWeightColmethod for OneVsRest.weightColis ignored if classifier doesn't inherit HasWeightCol trait.How was this patch tested?