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

    https://github.com/apache/spark/pull/9912#discussion_r55603761
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/classification/RandomForestClassifierSuite.scala
 ---
    @@ -167,19 +167,15 @@ class RandomForestClassifierSuite extends 
SparkFunSuite with MLlibTestSparkConte
           .setSeed(123)
     
         // In this data, feature 1 is very important.
    -    val data: RDD[LabeledPoint] = sc.parallelize(Seq(
    -      new LabeledPoint(0, Vectors.dense(1, 0, 0, 0, 1)),
    -      new LabeledPoint(1, Vectors.dense(1, 1, 0, 1, 0)),
    -      new LabeledPoint(1, Vectors.dense(1, 1, 0, 0, 0)),
    -      new LabeledPoint(0, Vectors.dense(1, 0, 0, 0, 0)),
    -      new LabeledPoint(1, Vectors.dense(1, 1, 0, 0, 0))
    -    ))
    +    val data: RDD[LabeledPoint] = TreeTests.featureImportanceData(sc)
         val categoricalFeatures = Map.empty[Int, Int]
         val df: DataFrame = TreeTests.setMetadata(data, categoricalFeatures, 
numClasses)
     
         val importances = rf.fit(df).featureImportances
         val mostImportantFeature = importances.argmax
         assert(mostImportantFeature === 1)
    +    assert(importances.toArray.sum === 1.0)
    --- End diff --
    
    Thank you!


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