Learn R Programming

Rmixmod (version 2.1.10)

MixmodPredict-class: Constructor of [MixmodPredict] class

Description

This is a class to run discriminant analysis with mixmod.

Arguments

Details

data

numeric vector, matrix, or data frame of observations. Either qualitative or quantitative.

dataType

character. It defines whether data are quantitative or qualitative.

nbVariable

integer. The number of variables.

nbSample

integer. The number of observations.

error

a character. The mixmod error.

classificationRule

a [MixmodResults] object containing the classification rule.

partition

a matrix containing observations to predict.

proba

a matrix of probabilities.

Examples

Run this code
# start by extract 10 observations from iris data set
remaining.obs <- sample(1:nrow(iris), 10)

# then run a mixmodLearn() analysis without those 10 observations
learn <- mixmodLearn(iris[-remaining.obs, 1:4], iris$Species[-remaining.obs])
# create a MixmodPredict to predict those 10 observations
new("MixmodPredict", data = iris[remaining.obs, 1:4], classificationRule = learn["bestResult"])

getSlots("MixmodPredict")

Run the code above in your browser using DataLab