Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Jul 12, 2024
1 parent 249a428 commit 2fab5f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_train_test_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_train_test_split():
table = ibis.memtable({"key1": range(N)})

train_table, test_table = ml.train_test_split(
table, unique_key="key1", test_size=test_size, random_state=42
table, unique_key="key1", test_size=test_size, random_seed=42
)

# Check counts and overlaps in train and test dataset
Expand All @@ -19,14 +19,14 @@ def test_train_test_split():

# Check reproducibility
reproduced_train_table, reproduced_test_table = ml.train_test_split(
table, unique_key="key1", test_size=test_size, random_state=42
table, unique_key="key1", test_size=test_size, random_seed=42
)
tm.assert_frame_equal(train_table.execute(), reproduced_train_table.execute())
tm.assert_frame_equal(test_table.execute(), reproduced_test_table.execute())

# make sure it could generate different data with different random state
# make sure it could generate different data with different random_seed
different_train_table, different_test_table = ml.train_test_split(
table, unique_key="key1", test_size=test_size, random_state=0
table, unique_key="key1", test_size=test_size, random_seed=0
)
assert not train_table.execute().equals(different_train_table.execute())
assert not test_table.execute().equals(different_test_table.execute())

0 comments on commit 2fab5f5

Please sign in to comment.