predict.classif.DD {fda.usc}R Documentation

Predicts from a fitted classif.DD object.

Description

Classifier of functional (and multivariate) data by DD–classifier.

Usage

## S3 method for class 'classif.DD'
predict(object, new.fdataobj = NULL, type = "class", ...)

Arguments

object

Object object estimated by classif.DD.

new.fdataobj

By default, new p functional explanatory dataset or new mulitvariate data of data.frame class

type

!=”predictive”, for each row of data shows the probability of each group membership.

...

Further arguments passed to or from other methods.

Details

Returns the groups or classes predicted using a previously trained model.

Value

Author(s)

Febrero-Bande, M., and Oviedo de la Fuente, M.

References

Li, J., P.C., Cuesta-Albertos, J.A. and Liu, R. DD–Classifier: Nonparametric Classification Procedure Based on DD-plot. Journal of the American Statistical Association (2012), Vol. 107, 737–753.

See Also

See also classif.DD .

Examples

## Not run: 
# DD-classif for multivariate data 
data(iris)
iris<-iris[1:100,]
ii<-sample(1:100,80)
group.train<-factor(iris[ii,5])
x.train<-iris[ii,1:4]
out1=classif.DD(group.train,x.train,depth="MhD",classif="lda")
out2=classif.DD(group.train,x.train,depth="MhD",classif="glm")
summary(out1)
summary(out2)
x.test<-iris[-ii,1:4]
pred1=predict(out1,x.test)
pred2=predict(out2,x.test)
group.test<-iris[-ii,5]
table(pred1,group.test)
table(pred2,group.test)

# DD-classif for Functional data
data(phoneme)
mlearn<-phoneme[["learn"]]
glearn<-phoneme[["classlearn"]]

#	ESTIMATION 
out1=classif.DD(glearn,mlearn,depth="FM",classif="glm")
summary(out1)
#	PREDICTION 
mtest<-phoneme[["test"]]
gtest<-phoneme[["classtest"]]
pred1=predict(out1,mtest)
table(pred1,gtest)

## End(Not run)

[Package fda.usc version 2.1.0 Index]