Skip to content

Commit

Permalink
Test LabelEncoder.fit_transform with arbitrary labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblondel committed Aug 26, 2012
1 parent 56c6bfb commit 7107544
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sklearn/tests/test_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ def test_label_encoder_fit_transform():
ret = le.fit_transform([1, 1, 4, 5, -1, 0])
assert_array_equal(ret, [2, 2, 3, 4, 0, 1])

le = LabelEncoder()
ret = le.fit_transform(["paris", "paris", "tokyo", "amsterdam"])
assert_array_equal(ret, [1, 1, 2, 0])


def test_label_encoder_string_labels():
"""Test LabelEncoder's transform and inverse_transform methods with
Expand Down

0 comments on commit 7107544

Please sign in to comment.