Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace emoa with moocore #301

@MLopez-Ibanez

Description

@MLopez-Ibanez

emoa seems to be consistently slower than moocore in computing the hypervolume.

Image

I haven't benchmarked yet computing hypervolume contributions, but emoa seems to be returning wrong results: olafmersmann/emoa#1

Reproducible benchmark code:
library(matrixStats)
library(moocore)
library(emoa)
library(ggplot2)
library(data.table)
library(directlabels) # Required by atime
library(atime)

get_dataset <- function(filename) {
  x <- read_datasets(
    system.file(file.path("extdata", filename), package="moocore",
      mustWork=TRUE))
  filter_dominated(x[, -ncol(x)])
}

x <- get_dataset("DTLZLinearShape.8d.front.60pts.10")
ref <- colMaxs(x, useNames=FALSE) + 1

res <- atime(
  N = seq(50, 200, 50),
  setup = { z <- x[1:N, ]},
  times=3,
  result=TRUE,
  seconds.limit=10,
  moocore = moocore::hypervolume(z, ref = ref),
  emoa = emoa::dominated_hypervolume(t(z), ref = ref)
)

myplot <- function (x, ...) {
  expr.name <- N <- kilobytes <- NULL
  meas <- x[["measurements"]]
  by.dt <- meas[, x$by.vec, with = FALSE]
  tall.list <- list()
  for (unit.i in seq_along(x$unit.col.vec)) {
    col.name <- x$unit.col.vec[[unit.i]]
    unit <- names(x$unit.col.vec)[[unit.i]]
    if (is.null(unit) || unit == "")
      unit <- col.name
    tall.list[[unit.i]] <- meas[, data.table(N, by.dt,
      unit, median = get(col.name))]
  }
  tall <- rbindlist(tall.list)
  gg <- ggplot() + theme_bw() +
    geom_ribbon(aes(N, ymin = min, ymax = max, fill = expr.name),
      data = data.table(meas, unit = "seconds"), alpha = 0.5) +
    geom_line(aes(N, median, color = expr.name), data = tall) +
    geom_point(aes(N, median, color = expr.name), data = tall) +
    facet_grid(unit ~ ., scales = "free") +
    scale_y_log10("median line, min/max band") +
    theme(legend.position="none")
    directlabels::direct.label(gg, "right.polygons")
}

gg <- myplot(res)
ggsave(gg, filename="bench-hv.png")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions