[SPARK-13962][ML] spark.ml Evaluators should support other numeric types for label#12500
[SPARK-13962][ML] spark.ml Evaluators should support other numeric types for label#12500BenFradet wants to merge 8 commits intoapache:masterfrom BenFradet:SPARK-13962
Conversation
|
Test build #56235 has finished for PR 12500 at commit
|
|
Test build #56259 has finished for PR 12500 at commit
|
|
pinging @MLnick |
| (prediction, label) | ||
| .rdd | ||
| .map { | ||
| case Row(prediction: Double, label: Double) => (prediction, label) |
There was a problem hiding this comment.
minor but can this fit on one line? or have .map { case Row ... }
|
LGTM. Will leave open a little while in case anyone else wants to take a look. @sethah? |
| * @return DataFrame with metadata | ||
| */ | ||
| def setMetadata(data: DataFrame, numClasses: Int, labelColName: String): DataFrame = { | ||
| def setMetadata(data: DataFrame, |
There was a problem hiding this comment.
Follow Spark style here:
def setMetadata(
data: DataFrame,
numClasses: Int,
labelColName: String,
featuresColName: String): DataFrame = {|
A couple minor syntax comments, other than that LGTM. |
|
Test build #56553 has finished for PR 12500 at commit
|
| val thrown = intercept[IllegalArgumentException] { | ||
| evaluator.evaluate(dfWithStringLabels) | ||
| } | ||
| assert(thrown.getMessage contains |
There was a problem hiding this comment.
Minor style issue, but Spark code style prefers not to use infix notation (see https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide). Could you do thrown.getMessage.contains(...) instead? And also change the occurrence above in L57.
|
@BenFradet just one more minor style comment, then I think this is ready to merge. |
|
@MLnick will do |
|
Test build #56916 has finished for PR 12500 at commit
|
|
@BenFradet Thanks! Merged to master. Thanks @sethah for the review. |
What changes were proposed in this pull request?
Made BinaryClassificationEvaluator, MulticlassClassificationEvaluator and RegressionEvaluator accept all numeric types for label
How was this patch tested?
Unit tests