| Title: | Projection Pursuit Classification Tree |
|---|---|
| Description: | Fits projection pursuit classification trees using the LDA, Lr or PDA projection pursuit index. Compatibility updates by Renova. |
| Authors: | Eun-Kyung Lee [aut, cre], Yoondong Lee [aut] |
| Maintainer: | Eun-Kyung Lee <[email protected]> |
| License: | LGPL-2.1 |
| Version: | 2.3.0.9002 |
| Built: | 2026-11-19 07:06:49 UTC |
| Source: | https://github.com/renova-r/PPtree |
This package is for projection pursuit method for supervised classification.
Eun-kyung Lee
Lee, E., Cook, D., and Klinke, S.(2002) Projection Pursuit indices for supervised classification
PPindex.class \ PPindex.LDA \ PPindex.Lp \ PPindex.PDA
PP.optimize.anneal
PP.optimize.plot
PP.Tree
PP.classify
Find tree structure using linear discriminant in each split.
LDA.Tree( i.class, i.data, weight = TRUE, ...)LDA.Tree( i.class, i.data, weight = TRUE, ...)
i.data |
A training data without class information |
i.class |
class information |
weight |
weight flag using in LDA index |
... |
... |
Tree.Struct |
Tree structure |
Alpha.Keep |
1D projection of each split |
C.Keep |
spliting rule for each split |
Eun-kyung Lee
Lee, E., Cook, D., and Klinke, S.(2002) Projection Pursuit indices for supervised classification
data(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- LDA.Tree(iris[train,5],iris[train,1:4]) Tree.resultdata(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- LDA.Tree(iris[train,5],iris[train,1:4]) Tree.result
Find tree structure using projection pursuit in each split.
PDA.Tree(i.class, i.data, weight = TRUE, lambda=1, ...)PDA.Tree(i.class, i.data, weight = TRUE, lambda=1, ...)
i.data |
A training data without class information |
i.class |
class information |
weight |
weight flag using in LDA index |
lambda |
a parameter for PDA index |
... |
... |
Tree.Struct |
Tree structure |
Alpha.Keep |
1D projection of each split |
C.Keep |
spliting rule for each split |
Eun-kyung Lee
Lee, E., Cook, D., and Klinke, S.(2002) Projection Pursuit indices for supervised classification
data(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- PDA.Tree(iris[train,5],iris[train,1:4]) Tree.resultdata(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- PDA.Tree(iris[train,5],iris[train,1:4]) Tree.result
After finding tree structure, predict class for the test set and calculate prediction error.
PP.classify(test.data, true.class, Tree.result, Rule, ...)PP.classify(test.data, true.class, Tree.result, Rule, ...)
test.data |
the test dataset |
true.class |
true class of test dataset if available |
Tree.result |
the result of PP.Tree |
Rule |
split rule 1 - mean of two group means 2 - weighted mean of two group means 3 - mean of max(left group) and min(right group) 4 - weighted mean of max(left group) and min(right group) |
... |
... |
A list with components:
predict.class |
predicted class |
predict.error |
prediction error |
Eun-kyung Lee
Lee E., Cook D., and Klinke, S. (2002) Projection Pursuit indices for supervised classification
PPindex.class, PP.optimize,
PP.Tree
data(iris) n <- nrow(iris) n.train <- round(n*0.9) train <- sample(n, n.train) Tree.result <- PP.Tree("LDA", iris[train,5], iris[train, 1:4]) tree.train <- PP.classify(iris[train, 1:4], iris[train, 5], Tree.result, Rule=1) tree.train tree.test <- PP.classify(iris[-train, 1:4], iris[-train, 5], Tree.result, Rule=1) tree.testdata(iris) n <- nrow(iris) n.train <- round(n*0.9) train <- sample(n, n.train) Tree.result <- PP.Tree("LDA", iris[train,5], iris[train, 1:4]) tree.train <- PP.classify(iris[train, 1:4], iris[train, 5], Tree.result, Rule=1) tree.train tree.test <- PP.classify(iris[-train, 1:4], iris[-train, 5], Tree.result, Rule=1) tree.test
Find optimal projection using PP index.
PP.optimize.random(PPmethod, projdim, data, class, std=TRUE, cooling=0.99, temp=1, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.anneal(PPmethod, projdim, data, class, std=TRUE, cooling=0.999, temp=1, energy=0.01, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.Huber(PPmethod, projdim, data, class, std=TRUE, cooling=0.99, temp=1, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.plot(PP.opt, data, class, std=TRUE)PP.optimize.random(PPmethod, projdim, data, class, std=TRUE, cooling=0.99, temp=1, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.anneal(PPmethod, projdim, data, class, std=TRUE, cooling=0.999, temp=1, energy=0.01, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.Huber(PPmethod, projdim, data, class, std=TRUE, cooling=0.99, temp=1, r=NULL, lambda=NULL, weight=TRUE, ...) PP.optimize.plot(PP.opt, data, class, std=TRUE)
PPmethod |
Selected PP index “LDA" - LDA index “Lp" - Lp index; “PDA" - PDA index |
projdim |
dimension of projection that you want to find |
data |
data without class information |
class |
class information |
std |
decide whether data will be standardized or not before applying projection pursuit |
weight |
weight flag using in LDA index |
cooling |
parameter for optimization |
temp |
inital temperature for optimization |
energy |
parameter for simulated annealing optimization |
r |
a parameter for |
lambda |
a parameter for PDA index |
PP.opt |
the optimal projection |
... |
... |
index.best |
PP index for optimal projected data |
proj.best |
optimal projection |
Eun-kyung Lee
Lee E., Cook D., and Klinke, S. (2002) Projection Pursuit indices for supervised classification
{PPindex.class}
data(iris) PP.opt<-PP.optimize.random("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) PP.opt<-PP.optimize.anneal("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1,energy=0.01) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) PP.opt<-PP.optimize.Huber("LDA",2,iris[,1:4],iris[,5],cooling=0.999,r=1) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5])data(iris) PP.opt<-PP.optimize.random("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) PP.opt<-PP.optimize.anneal("LDA",1,iris[,1:4],iris[,5],cooling=0.999,temp=1,energy=0.01) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5]) PP.opt<-PP.optimize.Huber("LDA",2,iris[,1:4],iris[,5],cooling=0.999,r=1) PP.opt$index.best PP.optimize.plot(PP.opt,iris[,1:4],iris[,5])
Find tree structure using projection pursuit in each split.
PP.Tree(PPmethod, i.class, i.data, weight = TRUE, r = NULL, lambda = NULL, cooling = 0.999, temp = 1, energy = 0.01, ...)PP.Tree(PPmethod, i.class, i.data, weight = TRUE, r = NULL, lambda = NULL, cooling = 0.999, temp = 1, energy = 0.01, ...)
PPmethod |
Selected PP index “LDA” - LDA index “Lp” - Lp index; “PDA” - PDA index |
i.data |
A training data without class information |
i.class |
class information |
weight |
weight flag using in LDA index |
r |
a parameter for |
lambda |
a parameter for PDA index |
cooling |
parameter for optimization |
temp |
inital temperature for optimization |
energy |
parameter for simulated annealing optimization |
... |
... |
Tree.Struct |
Tree structure |
Alpha.Keep |
1D projection of each split |
C.Keep |
spliting rule for each split |
Eun-kyung Lee
Lee, E., Cook, D., and Klinke, S.(2002) Projection Pursuit indices for supervised classification
data(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- PP.Tree("LDA",iris[train,5],iris[train,1:4]) Tree.resultdata(iris) n <- nrow(iris) tot <- c(1:n) n.train <- round(n*0.9) train <- sample(tot,n.train) test <- tot[-train] Tree.result <- PP.Tree("LDA",iris[train,5],iris[train,1:4]) Tree.result
For given projected data and class information, calculate projeciton pursuit index.
PPindex.class(PPmethod, data, class, weight=TRUE, r=NULL, lambda=NULL, ...) PPindex.LDA(data, class, weight=TRUE, ...) PPindex.Lp(data, class, r, ...) PPindex.PDA(data, class, lambda, ...)PPindex.class(PPmethod, data, class, weight=TRUE, r=NULL, lambda=NULL, ...) PPindex.LDA(data, class, weight=TRUE, ...) PPindex.Lp(data, class, r, ...) PPindex.PDA(data, class, lambda, ...)
PPmethod |
Selected PP index “LDA" - LDA index “Lp" - Lp index “PDA" - Entropy-class index |
data |
A data without class information |
class |
class information |
weight |
weight flag using in LDA index |
r |
a parameter for |
lambda |
a parameter for PDA index |
... |
... |
The value is an projection pursuit index for given data.
Eun-kyung Lee
Lee, E., Cook, D., and Klinke, S.(2002) Projection Pursuit indices for supervised classification
data(iris) PPindex.class("LDA",iris[,1:2],iris[,5]) PPindex.class("LDA",iris[,1:2],iris[,5],weight=FALSE) PPindex.class("Lp",iris[,1:2],iris[,5],r=1) PPindex.class("PDA",iris[,1:2],iris[,5],lambda=0.1)data(iris) PPindex.class("LDA",iris[,1:2],iris[,5]) PPindex.class("LDA",iris[,1:2],iris[,5],weight=FALSE) PPindex.class("Lp",iris[,1:2],iris[,5],r=1) PPindex.class("PDA",iris[,1:2],iris[,5],lambda=0.1)