smoothing_cluster: Smoothing by cluster

View source: R/trans_smoothing_cluster.R

smoothing_clusterR Documentation

Smoothing by cluster

Description

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.

Usage

smoothing_cluster(n)

Arguments

n

number of bins

Value

obj

Examples

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

daltoolbox documentation built on May 29, 2024, 1:57 a.m.