In the Python version of the book, we just remap the values "B" and "M" to "Benign" and "Malignant" in the classification analysis, which then avoids us having to muck with legend labels
Joel's comment:
I think it is fragile to overwrite the data values in the legend and would not recommend anyone to do this. What if the order of the data changes, either because new data is added or we do some filtering? Then we might be mistakenly labeling B as Malign and there would be no easy way to find out. I think it is much better to change the values of the individual data points using dictionary like assignment that is robust to data reordering and therefore more reproducible.
In the Python version of the book, we just remap the values "B" and "M" to "Benign" and "Malignant" in the classification analysis, which then avoids us having to muck with legend labels
Joel's comment: