Vedant Deshmukh

AI models · simulations · systems & tools

Work Glassbox

Glassbox

Symbolic regression that returns a readable equation, not a black box.

Year
2026
Stack
Python, C++
Status
Active
Code
GitHub

Most regression models predict well and explain nothing. Glassbox is an attempt to recover the formula itself: a short expression that fits the data and can be checked by hand. The output is the equation, not a model that approximates one.

A candidate has to be accurate and legible. A slightly worse fit with a simpler expression is often the better result.

The runtime is a hybrid pipeline, not a single model:

  1. Validate the input and optionally reduce black-box features.
  2. Build basis terms with the classifier fast path; check exact matches.
  3. Propose skeletons with the neural proposer and specialist passes.
  4. Search structure and constants with C++ island evolution.
  5. Simplify the displayed formula and score it directly.

Only the last step decides the score. Benchmarks evaluate the displayed formula, not the engine’s internal fitness, so a good number cannot hide an unreadable expression. The C++ extension is optional; the Python layer falls back when _core is unavailable.

598/615

Latest recorded full-suite run, 9 September 2026. 189 of 205 formulas exact.

The score is weighted: 3 for exact, 2 for approximate, 1 for loose. Most of the gain came between May and early June; the specialist path has held near 590 since, with a late push to 598.

The sklearn-compatible entry point:

import numpy as np
from glassbox.sr.sklearn_wrapper import GlassboxRegressor

X = np.linspace(-3, 3, 300).reshape(-1, 1)
y = X[:, 0] ** 2 + np.sin(X[:, 0])

est = GlassboxRegressor(timeout=60, random_state=42)
est.fit(X, y)

print(est.get_formula())
print(est.best_mse_)

Running a clean SRBench pass with multiple seeds, plus cutting a release that matches the current hybrid runtime. The repository still carries research paths the default runtime no longer uses; removing them is part of making the result reproducible.