Learn R Programming

RMixtCompUtilities (version 4.1.3)

heatmapClass: Heatmap of the similarities between classes about clustering

Description

Heatmap of the similarities between classes about clustering

Usage

heatmapClass(output, pkg = c("ggplot2", "plotly"), ...)

Arguments

output

object returned by mixtCompLearn function from RMixtComp or rmcMultiRun function from RMixtCompIO

pkg

"ggplot2" or "plotly". Package used to plot

...

arguments to be passed to plot_ly. For pkg = "ggplot2", addValues = TRUE prints similarity values on the heatmap

Details

The similarities between classes k and g is defined by 1 - Sigma(k,g) $$Sigma(k,g)^2 = (1/n) * \sum_{i=1}^n (P(Z_i=k|x_i) - P(Z_i=g|x_i))^2$$

See Also

computeSimilarityClass

Other plot: heatmapTikSorted(), heatmapVar(), histMisclassif(), plot.MixtComp(), plotConvergence(), plotDataBoxplot(), plotDataCI(), plotDiscrimClass(), plotDiscrimVar(), plotParamConvergence(), plotProportion()

Examples

Run this code
# NOT RUN {
require(RMixtCompIO) # for learning a mixture model
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 <- rmcMultiRun(algo, dataLearn, model, nRun = 3)

# plot
heatmapClass(resLearn)

# }

Run the code above in your browser using DataLab