imatiach-msft commented on a change in pull request #21632: 
[SPARK-19591][ML][MLlib] Add sample weights to decision trees
URL: https://github.com/apache/spark/pull/21632#discussion_r250233505
 
 

 ##########
 File path: mllib/src/test/scala/org/apache/spark/ml/util/MLTestingUtils.scala
 ##########
 @@ -268,4 +269,20 @@ object MLTestingUtils extends SparkFunSuite {
     assert(newDatasetF.schema(featuresColName).dataType.equals(new 
ArrayType(FloatType, false)))
     (newDataset, newDatasetD, newDatasetF)
   }
+
+  def modelPredictionEquals[M <: PredictionModel[_, M]](
 
 Review comment:
   yes, I already made the tolerance looser in latest commit for the regressor 
(maybe you are not looking at latest code?).  Note for classifier there is no 
tolerance. See update:
   ```
         
MLTestingUtils.testArbitrarilyScaledWeights[DecisionTreeRegressionModel, 
           DecisionTreeRegressor](df.as[LabeledPoint], estimator, 
           MLTestingUtils.modelPredictionEquals(df, _ ~= _ relTol 0.1, 0.99)) 
         
MLTestingUtils.testOutliersWithSmallWeights[DecisionTreeRegressionModel, 
           DecisionTreeRegressor](df.as[LabeledPoint], estimator, numClasses, 
           MLTestingUtils.modelPredictionEquals(df, _ ~= _ relTol 0.1, 0.99), 
           outlierRatio = 2) 
         
MLTestingUtils.testOversamplingVsWeighting[DecisionTreeRegressionModel, 
           DecisionTreeRegressor](df.as[LabeledPoint], estimator, 
           MLTestingUtils.modelPredictionEquals(df, _ ~= _ relTol 0.01, 1.0), 
seed)
   ```

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

Reply via email to