Data Range

Create a function to compress data into a specific range of values.

Chapter Goals:

  • Learn how to compress data values to a specified range

A. Range scaling

Apart from standardizing data, we can also scale data by compressing it into a fixed range. One of the biggest use cases for this is compressing data into the range [0, 1]. This allows us to view the data in terms of proportions, or percentages, based on the minimum and maximum values in the data.

The formula for scaling based on a range is a two-step process. For a given data value, x, we first compute the proportion of the value with respect to the min and max of the data dmin and dmax, respectively).

xprop=xdmindmaxdminx_{prop} = \frac{x - d_{min}}{d_{max} - d_{min}} ...