Github user sethah commented on a diff in the pull request: https://github.com/apache/spark/pull/16441#discussion_r94868309 --- Diff: mllib/src/test/scala/org/apache/spark/ml/classification/GBTClassifierSuite.scala --- @@ -66,10 +66,39 @@ class GBTClassifierSuite extends SparkFunSuite with MLlibTestSparkContext ParamsSuite.checkParams(new GBTClassifier) val model = new GBTClassificationModel("gbtc", Array(new DecisionTreeRegressionModel("dtr", new LeafNode(0.0, 0.0, null), 1)), - Array(1.0), 1) + Array(1.0), 1, 2) ParamsSuite.checkParams(model) } + test("Verify raw scores correspond to labels") { + val rawPredictionCol = "MyRawPrediction" + val predictionCol = "MyPrediction" + val labelCol = "label" + val featuresCol = "features" + val gbt = new GBTClassifier() + .setMaxDepth(2) + .setLossType("logistic") + .setMaxIter(5) + .setStepSize(0.1) + .setCheckpointInterval(2) + .setSeed(123) + .setRawPredictionCol(rawPredictionCol) + .setPredictionCol(predictionCol) + .setLabelCol(labelCol) + .setFeaturesCol(featuresCol) + val gbtModel = gbt.fit(trainData.toDF(labelCol, featuresCol)) + val scoredData = gbtModel.transform(validationData.toDF(labelCol, featuresCol)) + scoredData.select(rawPredictionCol, predictionCol).collect() + .foreach(row => { --- End diff -- you can use `.foreach { case Row(raw: DenseVector, pred: Double, prob: DenseVector) => ... }` 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