generated from DanielAvdar/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, color mapping in Tab-right plots uses min/max or assumes values are normalized, which can result in inconsistent or misleading color scales—especially in the presence of outliers. There is a need for a more robust and automatic coloring approach that uses the overall (global) average and standard deviation of the metric values for all plots.
Proposed Solution:
- Remove the requirement for users to select a color scaling method.
- Color mapping will always be inferred automatically using the global mean and standard deviation of the metric values.
- The color scale should cover [mean - kstd, mean + kstd] (with k=2 by default) and values outside this range should be clamped.
- All plots will use this general scaling, ensuring consistent color interpretation.
- Update plot documentation/examples to reflect this automatic, data-driven color mapping.
Benefits:
- Fully automatic and robust color mapping.
- Consistent color interpretation across all plots.
- No need for users to manually select or configure normalization methods.
- More resilient to outliers and varying metric ranges.
Example Implementation:
def normalize_scores(scores, k=2):
mean = np.mean(scores)
std = np.std(scores)
vmin = mean - k * std
vmax = mean + k * std
clipped = np.clip(scores, vmin, vmax)
return (clipped - vmin) / (vmax - vmin + 1e-8)Additional Context:
This update will simplify plot configuration, improve usability, and ensure that color always reflects the distribution of the data in a statistically robust manner.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels