View source: R/trans_smoothing_cluster.R
smoothing_cluster | R Documentation |
Uses clustering method to perform data smoothing. The input vector is divided into clusters using the k-means algorithm. The mean of each cluster is then calculated and used as the smoothed value for all observations within that cluster.
smoothing_cluster(n)
n |
number of bins |
returns an object of class smoothing_cluster
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.