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.
Data type: VARCHAR(32672)
The following list shows the parameter values:
intable
Mandatory.
The name of the input table.
Data type: VARCHAR(ANY)
outtable
Mandatory.
The name of the output table where the limit for the discretization bins is to be stored.
The colname column references the name of the columns of the input table columns.
The break column a bin limit for this column.
Data type: VARCHAR(ANY)
incolumn
Mandatory.
The columns of the input table that are separated by a semi-colon (;).
Each column name can be followed by a colon (:) and the number of discretization bins that are to be calculated for this column.
Data type: VARCHAR(ANY)
bins
Optional.
The default number of discretization bins that are to be calculated.
Default: 10
Data type: INTEGER

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;