View source: R/trans_smoothing_cluster.R
| smoothing_cluster | R Documentation |
Quantize a numeric vector into n levels using k‑means on the values and
replace each value by its cluster mean (vector quantization).
smoothing_cluster(n)
n |
number of bins |
returns an object of class smoothing_cluster
MacQueen, J. (1967). Some Methods for classification and Analysis of Multivariate Observations.
data(iris)
obj <- smoothing_cluster(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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.