Skip to content

Commit

Permalink
move files into new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Apr 13, 2024
1 parent f0eb2ec commit e923d2e
Show file tree
Hide file tree
Showing 44 changed files with 189 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/surfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
__version__ = importlib.metadata.version("surfaces")
__license__ = "MIT"

from .mathematical_functions import (
from .test_functions import (
mathematical_functions,
mathematical_functions_1d,
mathematical_functions_2d,
mathematical_functions_nd,
machine_learning_functions,
)

from .machine_learning_functions import machine_learning_functions

test_functions: list = mathematical_functions + machine_learning_functions

Expand Down
Binary file modified src/surfaces/search_data.db
Binary file not shown.
135 changes: 135 additions & 0 deletions src/surfaces/test_functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Author: Simon Blanke
# Email: [email protected]
# License: MIT License

from .mathematical import (
AckleyFunction,
BealeFunction,
BoothFunction,
BukinFunctionN6,
CrossInTrayFunction,
DropWaveFunction,
EasomFunction,
EggholderFunction,
GoldsteinPriceFunction,
GramacyAndLeeFunction,
GriewankFunction,
HimmelblausFunction,
HölderTableFunction,
LangermannFunction,
LeviFunctionN13,
MatyasFunction,
McCormickFunction,
RastriginFunction,
RosenbrockFunction,
SchafferFunctionN2,
SimionescuFunction,
SphereFunction,
StyblinskiTangFunction,
ThreeHumpCamelFunction,
)
from .machine_learning import (
KNeighborsClassifierFunction,
GradientBoostingRegressorFunction,
KNeighborsRegressorFunction,
)


__all__ = [
"AckleyFunction",
"BealeFunction",
"BoothFunction",
"BukinFunctionN6",
"CrossInTrayFunction",
"DropWaveFunction",
"EasomFunction",
"EggholderFunction",
"GoldsteinPriceFunction",
"GramacyAndLeeFunction",
"GriewankFunction",
"HimmelblausFunction",
"HölderTableFunction",
"LangermannFunction",
"LeviFunctionN13",
"MatyasFunction",
"McCormickFunction",
"RastriginFunction",
"RosenbrockFunction",
"SchafferFunctionN2",
"SimionescuFunction",
"SphereFunction",
"StyblinskiTangFunction",
"ThreeHumpCamelFunction",
"KNeighborsClassifierFunction",
"GradientBoostingRegressorFunction",
"KNeighborsRegressorFunction",
]

mathematical_functions = [
AckleyFunction,
BealeFunction,
BoothFunction,
BukinFunctionN6,
CrossInTrayFunction,
DropWaveFunction,
EasomFunction,
EggholderFunction,
GoldsteinPriceFunction,
GramacyAndLeeFunction,
GriewankFunction,
HimmelblausFunction,
HölderTableFunction,
LangermannFunction,
LeviFunctionN13,
MatyasFunction,
McCormickFunction,
RastriginFunction,
RosenbrockFunction,
SchafferFunctionN2,
SimionescuFunction,
SphereFunction,
StyblinskiTangFunction,
ThreeHumpCamelFunction,
]


mathematical_functions_1d = [
GramacyAndLeeFunction,
]


mathematical_functions_2d = [
AckleyFunction,
BealeFunction,
BoothFunction,
BukinFunctionN6,
CrossInTrayFunction,
DropWaveFunction,
EasomFunction,
EggholderFunction,
GoldsteinPriceFunction,
HimmelblausFunction,
HölderTableFunction,
LangermannFunction,
LeviFunctionN13,
MatyasFunction,
McCormickFunction,
RosenbrockFunction,
SchafferFunctionN2,
SimionescuFunction,
ThreeHumpCamelFunction,
]


mathematical_functions_nd = [
GriewankFunction,
RastriginFunction,
SphereFunction,
StyblinskiTangFunction,
]

machine_learning_functions = [
KNeighborsClassifierFunction,
GradientBoostingRegressorFunction,
KNeighborsRegressorFunction,
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time

from .data_collector import SurfacesDataCollector
from ..data_collector import SurfacesDataCollector


class BaseTestFunction:
Expand Down
Empty file.
Empty file.
Empty file.
51 changes: 51 additions & 0 deletions src/surfaces/test_functions/mathematical/test_search_space.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import pytest

from surfaces import (
mathematical_functions_1d,
mathematical_functions_2d,
mathematical_functions_nd,
machine_learning_functions,
)


mathematical_functions_1d = (
"test_function",
mathematical_functions_1d,
)

mathematical_functions_2d = (
"test_function",
mathematical_functions_1d,
)

mathematical_functions_nd = (
"test_function",
mathematical_functions_1d,
)


machine_learning_functions_d = (
"test_function",
machine_learning_functions,
)


@pytest.mark.parametrize(*mathematical_functions_d)
def test_(test_function):
try:
test_function_ = test_function()
except TypeError:
test_function_ = test_function(n_dim=2)

objective_function = test_function_.objective_function
search_space = test_function_.search_space(value_types="array")
n_iter = 20


@pytest.mark.parametrize(*machine_learning_functions_d)
def test_all_(test_function):
test_function_ = test_function()

objective_function = test_function_.objective_function
search_space = test_function_.search_space()
n_iter = 20

0 comments on commit e923d2e

Please sign in to comment.