Learn R Programming

daltoolbox (version 1.2.747)

smoothing: Smoothing (binning/quantization)

Description

Family of smoothing methods that reduce noise by replacing values with the mean of a bin/cluster. Supported strategies: equal‑interval bins, equal‑frequency (quantile) bins, and clustering‑based bins (k‑means).

Usage

smoothing(n)

Value

returns an object of class smoothing

Arguments

n

number of bins

Details

The smoothing level is controlled by n (number of bins/levels). The helper tune() can choose an n by locating the elbow (maximum curvature) of the MSE curve across candidates. After fit(), values are mapped to bin means via transform().

Examples

Run this code
data(iris)
obj <- smoothing_inter(n = 2)
obj <- fit(obj, iris$Sepal.Length)
sl.bi <- transform(obj, iris$Sepal.Length)
table(sl.bi)
obj$interval

entro <- evaluate(obj, as.factor(names(sl.bi)), iris$Species)
entro$entropy

Run the code above in your browser using DataLab