How to use the tpot.builtins.CategoricalSelector function in TPOT

To help you get started, we’ve selected a few TPOT examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EpistasisLab / tpot / tests / feature_transformers_tests.py View on Github external
def test_CategoricalSelector_fit():
    """Assert that fit() in CategoricalSelector does nothing."""
    op = CategoricalSelector()
    ret_op = op.fit(iris_data)

    assert ret_op==op
github EpistasisLab / tpot / tests / feature_transformers_tests.py View on Github external
def test_CategoricalSelector_2():
    """Assert that CategoricalSelector works as expected with threshold=5."""
    cs = CategoricalSelector(threshold=5)
    X_transformed = cs.transform(iris_data[0:16, :])

    assert_equal(X_transformed.shape[1],1)
github EpistasisLab / tpot / tests / feature_transformers_tests.py View on Github external
def test_CategoricalSelector_3():
    """Assert that CategoricalSelector works as expected with threshold=20."""
    cs = CategoricalSelector(threshold=20)
    X_transformed = cs.transform(iris_data[0:16, :])

    assert_equal(X_transformed.shape[1],7)
github EpistasisLab / tpot / tests / feature_transformers_tests.py View on Github external
def test_CategoricalSelector():
    """Assert that CategoricalSelector works as expected."""
    cs = CategoricalSelector()
    X_transformed = cs.transform(iris_data[0:16, :])

    assert_equal(X_transformed.shape[1],2)
github EpistasisLab / tpot / tests / feature_transformers_tests.py View on Github external
def test_CategoricalSelector_4():
    """Assert that CategoricalSelector rasies ValueError without categorical features."""
    cs = CategoricalSelector()

    assert_raises(ValueError, cs.transform, iris_data)