viirya commented on a change in pull request #23773: [SPARK-26721][ML] Avoid
per-tree normalization in featureImportance for GBT
URL: https://github.com/apache/spark/pull/23773#discussion_r257454559
##########
File path:
mllib/src/test/scala/org/apache/spark/ml/classification/GBTClassifierSuite.scala
##########
@@ -363,7 +363,8 @@ class GBTClassifierSuite extends MLTest with
DefaultReadWriteTest {
val gbtWithFeatureSubset = gbt.setFeatureSubsetStrategy("1")
val importanceFeatures = gbtWithFeatureSubset.fit(df).featureImportances
val mostIF = importanceFeatures.argmax
- assert(mostImportantFeature !== mostIF)
+ assert(mostIF === 1)
Review comment:
Thanks @mgaido91.
I don't have a workable laptop in recent days. So it is hardly for me to run
the unit test. That is why I ask for more details.
Sounds that this assertion `assert(importances(mostImportantFeature) !==
importanceFeatures(mostIF))` makes sense. But for `assert(mostIF === 1)`,
because it picks one random feature per time, are we sure that the most
importance feature is `1` at all cases? In extreme case, this feature might not
be chosen at all. It is potentially flaky. This assertion doesn't make too much
sense to me, maybe we don't need it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]