Skip to content

feat: Add SMGPRegressor (Smooth Multifunction Genetic Programming - #209

Open
MichalicekPetr wants to merge 16 commits into
cavalab:masterfrom
MichalicekPetr:add-smgp
Open

feat: Add SMGPRegressor (Smooth Multifunction Genetic Programming#209
MichalicekPetr wants to merge 16 commits into
cavalab:masterfrom
MichalicekPetr:add-smgp

Conversation

@MichalicekPetr

Copy link
Copy Markdown

Description

This Pull Request introduces SMGPRegressor (Smooth Multifunction Genetic Programming), a novel symbolic regression method designed to address the challenges of non-linear, discontinuous fitness landscapes and efficient hardware acceleration (GPGPU mapping) in traditional Genetic Programming Algorithms (GPAs).

The core of this method is based on the research paper "Smooth multi-function in evolutionary algorithm concept" (Michalicek & Brandejsky, University of Pardubice).

Scientific Background & Innovation

Traditional GPAs suffer from low causality in their search space: a single mutation or crossover event (e.g., swapping a multiplication for a sine operator) causes a radical, discontinuous jump in the fitness landscape.

SMGPRegressor solves this by eliminating the traditional structural evolution of trees during parameter tuning. It embeds a perfect binary tree of Multifunctions parameterized by a single control variable Gamma.

Unlike previous versatile/smooth functions (e.g., Diviplication, Subdition, or Versatile Functions with multiple control variables that artificially inflate the dimensionality of the fitness landscape), our proposed method maps n pairs of basis functions into a single continuous template controlled by a single parameter Gamma.

The transition between functions is smoothly continuous (C^1 class continuity). To resolve the non-differentiable sharp bounds of classic triangle/sawtooth membership functions, we utilize a Fourier series approximation of the triangle wave. This guarantees that the left and right derivatives match at all boundary points, smoothing the fitness landscape and enabling highly efficient continuous parameter optimization.

Key Advantages for Benchmarking

  • Smoother Fitness Landscape: The algorithm converts a discrete structural search into a continuous parameter optimization space (G vector tuning), drastically decreasing the risk of getting trapped in local optima.
  • GPGPU Optimization: The fixed, perfect binary tree structure eliminates the overhead of transferring complex tree graphs between CPU and GPU. The individual can be flattened into a single compact vector/stream of numbers, making it highly suitable for high-throughput parallel computing.

Architecture & Integration Details

The repository has been structured strictly following the SRBench Contribution Guide:

  • Separation of Source Code: The repository contains no raw engine source code. It utilizes install.sh to pull the stable engine components from our source repository during the benchmarking setup.
  • Scikit-Learn Compatibility: The SMGPRegressor fully implements the standard .fit(X, y) and .predict(X) API.
  • Metadata & Requirements: Includes a fully compliant metadata.yml matching the execution requirements.
  • Time and Random Constraints: The implementation supports the maxSeconds parameter and correctly exposes the random_state attribute for reproducibility.
  • SymPy Export: The global model(est, X=None) function maps internal representations back to standard, clean SymPy mathematical equations matching the input feature names of the training pd.DataFrame.

Checklist

  • API is fully compatible with scikit-learn (fit, predict).
  • Python >= 3.7 compatibility tested.
  • random_state attribute exposed and respected.
  • Clean folder structure containing metadata.yml, regressor.py, install.sh, and LICENSE.
  • model(est, X=None) returns a valid SymPy-compatible string with correct column mapping.
  • install.sh does not require sudo permissions.
  • Source code isolated and pulled via install.sh.

@lacava

lacava commented Jul 31, 2026

Copy link
Copy Markdown
Member

thanks for your patience. we finally fixed the other methods that were failing in docker on main. once the tests pass we'll perform our review and update you.

lacava added a commit that referenced this pull request Aug 13, 2026
every push and PR rebuilds all 27 images, because the gate in build-and-test
is hardcoded to should_run=true (5b13029). check-changes already computes what
changed, but nothing consumes it. one method submission can cost a lot: #209
went through 16 full 27-image runs, #210 and #212 another 24 between them.

pull requests now build only the methods they touch. everything else - pushes
to master/dev, the new weekly schedule, manual dispatch - still rebuilds
everything, so a method that breaks from upstream drift without anyone
touching it still gets caught. that drift is calendar-driven, which is what
the schedule is for; during a quiet stretch there are no merges to catch it.

- a method rebuilds if either algorithms/<name>/ or experiment/methods/<name>/
  changed. the second one matters: a regressor.py edit has to retest the
  method even though the install is untouched.
- changes to shared build inputs (dockerfiles, base_environment, scripts,
  entry.sh, configure.sh, workflows) still rebuild everything.
- build-and-test always runs and always reports for every algorithm, so the
  check names stay present and can be marked required. only the docker build
  step is skipped.
- dropped always() from build-and-test. with the gate inside the job, a failed
  check-changes would have left an empty build list, skipped every build and
  reported green.
- check-changes no longer diffs against github.event.before, so a force-push
  to a CI branch no longer fails the job.

also fixes a long-standing bug: changed-experiments used awk field $2 on
experiment/methods/<name>/..., which is the literal string "methods", not the
method name. it needs $3. nothing consumed that output before, so it never
showed up.
@lacava

lacava commented Aug 13, 2026

Copy link
Copy Markdown
Member

we finally got the validation checks working, so we just need you to fix the following:

Error: smgp: algorithms/smgp/metadata.yml is missing required key(s): email, url

1 problem(s) found. See CONTRIBUTING.md for the expected layout.
Error: Process completed with exit code 1.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants