IDAX.EWDISC_NICE - Discretization bins of equal width with human-friendly limits
Use this stored procedure to calculate the limits for discretization bins of equal width for numeric columns. The values for the limits are human-friendly numeric values.
Authorization
The privileges held by the authorization ID of the statement must include the IDAX_USER role.
Syntax
IDAX.EWDISC_NICE(in parameter_string varchar(32672))
Details
The width of the bins for a column is calculated as 6 * stddev / k, where k is the number of discretization bins that is requested for the column, and stddev is the standard deviation for the column values.
The width is then made nice by choosing the nearest scale 1, 2, 2.5, or 5 of a power of ten. The bin limits are set around the column mean value so that the bin limits become multiples of the nice width. The resulting number of bins might differ from the requested number of bins.
Parameter descriptions
- parameter_string
- Mandatory one-string parameter that contains pairs of <parameter>=<value> entries that are separated by a comma.
Returned information
INTEGER the number of columns for which the limits for the discretization bins are calculated.
Example
call IDAX.EWDISC_NICE('intable=SAMPLES.CUSTOMER_CHURN, outtable=CUSTOMER_CHURN_BINS, incolumn=AVG_SPENT_RETAIN_PM:5;ANNUAL_REVENUE_MIL, bins=10');
select COLNAME, BREAK from CUSTOMER_CHURN_BINS;