Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class IsotonicRegressionModel private[ml] (
def predictions: Vector = Vectors.dense(oldModel.predictions)

override def copy(extra: ParamMap): IsotonicRegressionModel = {
copyValues(new IsotonicRegressionModel(uid, oldModel), extra)
copyValues(new IsotonicRegressionModel(uid, oldModel), extra).setParent(parent)
}

override def transform(dataset: DataFrame): DataFrame = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark.ml.regression

import org.apache.spark.SparkFunSuite
import org.apache.spark.ml.param.ParamsSuite
import org.apache.spark.ml.util.MLTestingUtils
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.util.MLlibTestSparkContext
import org.apache.spark.sql.{DataFrame, Row}
Expand Down Expand Up @@ -89,6 +90,10 @@ class IsotonicRegressionSuite extends SparkFunSuite with MLlibTestSparkContext {
assert(ir.getFeatureIndex === 0)

val model = ir.fit(dataset)

// copied model must have the same parent.
MLTestingUtils.checkCopy(model)

model.transform(dataset)
.select("label", "features", "prediction", "weight")
.collect()
Expand Down