RotMatPPO {ODRF} | R Documentation |
Create a Projection Matrix: RotMatPPO
Description
Create a projection matrix using projection pursuit optimization (PPO
).
Usage
RotMatPPO(
X,
y,
model = "PPR",
split = "entropy",
weights = NULL,
dimProj = min(ceiling(length(y)^0.4), ceiling(ncol(X) * 2/3)),
numProj = ifelse(dimProj == "Rand", sample(floor(ncol(X)/3), 1),
ceiling(ncol(X)/dimProj)),
catLabel = NULL,
...
)
Arguments
X |
An n by d numeric matrix (preferable) or data frame. |
y |
A response vector of length n. |
model |
Model for projection pursuit (for details see |
split |
One of three criteria, 'gini': gini impurity index (classification), 'entropy': information gain (classification, default) or 'mse': mean square error (regression). |
weights |
A vector of length same as |
dimProj |
Number of variables to be projected, |
numProj |
The number of projection directions, when |
catLabel |
A category labels of class |
... |
Used to handle superfluous arguments passed in using paramList. |
Value
A random matrix to use in running ODT
.
Variable: Variables to be projected.
Number: Number of projections.
Coefficient: Coefficients of the projection matrix.
See Also
RotMatMake
RotMatRand
RotMatRF
PPO
Examples
set.seed(220828)
X <- matrix(rnorm(1000), 100, 10)
y <- (rnorm(100) > 0) + 0
(RotMat <- RotMatPPO(X, y))
(RotMat <- RotMatPPO(X, y, dimProj = "Rand"))
(RotMat <- RotMatPPO(X, y, dimProj = 6, numProj = 4))
# classification
data(seeds)
(PP <- RotMatPPO(seeds[, 1:7], seeds[, 8], model = "Log", split = "entropy"))
(PP <- RotMatPPO(seeds[, 1:7], seeds[, 8], model = "PPR", split = "entropy"))
(PP <- RotMatPPO(seeds[, 1:7], seeds[, 8], model = "LDA", split = "entropy"))
# regression
data(body_fat)
(PP <- RotMatPPO(body_fat[, 2:15], body_fat[, 1], model = "Log", split = "mse"))
(PP <- RotMatPPO(body_fat[, 2:15], body_fat[, 1], model = "Rand", split = "mse"))
(PP <- RotMatPPO(body_fat[, 2:15], body_fat[, 1], model = "PPR", split = "mse"))