# make_column_selector

### *class* cuml.compose.make_column_selector(pattern=None, , dtype_include=None, dtype_exclude=None)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_column_transformer.py#L1146)

Create a callable to select columns to be used with
[`ColumnTransformer`](../cuml.compose.ColumnTransformer/index.html.md#cuml.compose.ColumnTransformer).

[`make_column_selector()`](#cuml.compose.make_column_selector) can select columns based on datatype or the
columns name with a regex. When using multiple selection criteria, **all**
criteria must match for a column to be selected.

* **Parameters:**
  **pattern**
  : Name of columns containing this regex pattern will be included. If
    None, column selection will not be selected based on pattern.

  **dtype_include**
  : A selection of dtypes to include. For more details, see
    `pandas.DataFrame.select_dtypes()`.

  **dtype_exclude**
  : A selection of dtypes to exclude. For more details, see
    `pandas.DataFrame.select_dtypes()`.

### Methods

| `__call__`(df)   | Call self as a function.   |
|------------------|----------------------------|
* **Returns:**
  **selector**
  : Callable for column selection to be used by a
    [`ColumnTransformer`](../cuml.compose.ColumnTransformer/index.html.md#cuml.compose.ColumnTransformer).

#### SEE ALSO
[`ColumnTransformer`](../cuml.compose.ColumnTransformer/index.html.md#cuml.compose.ColumnTransformer)
: Class that allows combining the outputs of multiple transformer objects used on column subsets of the data into a single feature space.

### Examples

```pycon
>>> from cuml.preprocessing import StandardScaler, OneHotEncoder
>>> from cuml.compose import make_column_transformer
>>> from cuml.compose import make_column_selector
>>> import cupy as cp
>>> import cudf
>>> X = cudf.DataFrame({'city': ['London', 'London', 'Paris', 'Sallisaw'],
...                    'rating': [5, 3, 4, 5]})
>>> ct = make_column_transformer(
...       (StandardScaler(),
...        make_column_selector(dtype_include=cp.number)),  # rating
...       (OneHotEncoder(),
...        make_column_selector(dtype_include=object)))  # city
>>> ct.fit_transform(X)
array([[ 0.90453403,  1.        ,  0.        ,  0.        ],
       [-1.50755672,  1.        ,  0.        ,  0.        ],
       [-0.30151134,  0.        ,  1.        ,  0.        ],
       [ 0.90453403,  0.        ,  0.        ,  1.        ]])
```

<!-- !! processed by numpydoc !! -->
