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 @@ -222,7 +222,7 @@ class CrossValidatorSuite
.setNumFolds(20)
.setEstimatorParamMaps(paramMaps)

ValidatorParamsSuiteHelpers.testFileMove(cv)
ValidatorParamsSuiteHelpers.testFileMove(cv, tempDir)
}

test("read/write: CrossValidator with complex estimator") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class TrainValidationSplitSuite
.setEstimatorParamMaps(paramMaps)
.setSeed(42L)

ValidatorParamsSuiteHelpers.testFileMove(tvs)
ValidatorParamsSuiteHelpers.testFileMove(tvs, tempDir)
}

test("read/write: TrainValidationSplitModel") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ package org.apache.spark.ml.tuning
import java.io.File
import java.nio.file.{Files, StandardCopyOption}

import org.apache.spark.SparkFunSuite
import org.scalatest.Assertions

import org.apache.spark.ml.param.{ParamMap, ParamPair, Params}
import org.apache.spark.ml.util.{DefaultReadWriteTest, Identifiable, MLReader, MLWritable}
import org.apache.spark.ml.util.{Identifiable, MLReader, MLWritable}

object ValidatorParamsSuiteHelpers extends SparkFunSuite with DefaultReadWriteTest {
object ValidatorParamsSuiteHelpers extends Assertions {
/**
* Assert sequences of estimatorParamMaps are identical.
* If the values for a parameter are not directly comparable with ===
Expand Down Expand Up @@ -62,7 +63,7 @@ object ValidatorParamsSuiteHelpers extends SparkFunSuite with DefaultReadWriteTe
* the path of the estimator so that if the parent directory changes, loading the
* model still works.
*/
def testFileMove[T <: Params with MLWritable](instance: T): Unit = {
def testFileMove[T <: Params with MLWritable](instance: T, tempDir: File): Unit = {
val uid = instance.uid
val subdirName = Identifiable.randomUID("test")

Expand Down