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 or pandas.Series) – Data with categorical columns to encode.

Returns:

encoded – The transformed data with categorical columns encoded as integers. The output type will be the same as the input type.

Return type:

pandas.DataFrame or pandas.Series