Kernel Optimization for GDPA

Research

Instruction

Learn a closed-form expression f(x1, …, xd) that predicts the target y for several synthetic datasets.
Each dataset is provided as a CSV file with columns x1, x2, …, xd, y. Your solver must fit a single symbolic expression per dataset. All datasets share the same API and scoring rules.

Input Format

  • During evaluation, your Solution.solve implementation receives the full feature matrix X (numpy.ndarray of shape n × d) and target vector y (numpy.ndarray of length n).
  • Datasets available under resources/data/ (and mirrored via download_datasets.sh) include:
    • dataset_mccormick.csv
    • dataset_peaks.csv
    • dataset_sincos.csv
    • dataset_ripple.csv
    • dataset_mixed_polyexp_4d.csv

Output Specification

Implement Solution in solution.py with the following interface:

class Solution:
    def __init__(self, **kwargs):
        ...

    def solve(self, X, y) -> dict:
        return {
            "expression": "<python expression in x1..xd>",
            "predictions": [...],  # length-n list/array (optional; auto-derived from expression if omitted)
            "details": {
                "loss": <optional>,
                "complexity": <optional integer>,
                ...
            },
        }
  • expression must be a single Python-evaluable string using variables x1..xd, numeric constants, binary operators + - * /, parentheses, and unary functions sin, cos, exp, log.
  • If predictions are omitted or have the wrong length, the evaluator will regenerate them by evaluating expression on the dataset.
  • If details["complexity"] is missing, the evaluator computes complexity from the expression tree.

Scoring

For each dataset:

MSE = (1/n) Σ_i (y_i - ŷ_i)²
Score = 100 × clamp((m_base - MSE) / (m_base - m_ref), 0, 1) × 0.99^(max(C - C_ref, 0))

where:

  • m_base is the Mean Squared Error of the linear baseline (precomputed).
  • m_ref and C_ref are the MSE and complexity of the provided reference expression.
  • C is the complexity of your expression, given by 2 × (#binary ops) + (#unary ops).
  • If m_base = m_ref, the score is 100 when MSE ≤ m_ref and 0 otherwise.

The overall score reported by evaluate.sh is the mean score across datasets.

Environment & Dependencies

  • set_up_env.sh creates a dedicated virtual environment in execution_env/.venv_symbolic_regression and installs pysr, numpy, pandas, and sympy.
  • If you rely on additional packages, install them from within your solution (network access permitting).

Evaluation Flow

  1. download_datasets.sh copies the CSV files into the shared datasets/symbolic_regression cache.
  2. set_up_env.sh prepares the Python environment.
  3. Your solution.py should reside in execution_env/solution_env/solution.py.
  4. evaluate.sh activates the environment, runs evaluator.py, and prints the mean score. Detailed per-dataset metrics are written to result.json.

Resources

  • resources/data/: CSV datasets used for training/evaluation.
  • resources/reference_metrics.json: Baseline linear-error and reference expression metrics used for scoring.
  • evaluator.py: Evaluation entry point invoked by evaluate.sh.

Created by

Website template modified from https://www.tbench.ai/.