1\name{ddalpha.test}
2\alias{ddalpha.test}
3\title{
4Test DD-Classifier
5}
6\description{
7Trains DD-classifier on the learning sequence of the data and tests it on the testing sequence.
8}
9\usage{
10ddalpha.test(learn, test, ...)
11}
12\arguments{
13  \item{learn}{
14the learning sequence of the data. Matrix containing training sample where each of \eqn{n} rows is one object of the training sample where first \eqn{d} entries are inputs and the last entry is output (class label).
15}
16  \item{test}{
17the testing sequence. Has the same format as \code{learn}
18}
19  \item{\dots}{
20additional parameters passed to \code{\link{ddalpha.train}}
21}
22}
23
24\value{
25
26  \item{error}{
27  the part of incorrectly classified data
28  }
29  \item{correct}{
30  the number of correctly classified objects
31  }
32  \item{incorrect}{
33  the number of incorrectly classified objects
34  }
35  \item{total}{
36  the number of classified objects
37  }
38  \item{ignored}{
39  the number of ignored objects (outside the convex hull of the learning data)
40  }
41  \item{n}{
42  the number of objects in the testing sequence
43  }
44  \item{time}{
45  training time
46  }
47
48}
49
50
51\seealso{
52\code{\link{ddalpha.train}} to train the DD-classifier,
53\code{\link{ddalpha.classify}} for classification using DD-classifier,
54\code{\link{ddalpha.getErrorRateCV}} and \code{\link{ddalpha.getErrorRatePart}} to get error rate of the DD-classifier on particular data.
55}
56\examples{
57
58# Generate a bivariate normal location-shift classification task
59# containing 200 training objects and 200 to test with
60class1 <- mvrnorm(200, c(0,0),
61                  matrix(c(1,1,1,4), nrow = 2, ncol = 2, byrow = TRUE))
62class2 <- mvrnorm(200, c(2,2),
63                  matrix(c(1,1,1,4), nrow = 2, ncol = 2, byrow = TRUE))
64trainIndices <- c(1:100)
65testIndices <- c(101:200)
66propertyVars <- c(1:2)
67classVar <- 3
68trainData <- rbind(cbind(class1[trainIndices,], rep(1, 100)),
69                   cbind(class2[trainIndices,], rep(2, 100)))
70testData <- rbind(cbind(class1[testIndices,], rep(1, 100)),
71                  cbind(class2[testIndices,], rep(2, 100)))
72data <- list(train = trainData, test = testData)
73
74# Train 1st DDalpha-classifier (default settings)
75# and get the classification error rate
76stat <- ddalpha.test(data$train, data$test)
77cat("1. Classification error rate (defaults): ",
78    stat$error, ".\n", sep = "")
79
80# Train 2nd DDalpha-classifier (zonoid depth, maximum Mahalanobis
81# depth classifier with defaults as outsider treatment)
82# and get the classification error rate
83stat2 <- ddalpha.test(data$train, data$test, depth = "zonoid",
84                          outsider.methods = "depth.Mahalanobis")
85cat("2. Classification error rate (depth.Mahalanobis): ",
86    stat2$error, ".\n", sep = "")
87
88}
89% Add one or more standard keywords, see file 'KEYWORDS' in the
90% R documentation directory.
91\keyword{ benchmark }
92