Test Functions#
Surfaces provides seven categories of test functions, each designed for specific benchmarking purposes.
Function Categories#
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
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
Competition on Evolutionary Computation benchmark suites. Challenging functions for advanced optimizer testing.
CEC 2013, 2014, 2017 suites
Shifted and rotated variants
Composition functions
Test functions based on real ML model training. Realistic hyperparameter optimization landscapes.
Classification and regression
Tabular, image, time series
Surrogate models available
Real-world constrained engineering design problems. Physical meaning and practical relevance.
Welded Beam Design
Pressure Vessel Design
Tension-Compression Spring
Standard benchmarks for Pareto-front approximation, with analytic fronts for ground-truth evaluation.
ZDT1 to ZDT6
DTLZ1 to DTLZ7
WFG1 to WFG9
Binary / pseudo-boolean test functions for combinatorial optimization benchmarks.
OneMax, LeadingOnes
NK Landscape, Trap
0/1 Knapsack
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 |
Pareto-front approximation |
Multi-Objective |
ZDT / DTLZ / WFG families with analytic fronts |
Binary / combinatorial |
Discrete |
Pseudo-boolean, tunable ruggedness, deception |
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()