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

    https://github.com/apache/spark/pull/15435#discussion_r133830499
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
 ---
    @@ -199,15 +199,57 @@ class LogisticRegressionSuite
         }
       }
     
    -  test("empty probabilityCol") {
    -    val lr = new LogisticRegression().setProbabilityCol("")
    -    val model = lr.fit(smallBinaryDataset)
    -    assert(model.hasSummary)
    -    // Validate that we re-insert a probability column for evaluation
    -    val fieldNames = model.summary.predictions.schema.fieldNames
    -    assert(smallBinaryDataset.schema.fieldNames.toSet.subsetOf(
    -      fieldNames.toSet))
    -    assert(fieldNames.exists(s => s.startsWith("probability_")))
    +  test("empty probabilityCol or predictionCol") {
    +    val lr = new LogisticRegression().setMaxIter(1)
    +    val datasetFieldNames = smallBinaryDataset.schema.fieldNames.toSet
    +    def checkSummarySchema(model: LogisticRegressionModel, columns: 
Seq[String]): Unit = {
    +      val fieldNames = model.summary.predictions.schema.fieldNames
    +      assert(model.hasSummary)
    +      assert(datasetFieldNames.subsetOf(fieldNames.toSet))
    +      columns.foreach { c => assert(fieldNames.exists(_.startsWith(c))) }
    +    }
    +    // check that the summary model adds the appropriate columns
    +    Seq(("binomial", smallBinaryDataset), ("multinomial", 
smallMultinomialDataset)).foreach {
    +      case (family, dataset) =>
    --- End diff --
    
    You are not using "dataset" in this.  However, this logic should be the 
same for both binomial and multinomial families, so I'm OK if you just test the 
binomial case here.


---
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