create_features_split_regular_bins#

tangles.convenience.create_features_split_regular_bins(single_col_data: Series | ndarray, num_bins: int = 5, invalid_values: list | ndarray | None = None) Tuple[ndarray, ndarray]#

A feature factory function creating features splitting the variable’s range into equally sized bins .

The variable’s range is split into regular bins, that is, into intervals of the same size. One feature is created for each bin.

Each feature describes the subset of respondents whose answer to the variable’s question was inside the bin.

Parameters#

single_col_datapd.Series or np.ndarray

The featured data.

num_binsint

The data’s range is split into this number of sections.

invalid_valueslist or np.ndarray

The invalid values in single_col_data.

Returns#

tuple[np.ndarray, np.ndarray]

The features in the first entry and the corresponding metadata in the second entry.