mlresearch.utils.feature_to_color

mlresearch.utils.feature_to_color(col, cmap='RdYlBu_r')[source]

Converts a column of values to hex-type colors.

Parameters:
col{list, array-like} of shape (n_samples,)

Values to convert to hex-type color code

cmapstr or ~matplotlib.colors.Colormap

The colormap used to map normalized data values to RGBA colors

Returns:
colorsarray-like of shape (n_samples,)

Array with hex values as string type.