4.5 BINNING BASED ON PREDICTIVE VALUE
Some algorithms work better with categorical rather than numeric variables, so it may be useful for the analyst to use binning to derive new categorical variables based on how the different sets of values of the numeric predictor behave with respect to the response. For example, take Figure 4.7. To optimize our signal from the data, we ask ourselves: How can we categorize the numerical values of age so that the categories had widely varying response proportions? Clearly, one category would be the customers aged 60 and up, who have a high response proportion. This is in contrast to the middle group (somewhere in the mid‐20s up to 60) which has a low response probability. Finally, there is the youngest group (up to mid‐20s) which also has a high response proportion. Thus, we could define our new variable somewhat as follows (the 27 cutoff is a bit arbitrary; 25 or 26 would also work):
![equation](https://static.packt-cdn.com/products/9781119526810/graphics/images/c4-disp-0001.png)
Figure...