
Last chance! 50% off unlimited learning
Sale ends in
Get the estimated class from MixtComp object
getPartition(outMixtComp, empiric = FALSE)
a vector containing the estimated class for each individual.
object of class MixtCompLearn or MixtComp obtained using mixtCompLearn
or
mixtCompPredict
functions from RMixtComp
package or rmcMultiRun
from RMixtCompIO
package.
if TRUE, use the partition obtained at the end of the gibbs algorithm. If FALSE, use the partition obtained with the observed probabilities.
Quentin Grimonprez
Other getter:
getBIC()
,
getCompletedData()
,
getEmpiricTik()
,
getMixtureDensity()
,
getParam()
,
getType()
if (requireNamespace("RMixtCompIO", quietly = TRUE)) {
dataLearn <- list(
var1 = as.character(c(rnorm(50, -2, 0.8), rnorm(50, 2, 0.8))),
var2 = as.character(c(rnorm(50, 2), rpois(50, 8)))
)
model <- list(
var1 = list(type = "Gaussian", paramStr = ""),
var2 = list(type = "Poisson", paramStr = "")
)
algo <- list(
nClass = 2,
nInd = 100,
nbBurnInIter = 100,
nbIter = 100,
nbGibbsBurnInIter = 100,
nbGibbsIter = 100,
nInitPerClass = 3,
nSemTry = 20,
confidenceLevel = 0.95,
ratioStableCriterion = 0.95,
nStableCriterion = 10,
mode = "learn"
)
resLearn <- RMixtCompIO::rmcMultiRun(algo, dataLearn, model, nRun = 3)
# get class
estimatedClass <- getPartition(resLearn)
}
Run the code above in your browser using DataLab