Skip to content
SN SymbolicNature

Estimators Factory API

Documentation · 02

Estimators & Factory API

Create SymbolicNature estimators through a consistent registry and factory interface.

Factory functions

The factory API allows algorithms to be selected by registry key, abbreviation, display name or supported alias.

from symbolicnature import (
    create_estimator,
    create_regressor,
    create_classifier,
)

reg = create_regressor(
    "gwtp",
    preset="balanced",
    random_state=42,
)

clf = create_classifier(
    "rsp",
    preset="turbo",
    random_state=42,
)

Explicit task selection

model = create_estimator(
    "icp",
    task="regression",
    preset="fast",
    random_state=42,
)

binary_model = create_estimator(
    "icp",
    task="binary_classification",
    preset="fast",
    random_state=42,
)

multi_model = create_estimator(
    "icp",
    task="multiclass_classification",
    preset="fast",
    random_state=42,
)

Registry inspection

from symbolicnature import (
    available_algorithms,
    available_algorithm_details,
    describe_algorithm,
    get_algorithm_spec,
)

print(available_algorithms())
print(describe_algorithm("gwtp"))
print(get_algorithm_spec("icp"))

Supported task names

Canonical taskExamples accepted by the factory
Regressionregression, regressor, reg, symbolic_regression
Binary classificationbinary, binary_classification, binary_classifier
Multiclass classificationmulticlass, multi_class, multiclass_classification
General classificationclassification, classifier, clf, symbolic_classification

Auto and portfolio estimators

The factory also recognizes the meta-estimator names auto, portfolio, symbolicnature_auto and symbolicnature_portfolio. These route to the corresponding automatic or portfolio regression/classification estimators.

Runtime configuration

Runtime controls can be supplied through the factory or attached with configure_estimator(). Examples include evaluation budgets, backend selection, diagnostics, objective mode, constant optimization, search tracing and checkpoint controls.

from symbolicnature import configure_estimator

configure_estimator(
    model,
    max_fitness_evaluations=10000,
    trace_search=True,
    checkpoint_every=1,
)

Comments