classDist(x, ...)## S3 method for class 'default':
classDist(x, y, groups = 5, pca = FALSE, keep = NULL, ...)
## S3 method for class 'classDist':
predict(object, newdata, trans = log, ...)
NULL
uses all
within a tolerance of sqrt(.Machine$double.eps)
)classDist
vars
was
previously specified, these columns should be in
newdata
trans = NULL
will not apply a
functionclassDist
, an object of class classDist
with
elements:prcomp
when
pca = TRUE
predict.classDist
, a matrix with columns for each class.
The columns names are the names of the class with the prefix
dist.
. In the case of numeric y
, the class labels are
the percentiles. For example, of groups = 9
, the variable names
would be dist.11.11
, dist.22.22
, etc.predict.classDist
The function will check for non-singular matrices.For numeric outcomes, the data are split into roughly equal sized
bins based on groups
. Percentiles are used to split the data.
mahalanobis
trainSet <- sample(1:150, 100)
distData <- classDist(iris[trainSet, 1:4],
iris$Species[trainSet])
newDist <- predict(distData,
iris[-trainSet, 1:4])
splom(newDist, groups = iris$Species[-trainSet])
Run the code above in your browser using DataLab