data(iris) # data set
# Example 1 - Without the classes in the data
data <- iris[,1:4]
class <- NA # data class
findex <- "kurtosismax" # index function
dim <- 1 # dimension of data projection
sphere <- TRUE # spherical data
res <- PP_Optimizer(data = data, class = class, findex = findex,
optmethod = "GTSA", dimproj = dim, sphere = sphere,
weight = TRUE, lambda = 0.1, r = 1, cooling = 0.9,
eps = 1e-3, maxiter = 1000, half = 30)
print("Number of classes:"); res$num.class
print("class Names:"); res$class.names
print("Projection index function:"); res$findex
print("Projected data:"); res$proj.data
print("Projection vectors:"); res$vector.opt
print("Projection index:"); res$index
# Example 2 - With the classes in the data
class <- iris[,5] # classe dos dados
res <- PP_Optimizer(data = data, class = class, findex = findex,
optmethod = "GTSA", dimproj = dim, sphere = sphere,
weight = TRUE, lambda = 0.1, r = 1, cooling = 0.9,
eps = 1e-3, maxiter = 1000, half = 30)
print("Number of classes:"); res$num.class
print("class Names:"); res$class.names
print("Projection index function:"); res$findex
print("Projected data:"); res$proj.data
print("Projection vectors:"); res$vector.opt
print("Projection index:"); res$index
Run the code above in your browser using DataLab