sksurv.column.categorical_to_numeric#

sksurv.column.categorical_to_numeric(table)[source]#

Encode categorical features as integers.

This function converts each category to a unique integer value.

Parameters:

table (pandas.DataFrame, pandas.Series, polars.DataFrame, or polars.Series) – Data with categorical columns to encode.

Returns:

encoded – The transformed data with categorical columns encoded as integers. The output dataframe library matches the input.

Return type:

pandas.DataFrame, pandas.Series, or polars.DataFrame / polars.Series