smoothing_cluster: Smoothing by class-aware clustering

View source: R/trans_smoothing_cluster.R

smoothing_clusterR Documentation

Smoothing by class-aware clustering

Description

Discretize a numeric attribute into n bins by clustering the attribute together with a one-hot representation of the class label, then projecting the clusters back to ordered cut points on the numeric axis.

Usage

smoothing_cluster(class_label, n)

Arguments

class_label

name of the class attribute

n

number of bins

Value

returns an object of class smoothing_cluster

References

Han, J., Kamber, M., Pei, J. (2011). Data Mining: Concepts and Techniques. (Discretization)

Examples

data(iris)
cluster_data <- iris[, c("Sepal.Length", "Species")]
obj <- smoothing_cluster("Species", n = 2)
obj <- fit(obj, cluster_data)
sl.bi <- transform(obj, iris$Sepal.Length)
table(sl.bi)
obj$interval

bins <- cut(iris$Sepal.Length, unique(obj$interval.adj), FALSE, include.lowest = TRUE)
entro <- evaluate(obj, bins, iris$Species)
entro$entropy

daltoolbox documentation built on May 14, 2026, 9:06 a.m.