Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12663#discussion_r60959821
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala ---
    @@ -126,16 +126,8 @@ final class GBTClassifier @Since("1.4.0") (
       override protected def train(dataset: Dataset[_]): 
GBTClassificationModel = {
         val categoricalFeatures: Map[Int, Int] =
           MetadataUtils.getCategoricalFeatures(dataset.schema($(featuresCol)))
    -    val numClasses: Int = 
MetadataUtils.getNumClasses(dataset.schema($(labelCol))) match {
    -      case Some(n: Int) => n
    -      case None => throw new IllegalArgumentException("GBTClassifier was 
given input" +
    -        s" with invalid label column ${$(labelCol)}, without the number of 
classes" +
    -        " specified. See StringIndexer.")
    -      // TODO: Automatically index labels: SPARK-7126
    -    }
    -    require(numClasses == 2,
    -      s"GBTClassifier only supports binary classification but was given 
numClasses = $numClasses")
    --- End diff --
    
    This error message is somewhat more informative to users than 
https://github.com/apache/spark/pull/12663/files#diff-dfca98acb06778e7a51eb858829bd2a1R134,
 i.e. indicating that GBT only supports binary classification as of now. 
Perhaps we should preserve this somehow?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to