Test Functions#

Surfaces provides five categories of test functions, each designed for specific benchmarking purposes.


Function Categories#

Algebraic Functions

Classic mathematical test functions from the optimization literature. Well-studied, with known properties and analytical formulas.

  • 1D Functions: Simple univariate problems

  • 2D Functions: Visualizable landscapes

  • N-D Functions: Scalable to any dimension

Algebraic Functions
BBOB Functions

Black-Box Optimization Benchmarking suite from the COCO platform. The standard for rigorous optimizer comparison.

  • 24 noiseless functions

  • Used in GECCO competitions

  • Systematic difficulty progression

BBOB Functions
CEC Functions

Competition on Evolutionary Computation benchmark suites. Challenging functions for advanced optimizer testing.

  • CEC 2013, 2014, 2017 suites

  • Shifted and rotated variants

  • Composition functions

CEC Functions
Machine Learning Functions

Test functions based on real ML model training. Realistic hyperparameter optimization landscapes.

  • Classification and regression

  • Tabular, image, time series

  • Surrogate models available

Machine Learning Functions
Engineering Functions

Real-world constrained engineering design problems. Physical meaning and practical relevance.

  • Welded Beam Design

  • Pressure Vessel Design

  • Tension-Compression Spring

Engineering Functions

Choosing the Right Category#

Use Case

Recommended Category

Why

Quick prototyping

Algebraic (2D)

Fast, visualizable, simple

Rigorous comparison

BBOB

Standard benchmark, comparable results

Algorithm competition

CEC

Used in IEEE CEC competitions

Real-world relevance

Machine Learning

Actual HPO landscapes

Constrained optimization

Engineering

Physical constraints


Common Interface#

All test functions share the same interface:

from surfaces.test_functions.algebraic import SphereFunction, KNeighborsClassifierFunction

# Same interface for algebraic and ML functions
for func_class in [SphereFunction, KNeighborsClassifierFunction]:
    func = func_class() if func_class == KNeighborsClassifierFunction else func_class(n_dim=3)

    # Evaluate
    result = func(func.search_space_sample())

    # Get search space
    space = func.search_space()

    # Convert to scipy
    objective, bounds, x0 = func.to_scipy()