# NOT RUN {
devAskNewPage(ask = TRUE)
data("wine")
# Show level attributes.
levels(factor(wine[["Cultivar"]]))
# Split dataset into train (75<!-- %) and test (25%) subsets. -->
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(Wine@ntrain)
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 = Wine@train,
Preprocessing = "Parzen window",
cmax = 10,
Criterion = "ICL-BIC",
pdf = rep("normal", 13),
K = K[1]:K[2],
Restraints = "loose")
plot(wineest, pos = 1, nrow = 7, ncol = 6, what = c("den"))
plot(wineest, pos = 2, nrow = 7, ncol = 6, what = c("den"))
plot(wineest, pos = 3, nrow = 7, ncol = 6, what = c("den"))
# Selected chunks.
winecla <- RCLSMIX(model = "RCLSMVNORM",
x = list(wineest),
Dataset = Wine@test,
Zt = Wine@Zt)
winecla
summary(winecla)
# Plot selected chunks.
plot(winecla, nrow = 7, ncol = 6)
# }
Run the code above in your browser using DataLab