Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
single seed + check for deterministic results across multiple runs
  • Loading branch information
sameeragarwal committed Jan 7, 2016
commit 56d9bd7f05d0d294826ae541e0725d92eeeb0b08
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ class DataFrameStatSuite extends QueryTest with SharedSQLContext {
s"split $id overlaps with split ${(id + 1) % splits.length}")
}

// Verify sample sizes
val s = splits.map(_.count())
assert(math.abs(s(0) - 100) < 50) // std = 9.13
assert(math.abs(s(1) - 200) < 50) // std = 11.55
assert(math.abs(s(2) - 300) < 50) // std = 12.25

// Verify that the results are deterministic across multiple runs
val firstRun = splits.toSeq.map(_.collect().toSeq)
val secondRun = data.randomSplit(Array[Double](1, 2, 3), seed = 1).toSeq.map(_.collect().toSeq)
assert(firstRun == secondRun)
}

test("pearson correlation") {
Expand Down