if (FALSE) {
devAskNewPage(ask = TRUE)
data(wine)
# Show level attributes.
levels(factor(wine[["Cultivar"]]))
# Split dataset into train (75
set.seed(3)
Wine <- split(p = 0.75, Dataset = wine, class = 14)
# Estimate number of components, component weights and component
# parameters for train subsets.
n <- range(a.ntrain(Wine))
K <- c(as.integer(1 + log2(n[1])), # Minimum v follows Sturges rule.
as.integer(10 * log10(n[2]))) # Maximum v follows log10 rule.
K <- c(floor(K[1]^(1/13)), ceiling(K[2]^(1/13)))
wineest <- REBMIX(model = "REBMVNORM",
Dataset = a.train(Wine),
Preprocessing = "kernel density estimation",
cmax = 10,
Criterion = "ICL-BIC",
pdf = rep("normal", 13),
K = K[1]:K[2],
Restraints = "loose",
Mode = "outliersplus")
plot(wineest, pos = 1, nrow = 7, ncol = 6, what = c("pdf"))
plot(wineest, pos = 2, nrow = 7, ncol = 6, what = c("pdf"))
plot(wineest, pos = 3, nrow = 7, ncol = 6, what = c("pdf"))
# Selected chunks.
winecla <- RCLSMIX(model = "RCLSMVNORM",
x = list(wineest),
Dataset = a.test(Wine),
Zt = a.Zt(Wine))
winecla
summary(winecla)
# Plot selected chunks.
plot(winecla, nrow = 7, ncol = 6)
}
Run the code above in your browser using DataLab