Skip to contents

The classification is supported (true/false), extreme (true/false), supported non-extreme (true/false)

Usage

classifyNDSet(pts, direction = 1)

Arguments

pts

A set of non-dominated points. It is assumed that ncol(pts) equals the number of objectives ($p$).

direction

Ray direction. If i'th entry is positive, consider the i'th column of the pts plus a value greater than on equal zero (minimize objective $i$). If negative, consider the i'th column of the pts minus a value greater than on equal zero (maximize objective $i$).

Value

The ND set with classification columns.

Note

It is assumed that pts are nondominated.

Examples

# \donttest{
pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3, byrow = TRUE)
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-2,max(pts[,1])+2),
  ylim = c(min(pts[,2])-2,max(pts[,2])+2),
  zlim = c(min(pts[,3])-2,max(pts[,3])+2)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), useRGLBBox = TRUE)
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
plotCones3D(pts[,1:3], rectangle = TRUE, argsPolygon3d = list(alpha = 1))
finalize3D()


pts
#>     z1  z2   z3    se   sne    us cls
#> 1 0.00 0.0 1.00  TRUE FALSE FALSE  se
#> 2 0.00 1.0 0.00  TRUE FALSE FALSE  se
#> 3 1.00 0.0 0.00  TRUE FALSE FALSE  se
#> 4 0.50 0.2 0.50 FALSE FALSE  TRUE  us
#> 5 0.25 0.5 0.25 FALSE  TRUE FALSE sne

pts <- matrix(c(0,0,1, 0,1,0, 1,0,0, 0.2,0.1,0.1, 0.1,0.45,0.45), ncol = 3, byrow = TRUE)
di <- -1 # maximize
ini3D(argsPlot3d = list(xlim = c(min(pts[,1])-1,max(pts[,1])+1),
  ylim = c(min(pts[,2])-1,max(pts[,2])+1),
  zlim = c(min(pts[,3])-1,max(pts[,3])+1)))
plotHull3D(pts, addRays = TRUE, argsPolygon3d = list(alpha = 0.5), direction = di,
           addText = "coord")
pts <- classifyNDSet(pts[,1:3], direction = di)
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
plotCones3D(pts[,1:3], rectangle = TRUE, argsPolygon3d = list(alpha = 1), direction = di)
finalize3D()


pts
#>    z1   z2   z3    se   sne    us cls
#> 1 0.0 0.00 1.00  TRUE FALSE FALSE  se
#> 2 0.0 1.00 0.00  TRUE FALSE FALSE  se
#> 3 1.0 0.00 0.00  TRUE FALSE FALSE  se
#> 4 0.2 0.10 0.10 FALSE FALSE  TRUE  us
#> 5 0.1 0.45 0.45 FALSE  TRUE FALSE sne

pts <- matrix(c(0,0,1, 0,0,1, 0,1,0, 0.5,0.2,0.5, 1,0,0, 0.5,0.2,0.5, 0.25,0.5,0.25), ncol = 3,
              byrow = TRUE)
classifyNDSet(pts)
#>     z1  z2   z3    se   sne    us cls
#> 1 0.00 0.0 1.00  TRUE FALSE FALSE  se
#> 2 0.00 0.0 1.00  TRUE FALSE FALSE  se
#> 3 0.00 1.0 0.00  TRUE FALSE FALSE  se
#> 4 0.50 0.2 0.50 FALSE FALSE  TRUE  us
#> 5 1.00 0.0 0.00  TRUE FALSE FALSE  se
#> 6 0.50 0.2 0.50 FALSE FALSE  TRUE  us
#> 7 0.25 0.5 0.25 FALSE  TRUE FALSE sne

pts <- genNDSet(3,15)[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
  ylim = c(0,max(pts$z2)+2),
  zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
finalize3D()


pts
#>    z1 z2 z3    se   sne    us cls
#> 1  23 28 16  TRUE FALSE FALSE  se
#> 2  16 57 16  TRUE FALSE FALSE  se
#> 3  58 49  2  TRUE FALSE FALSE  se
#> 4  29  6 53  TRUE FALSE FALSE  se
#> 5  19 13 57  TRUE FALSE FALSE  se
#> 6   2 47 60  TRUE FALSE FALSE  se
#> 7  10 37 75 FALSE FALSE  TRUE  us
#> 8  64 28  8  TRUE FALSE FALSE  se
#> 9  43  3 62  TRUE FALSE FALSE  se
#> 10 22 50 10  TRUE FALSE FALSE  se
#> 11  5 39 34  TRUE FALSE FALSE  se
#> 12  9 52 24  TRUE FALSE FALSE  se
#> 13  4 64 38  TRUE FALSE FALSE  se
#> 14 38 49  3  TRUE FALSE FALSE  se
#> 15 13 21 63  TRUE FALSE FALSE  se

pts <- genNDSet(3, 15, keepDom = FALSE, argsSphere = list(below = FALSE, factor = 10))[,1:3]
ini3D(argsPlot3d = list(xlim = c(0,max(pts$z1)+2),
  ylim = c(0,max(pts$z2)+2),
  zlim = c(0,max(pts$z3)+2)))
plotHull3D(pts[, 1:3], addRays = TRUE, argsPolygon3d = list(alpha = 0.5))
pts <- classifyNDSet(pts[,1:3])
plotPoints3D(pts[pts$se,1:3], argsPlot3d = list(col = "red"))
plotPoints3D(pts[pts$sne,1:3], argsPlot3d = list(col = "black"))
plotPoints3D(pts[pts$us,1:3], argsPlot3d = list(col = "blue"))
finalize3D()


pts
#>    z1 z2 z3    se   sne    us cls
#> 1  92 36 27  TRUE FALSE FALSE  se
#> 2  74 75 15 FALSE FALSE  TRUE  us
#> 3  22 62 89 FALSE FALSE  TRUE  us
#> 4  71 82 18 FALSE FALSE  TRUE  us
#> 5  23 91 47  TRUE FALSE FALSE  se
#> 6  79 67 13  TRUE FALSE FALSE  se
#> 7  51 24 92 FALSE FALSE  TRUE  us
#> 8  48 90 21  TRUE FALSE FALSE  se
#> 9  81 13 61  TRUE FALSE FALSE  se
#> 10 23 45 91  TRUE FALSE FALSE  se
#> 11 84 16 60 FALSE FALSE  TRUE  us
#> 12 41 94 28  TRUE FALSE FALSE  se
#> 13 48 25 93  TRUE FALSE FALSE  se
#> 14 14 65 80  TRUE FALSE FALSE  se
#> 15 28 36 92  TRUE FALSE FALSE  se
# }