plotDiscrimVar {RMixtCompUtilities} | R Documentation |
Barplot of the discriminative power of the variables
Description
Barplot of the discriminative power of the variables
Usage
plotDiscrimVar(
output,
class = NULL,
ylim = c(0, 1),
pkg = c("ggplot2", "plotly"),
...
)
Arguments
output |
object returned by mixtCompLearn function from RMixtComp or rmcMultiRun function from RMixtCompIO |
class |
NULL or a number of classes. If NULL, return the discrimative power of variables globally otherwise return the discrimative power of variables in the given class |
ylim |
vector of length 2 defining the range of y-axis |
pkg |
"ggplot2" or "plotly". Package used to plot |
... |
arguments to be passed to plot_ly |
Details
The discriminative power of variable j is defined by 1 - C(j)
C(j)= -\sum_{k=1}^K \sum_{i=1}^n P(Z_i=k|x_{ij}) ln(P(Z_i=k|x_{ij})) / (n*\log(K))
Author(s)
Matthieu MARBAC
See Also
Other plot:
heatmapClass()
,
heatmapTikSorted()
,
heatmapVar()
,
histMisclassif()
,
plot.MixtComp()
,
plotConvergence()
,
plotDataBoxplot()
,
plotDataCI()
,
plotDiscrimClass()
,
plotParamConvergence()
,
plotProportion()
Examples
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)
# plot
plotDiscrimVar(resLearn)
plotDiscrimVar(resLearn, class = 1)
}