BayeSym𝕏 searches over forests of symbolic expression trees, ranks symbolic models across independent parallel MCMC chains, and reports an Occam's window set of learned equations. Based on Roy, S., Dey, P., Mallick, B. K., & Pati, D. Probabilistic Symbolic Regression for Equation Discovery via Operator-induced and Regularized Symbolic Forests. (2026+; https://arxiv.org/abs/2509.19710)
Description
Repository provenance
This Hugging Face repository is sourced from and mirrors the canonical
Roy-SR-007/BayeSymX GitHub repository.
The authoritative source code, development history, issue tracker, and pull
requests are maintained on GitHub. This Hugging Face mirror is provided for
discoverability and convenient distribution.
Overview of the BayeSym𝕏 model
For a symbolic forest containing $K$ symbolic trees representing expressions (constructed recursively from features and operators), BayeSym𝕏 models the response as
where the symbolic tree prior is equipped with depth-dependent regularization to control symbolic expression complexity. Also, the distribution of (y| T, X) is obtained after integrating out model regression and noise parameters with respect to their corresponding prior. The Dirichlet prior over operator and feature weight vectors of each tree enables data-adaptive learning of operator and feature preferences.
BayeSymX probabilistic symbolic forest model overview
Highlights
Posterior sampling — executes parallel MCMC chains for efficient exploration of symbolic forest space.
Interpretable symbolic models — constructs compact symbolic expressions (equations) using different mathematical (binary and unary) operators.
Symbolic model selection — ranks using JMP over symbolic forests and retain an Occam's window set of expressions.
Compact final symbolic expressions — performs post-MCMC symbolic model refinement using BIC and SymPy.
Train/test predictive accuracy — reports train and test accuracy of learned expressions through RMSE, MAE, and $R^2$.
optional; required only to run example.ipynb interactively
json, pathlib, dataclasses, typing, math, random, copy, time, os, sys, shutil, queue, multiprocessing, and concurrent.futures come from the Python standard library.
Nonempty sequence containing one integer seed per MCMC chain
Model and prior controls
prior_params
No
None
Optional (alpha_op, alpha_ft, alpha, delta, beta0, V0, a0, b0) prior specification; default priors are constructed when omitted; see below
add_intercept
No
True
Include an intercept in the regression model
wts_init
No
None
Initial operator and feature sampling weights, specified as [op_weights, feature_weights]
wts_prop
No
None
Operator and feature proposal weights used during MCMC
opset
No
None
Operator dictionaries available to the trees; None uses the complete default operator set; see below
ftset
No
None
Feature names; defaults to x0, x1, … and must follow the column order of X_train
move_weights
No
None
Mapping or seven-element sequence controlling the probabilities of MCMC symbolic tree moves; see below
MCMC and parallel chain execution
maxiter
No
1000
Number of MCMC iterations performed by each chain
r
No
10
Number of top log-JMP forests to post-process and return
burnin
No
0
Number of initial iterations excluded from retained states
thin
No
1
Retain every thin-th iteration after burn-in
n_jobs
No
None
Number of worker processes; defaults to min(number_of_chains, CPU_count)
show_progress
No
True
Display the launch banner and live parallel-chain progress
report_every
No
10
Number of iterations between worker-to-parent progress reports
Test-data evaluation
X_test
No
None
Optional held-out feature matrix; must be supplied together with y_test
y_test
No
None
Optional held-out response vector; must be supplied together with X_test
Symbolic model refinement
force_intercept
No
False
Require the BIC-selected reduced model to retain the intercept
blr_prior
No
None
Optional (beta0_full, V0_full, a0, b0) prior for reduced-model Bayesian linear regression
prior_variance
No
10.0
Fallback coefficient-prior variance used during model reduction
rcond
No
None
Numerical cutoff passed to least-squares and pseudoinverse calculations
Results and formatting
significant_digits
No
6
Number of significant digits used in expressions and formatted numerical output
print_results
No
False
Print the styled raw- and final-model result tables
Trace plot controls
show_trace_plot
No
False
Display the combined parallel-chain log-JMP trace plot
save_trace_plot
No
False
Save the trace plot to a file
trace_plot_path
No
None
Output file or directory; defaults to ./bayesymx_parallel_log_jmp_traces.png when saving
trace_plot_dpi
No
300
Resolution, in dots per inch, used when saving the trace plot
Default prior parameters
When prior_params=None, BayeSym𝕏 constructs the following prior parameters automatically:
Prior parameter
Default value
Meaning
alpha_op
np.ones(len(opset))
Symmetric Dirichlet concentration parameters for operator usage
alpha_ft
np.ones(len(ftset))
Symmetric Dirichlet concentration parameters for feature usage
alpha
0.95
Initial depth-dependent splitting probability
delta
1.20
Rate at which the splitting probability decreases with tree depth
beta0
np.zeros(K + int(add_intercept))
Prior mean of the regression coefficients
V0
10.0 * np.eye(K + int(add_intercept))
Prior covariance matrix for the regression coefficients
a0
0.05
Prior shape-related parameter for the model variance
b0
0.05
Prior scale-related parameter for the model variance
Default full operator set
When opset=None, BayeSym𝕏 considers the following full set of operators:
Operator
Arity
Evaluation
add
2
$x_1+x_2$
mul
2
$x_1\times x_2$
neg
1
$-x$
inv
1
protected $1/x$, with near-zero values stabilized
sin
1
$\sin(x)$
cos
1
$\cos(x)$
exp
1
$\exp(x)$, with its argument clipped for numerical safety
sq
1
$x^2$
cu
1
$x^3$
sqrt_op
1
protected $\sqrt{\lvert x \rvert}$
Supply a restricted set when domain knowledge supports it, as below:
python
1result_json = run_bayesymx(2...,3 opset=[add, mul, sin, sq],4...5)
Symbolic tree moves
The MCMC proposal kernel supports the following seven symbolic tree moves:
grow
prune
change_feature
change_operator
subtree_replace
delete_node
insert_node
symbolic tree moves
When move_weights=None, BayeSym𝕏 considers the following default move weights:
python
1move_weights ={2"grow":1.0,3"prune":1.0,4"change_feature":1.0,5"change_operator":1.0,6"subtree_replace":1.0,7"delete_node":1.0,8"insert_node":1.0,9}1011# optionally you can set the move_weights also as12move_weights =[1,1,1,1,1,1,1]
Result schema
run_bayesymx() returns a JSON string of results with the following hierarchy: