Data Discretization

Turkish equivalent: Veri AyrıklaştırmaDomain: Machine Learning

The transformation of continuous or fine-grained numerical values into a finite set of intervals or categories.

Data discretization converts numeric values into a finite set of intervals or category labels. It lowers resolution and may simplify threshold-based rules or reduce some noise, but numerical differences within each interval are lost.

For 15, 18, 29, 31, the boundaries [0,20) and [20,40) put the first two observations into one category and the other two into another. The original values remain distinct; their discretized representation does not retain those within-bin differences.

Boundary strategies are not interchangeable

Equal-width binning divides a range into intervals of constant length. Quantile binning chooses boundaries from empirical quantiles to seek balanced occupancy. Clustering-based strategies may place divisions around data concentrations. Supervised discretization is a different task because its boundaries can depend on the target variable.

Fit the transform on training data

If interval edges are estimated on the entire dataset before a train/test split, information about the test distribution can leak into training. Learned quantile or clustering edges should be fitted on the training partition and applied unchanged to validation and test partitions. Time-dependent datasets additionally require a defensible temporal cutoff.

Discretization is not universally beneficial. Decision trees already split numeric variables at thresholds, and information loss may hurt other predictors. A frequency table summarizes an observed distribution; a discretized feature may subsequently enter a predictive model.