Data Drift feature histogram chart shows wrong values against category labels for categorical features (label/value order mismatch)

Ashutosh Singh 0 Reputation points
2026-08-12T07:28:32.81+00:00

For a categorical feature monitored under a Data Drift signal (Population Stability Index metric, tabular classification model), I compared the raw histogram JSON output (from model_monitor_metrics_output/signals/data_drift_signal/<feature>.histogram.json) against what Studio's "Feature breakdown" histogram chart displays for the same feature.

The raw JSON lists each category with its baselineCount/targetCount, in an arbitrary (not alphabetically sorted) order, e.g.:

category A: baselineCount 144102, targetCount 2648

category B: baselineCount 57231, targetCount 1016

category C: baselineCount 34449, targetCount 484

category D: baselineCount 181921, targetCount 10571

...

In Studio's histogram chart for this feature, the x-axis category labels are displayed in ALPHABETICAL order, but the bar heights (values) appear to remain in the ORIGINAL JSON order rather than being re-sorted to match. This causes a mismatch: e.g., hovering over the first (alphabetically first) category's bar shows a "Reference" value that actually belongs to a completely different category in the raw JSON.

I confirmed this by manually re-sorting the JSON array alphabetically by category name (keeping each category's name+value pair intact) — once pre-sorted this way, the chart's labels and values lined up correctly. This suggests the chart component sorts the label axis alphabetically for display but doesn't apply the same reordering to the corresponding value array, so values only end up correctly aligned when the source JSON coincidentally happens to already be in alphabetical order.

This is a significant issue for interpreting drift results, since it silently reassigns real values to the wrong category names without any visual indication that something is wrong — someone relying on the dashboard without cross-checking the raw JSON blob would draw incorrect conclusions about which category is actually drifting or has the largest reference/production count.

Could you confirm whether this is a known bug in the histogram rendering component, and whether there's a fix planned or a workaround (e.g., a way to force the chart to use the JSON's original category order instead of re-sorting alphabetically)?

Azure Machine Learning

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.