Datasets / Breast cancer diagnostic
Measurements ranked by separation between diagnoses
The gap between the two group means, divided by their pooled spread - the same effect size a statistician would reach for, so measurements in different units can be ranked together.
How it decided
Breast cancer diagnostic: 569 rows, 31 columns. all thirty measurements, grouped by diagnosis.
569 rows in, 8 out across 2 columns. The gap between the two group means, divided by their pooled spread - the same effect size a statistician would reach for, so measurements in different units can be ranked together.
hbar. A ranking of long-named measurements: horizontal bars.
Palette, spacing, axis titles and legend placement applied. 0 issues found.
The transformation
This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.
groups = df.groupby("diagnosis")
means, spreads = groups.mean(numeric_only=True), groups.std(numeric_only=True)
effect = (means.loc["malignant"] - means.loc["benign"]).abs() / (
(spreads.loc["malignant"] + spreads.loc["benign"]) / 2
)
result = (
effect.sort_values(ascending=False).head(8)
.rename("separation").reset_index()
.rename(columns={"index": "measurement"})
)
What it charted
8 rows out of 569, 2 columns. First 8 shown.
| measurement | separation |
|---|---|
| worst_concave_points | 2.6257 |
| worst_perimeter | 2.5295 |
| mean_concave_points | 2.4769 |
| worst_radius | 2.4757 |
| worst_area | 2.2674 |
| mean_perimeter | 2.2155 |
| mean_radius | 2.1331 |
| mean_area | 2.0532 |