# NOT RUN {
devAskNewPage(ask = TRUE)
data("iris")
# Show level attributes.
levels(iris[["Class"]])
# Split dataset into train (75<!-- %) and test (25%) subsets. -->
set.seed(5)
Iris <- split(p = 0.75, Dataset = iris, class = 5)
# Estimate number of components, component weights and component
# parameters for train subsets.
n <- range(Iris@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/4)), ceiling(K[2]^(1/4)))
irisest <- REBMIX(model = "REBMVNORM",
Dataset = Iris@train,
Preprocessing = "Parzen window",
cmax = 10,
Criterion = "ICL-BIC",
pdf = rep("normal", 4),
K = K[1]:K[2])
plot(irisest, pos = 1, nrow = 3, ncol = 2, what = c("den"))
plot(irisest, pos = 2, nrow = 3, ncol = 2, what = c("den"))
plot(irisest, pos = 3, nrow = 3, ncol = 2, what = c("den"))
# Selected chunks.
iriscla <- RCLSMIX(model = "RCLSMVNORM",
x = list(irisest),
Dataset = Iris@test,
Zt = Iris@Zt)
iriscla
summary(iriscla)
# Plot selected chunks.
plot(iriscla, nrow = 3, ncol = 2)
# }
Run the code above in your browser using DataLab