MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestCategoryEncoders

Class TestCategoryEncoders

tests/test_category_encoders.py:8–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7## Need to make sure we have CountEncoder available from the category_encoders library
8class TestCategoryEncoders(unittest.TestCase):
9 def test_count_encoder(self):
10 encoder = CountEncoder(cols="data")
11
12 data = pd.DataFrame([1, 2, 3, 1, 4, 5, 3, 1], columns=["data"])
13
14 encoded = encoder.fit_transform(data)
15 self.assertTrue((encoded.data == [3, 1, 2, 3, 1, 1, 2, 3]).all())
16

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected