partimat: Plotting the 2-d partitions of classification methods

View source: R/partimat.R

partimatR Documentation

Plotting the 2-d partitions of classification methods

Description

Provides a multiple figure array which shows the classification of observations based on classification methods (e.g. lda, qda) for every combination of two variables. Moreover, the classification borders are displayed and the apparent error rates are given in each title.

Usage

partimat(x,...)

## Default S3 method:
partimat(x, grouping, method = "lda", prec = 100, 
    nplots.vert, nplots.hor, main = "Partition Plot", name, mar, 
    plot.matrix = FALSE, plot.control = list(), ...)
## S3 method for class 'data.frame'
partimat(x, ...)
## S3 method for class 'matrix'
partimat(x, grouping, ..., subset, na.action = na.fail)
## S3 method for class 'formula'
partimat(formula, data = NULL, ..., subset, na.action = na.fail)

Arguments

x

matrix or data frame containing the explanatory variables (required, if formula is not given).

grouping

factor specifying the class for each observation (required, if formula is not given).

formula

formula of the form groups ~ x1 + x2 + .... That is, the response is the grouping factor and the right hand side specifies the (non-factor) discriminators.

method

the method the classification is based on, currently supported are: lda, qda, rpart, naiveBayes, rda, sknn and svmlight

.

prec

precision used to draw the classification borders (the higher the more precise; default: 100).

data

Data frame from which variables specified in formula are preferentially to be taken.

nplots.vert

number of rows in the multiple figure array

nplots.hor

number of columns in the multiple figure array

subset

index vector specifying the cases to be used in the training sample. (Note: If given, this argument must be named.)

na.action

specify the action to be taken if NAs are found. The default action is for the procedure to fail. An alternative is na.omit, which leads to rejection of cases with missing values on any required variable. (Note: If given, this argument must be named.)

main

title

name

Variable names to be printed at the axis / into the diagonal.

mar

numerical vector of the form c(bottom, left, top, right) which gives the lines of margin to be specified on the four sides of the plot. Defaults are rep(0, 4) if plot.matrix = TRUE, c(5, 4, 2, 1) + 0.1 otherwise.

plot.matrix

logical; if TRUE, like a scatterplot matrix; if FALSE (default) uses less space and arranges the plots “optimal” (using a fuzzy algorithm) in an array by plotting each pair of variables once.

plot.control

A list containing further arguments passed to the underlying plot functions (and to drawparti).

...

Further arguments passed to the classification method (through drawparti).

Note

Warnings such as ‘parameter “xyz” couldn't be set in high-level plot function’ are expected, if making use of ....

Author(s)

Karsten Luebke, karsten.luebke@fom.de, Uwe Ligges, Irina Czogiel

See Also

for much more fine tuning see drawparti

Examples

library(MASS)
data(iris)
partimat(Species ~ ., data = iris, method = "lda")
## Not run: 
partimat(Species ~ ., data = iris, method = "lda", 
    plot.matrix = TRUE, imageplot = FALSE) # takes some time ...

## End(Not run)

klaR documentation built on May 29, 2024, 5:20 a.m.

Related to partimat in klaR...