O'Reilly logo

Effective Amazon Machine Learning by Alexis Perrier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binning numeric values

The final and most important transformation is quantile binning. The goal with quantile binning is to transform a numeric variable into a categorical one in order to better extract the relation between the variable and the prediction target. This is particularly useful in the presence of nonlinearities between a variable and the target. By splitting the original numeric variables values into n bins of equal size, it is possible to substitute each value by a corresponding bin. Since the number of bins is finite (from 2 to 1,000), the variable is now categorical. Syntax is quantile_bin(var, N) with N the number of bins.

There are two types of unsupervised binning, equal frequency and equal width binning. In equal frequency, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required