Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakobbossek/smoof

Single- and Multi-Objective Optimization Test Functions
https://github.com/jakobbossek/smoof

benchmark-functions multi-objective-optimization r r-package single-objective-optimization

Last synced: 12 days ago
JSON representation

Single- and Multi-Objective Optimization Test Functions

Awesome Lists containing this project

README

        

---
output: github_document
---
# smoof: Single- and Multi-Objective Optimization Test Functions

Visit the [package website](https://jakobbossek.github.io/smoof/)

[![CRAN Status Badge](http://www.r-pkg.org/badges/version/smoof)](https://CRAN.R-project.org/package=smoof)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/smoof)](https://CRAN.R-project.org/package=smoof)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/smoof?color=orange)](https://CRAN.R-project.org/package=smoof)
[![R-CMD-check](https://github.com/jakobbossek/smoof/workflows/R-CMD-check/badge.svg)](https://github.com/jakobbossek/smoof/actions)
[![Codecov test coverage](https://codecov.io/gh/jakobbossek/smoof/branch/master/graph/badge.svg)](https://app.codecov.io/gh/jakobbossek/smoof?branch=master)

This package offers an interface for objective functions in the context of (multi-objective) global optimization. It conveniently builds up on the S3 objects, i. e., an objective function is a S3 object composed of a descriptive name, the function itself, a parameter set, box constraints or other constraints, number of objectives and so on. Moreover, the package contains generators for a load of both single- and multi-objective optimization test functions which are frequently being used in the literature of (benchmarking) optimization algorithms.
The bi-objective ZDT function family by Zitzler, Deb and Thiele is included as well as the popular single-objective test functions like De Jong's function, Himmelblau function and Schwefel function. Moreover, the package offers a R interface to the C implementation of the *Black-Box Optimization Benchmarking* (BBOB) [set of noiseless test functions](http://coco.gforge.inria.fr/doku.php?id=bbob-2009-downloads).

![examplary smoof functions](https://raw.githubusercontent.com/jakobbossek/smoof/screenshots/smoof_funs_example.png)

## Installation instructions

Visit the [package repository on CRAN](https://CRAN.R-project.org/package=smoof). If you want to take a glance at the developement version install the github developement version by executing the following command:

```r
devtools::install_github("jakobbossek/smoof")
```

## Example

### Use a build-in generator
Assume the simplifying case where we want to benchmark a set of optimization algorithms on a single objective instance. We decide ourselves for the popular 10-dimensional Rosenbrock banana function. Instead of looking up the function definition, the box constraints and where the global optimum is located, we simply generate the function with **smoof** and get all the stuff:

```r
library(ggplot2)
library(plot3D)

obj.fn = makeRosenbrockFunction(dimensions = 2L)
print(obj.fn)
print(autoplot(obj.fn))
plot3D(obj.fn, length.out = 50L, contour = TRUE)
```

### Set up an objective function by hand
Let us consider the problem of finding the (global) minimum of the multimodal target function f(x) = x sin(3x) on the closed intervall [0, 2PI]. We define our target function via the ```makeSingleObjectiveFunction()``` method providing a name, the function itself and a parameter set. We can display the function within the box constraints with ggplot.

```r
library(ggplot2)

obj.fn = makeSingleObjectiveFunction(
name = "My fancy function name",
fn = function(x) x * sin(3*x),
par.set = makeNumericParamSet("x", len = 1L, lower = 0, upper = 2 * pi)
)
print(obj.fn)
print(getParamSet(obj.fn))
print(autoplot(obj.fn))
```

The [ecr](https://github.com/jakobbossek/ecr2) package for evolutionary computing in R needs builds upon smoof functions.

## Citation

Please cite my [R Journal paper](https://journal.r-project.org/archive/2017/RJ-2017-004/index.html) in publications. Get the information via `citation("smoof")` or use the following BibTex entry:
```
@Article{,
author = {Jakob Bossek},
title = {smoof: Single- and Multi-Objective Optimization Test Functions},
year = {2017},
journal = {The R Journal},
url = {https://journal.r-project.org/archive/2017/RJ-2017-004/index.html},
}
```

## Contact

Please address questions and missing features about the **smoof package** to the author Jakob Bossek . Found some nasty bugs? Please use the [issue tracker](https://github.com/jakobbossek/smoof/issues) for this. Pay attention to explain the problem as good as possible. At its best you provide an example, so I can reproduce your problem.