data(iris) # dataset
# Example 1 - Without the classes in the data
data <- iris[,1:4]
findex <- "kurtosismax" # index function
dim <- 1 # dimension of data projection
sphere <- TRUE # spherical data
res <- PP_Optimizer(data = data, class = NA, findex = findex,
optmethod = "GTSA", dimproj = dim, sphere = sphere,
weight = TRUE, lambda = 0.1, r = 1, cooling = 0.9,
eps = 1e-3, maxiter = 500, half = 30)
Plot.PP(res, titles = NA, posleg = 1, boxleg = FALSE, color = TRUE,
linlab = NA, axesvar = TRUE, axes = TRUE, savptc = FALSE,
width = 3236, height = 2000, res = 300, casc = FALSE)
# Example 2 - With the classes in the data
class <- iris[,5] # data class
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 = 500, half = 30)
tit <- c(NA,"Graph example") # titles for the graphics
Plot.PP(res, titles = tit, posleg = 1, boxleg = FALSE, color = TRUE,
classcolor = c("blue3","red","goldenrod3"), linlab = NA,
axesvar = TRUE, axes = TRUE, savptc = FALSE, width = 3236,
height = 2000, res = 300, casc = FALSE)
# Example 3 - Without the classes in the data, but informing
# the classes in the plot function
res <- PP_Optimizer(data = data, class = NA, findex = "Moment",
optmethod = "GTSA", dimproj = 2, sphere = sphere,
weight = TRUE, lambda = 0.1, r = 1, cooling = 0.9,
eps = 1e-3, maxiter = 500, half = 30)
lin <- c(rep("a",50),rep("b",50),rep("c",50)) # data class
Plot.PP(res, titles = NA, posleg = 1, boxleg = FALSE, color = TRUE,
linlab = lin, axesvar = TRUE, axes = TRUE, savptc = FALSE,
width = 3236, height = 2000, res = 300, casc = FALSE)
# Example 4 - With the classes in the data, but not informed in plot function
class <- iris[,5] # data class
dim <- 2 # dimension of data projection
findex <- "lda" # index function
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 = 500, half = 30)
tit <- c("",NA) # titles for the graphics
Plot.PP(res, titles = tit, posleg = 1, boxleg = FALSE, color = TRUE,
linlab = NA, axesvar = TRUE, axes = TRUE, savptc = FALSE,
width = 3236, height = 2000, res = 300, casc = FALSE)
Run the code above in your browser using DataLab