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

    https://github.com/apache/spark/pull/12663#discussion_r61312547
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/Classifier.scala ---
    @@ -62,6 +65,57 @@ abstract class Classifier[
       def setRawPredictionCol(value: String): E = set(rawPredictionCol, 
value).asInstanceOf[E]
     
       // TODO: defaultEvaluator (follow-up PR)
    +
    +  /**
    +   * Extract [[labelCol]] and [[featuresCol]] from the given dataset,
    +   * and put it in an RDD with strong types.
    +   * @throws SparkException  if any label is not an integer >= 0
    +   */
    +  override protected def extractLabeledPoints(dataset: Dataset[_]): 
RDD[LabeledPoint] = {
    +    dataset.select(col($(labelCol)).cast(DoubleType), 
col($(featuresCol))).rdd.map {
    +      case Row(label: Double, features: Vector) =>
    +        require(label % 1 == 0 && label >= 0, s"Classifier was given 
dataset with invalid label" +
    --- End diff --
    
    Better yet, I'll just change this to take and check numClasses


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to