Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/9008#discussion_r53092821
--- Diff:
mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala
---
@@ -275,6 +278,63 @@ class DecisionTreeClassifierSuite extends
SparkFunSuite with MLlibTestSparkConte
val model = dt.fit(df)
}
+ test("training with weighted data") {
+ val (dataset, weightedDataset) = {
+ val testData1 = TreeTests.generateNoisyData(5, 123)
+ val testData2 = TreeTests.generateNoisyData(5, 456)
+
+ // Over-sample the 1st dataset twice.
+ val overSampledTestData1 = testData1.flatMap {
+ labeledPoint => Iterator(labeledPoint, labeledPoint)
+ }
+
+ val rnd = new Random(8392)
+ val weightedTestData1 = testData1.flatMap {
--- End diff --
It is not obvious what the code is doing here. A comment might be useful to
point out that you are weighting each sample by 2x, effectively, by using
weighted?
---
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]