{"id":34082758,"url":"https://github.com/smeznar/symbolicregressiontoolkit","last_synced_at":"2026-04-08T12:02:07.733Z","repository":{"id":266320156,"uuid":"897979105","full_name":"smeznar/SymbolicRegressionToolkit","owner":"smeznar","description":"Toolkit for symbolic regression/equation discovery","archived":false,"fork":false,"pushed_at":"2026-04-06T18:18:37.000Z","size":134952,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-06T20:20:12.414Z","etag":null,"topics":["equation-discovery","parameter-estimation","symbolic-regression"],"latest_commit_sha":null,"homepage":"https://smeznar.github.io/SymbolicRegressionToolkit/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smeznar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-03T15:18:51.000Z","updated_at":"2026-04-06T18:18:13.000Z","dependencies_parsed_at":"2024-12-03T17:51:00.453Z","dependency_job_id":"46f13434-8985-47ed-ac19-cd888903d4ca","html_url":"https://github.com/smeznar/SymbolicRegressionToolkit","commit_stats":null,"previous_names":["smeznar/sr_evaluator","smeznar/symbolicregressiontoolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smeznar/SymbolicRegressionToolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smeznar%2FSymbolicRegressionToolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smeznar%2FSymbolicRegressionToolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smeznar%2FSymbolicRegressionToolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smeznar%2FSymbolicRegressionToolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smeznar","download_url":"https://codeload.github.com/smeznar/SymbolicRegressionToolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smeznar%2FSymbolicRegressionToolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31554110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["equation-discovery","parameter-estimation","symbolic-regression"],"created_at":"2025-12-14T12:25:02.563Z","updated_at":"2026-04-08T12:02:07.258Z","avatar_url":"https://github.com/smeznar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SRToolkit: Symbolic Regression / Equation Discovery Benchmark Toolkit\n\n![SRToolkit logo](https://raw.githubusercontent.com/smeznar/SymbolicRegressionToolkit/refs/heads/master/docs/assets/imgs/logo.png)\n\n**Documentation:**: [https://smeznar.github.io/SymbolicRegressionToolkit](https://smeznar.github.io/SymbolicRegressionToolkit/)\n\n## What is SRToolkit?\n\nThe **SRToolkit** is a **comprehensive Python toolkit** designed to accelerate research and development in \n**Symbolic Regression (SR)** / **Equation Discovery (ED)**. It provides a robust, easy-to-use framework for \n**benchmarking, rapid prototyping, and mathematical expression manipulation**.\n\n## Core Features\n\nSRToolkit provides a straightforward interface for:\n\n* **Benchmarking** Symbolic Regression algorithms using built-in datasets (currently **Feynman** and **Nguyen**) or **custom data**.\n\n* **Converting expressions** into **expression trees** or **fast, callable NumPy functions**.\n\n* **Generating random expressions** by defining the symbol space or a grammar.\n\n* **Estimating constant parameters** of expressions against real-world data.\n\n* **Comparing** and **measuring the distance** between expressions.\n\n## Installation\n\nTo install the latest stable release of the package, run the following command in your terminal:\n```\npip install symbolic-regression-toolkit\n```\n\nAlternatively, you can install the latest build directly from the repository with the command:\n\n```\npip install git+https://github.com/smeznar/SymbolicRegressionToolkit\n```\n\n## Examples\n\n### 1. Expression Manipulation (The Toolkit Core)\n\nSRToolkit offers fundamental utilities for working with mathematical expressions as tokens, trees, and executable code—the building blocks for any SR approach.\n\n```python\nimport numpy as np\nfrom SRToolkit.utils import expr_to_executable_function, tokens_to_tree, SymbolLibrary, expr_to_latex\n\n# Create an executable function from the expression\nexpr = expr_to_executable_function([\"X_0\", \"+\", \"X_1\", \"*\", \"C\"])\n\n# Calculate the output at two points (1, 2) and (2, 5) with C=3\ndata_points = np.array([[1, 2], [2, 5]])\nconstants = [3]\noutput = expr(data_points, constants)\n# Variable \"output\" should now contain np.array([7, 17])\n\n# Create a SymbolLibrary defining the symbol space for 2 variables\nsl = SymbolLibrary.default_symbols(num_variables=2)\n\n# Create an expression tree from the token list\nexpr_tree = tokens_to_tree([\"X_0\", \"+\", \"X_1\", \"*\", \"C\"], sl)\n\n# Transform the expression into a list of symbols in postfix notation\npostfix_expr = expr_tree.to_list(notation=\"postfix\")\n\n# Create a LaTeX string of the expression for clear presentation\nexpr_latex = expr_to_latex(expr_tree, sl)\n```\n\n### 2. Benchmarking and Evaluation (The Main Use Case)\n\nThe primary advantage of SRToolkit is its robust benchmarking framework, allowing you to quickly evaluate and compare different Symbolic Regression approaches.\n\n```python\nfrom SRToolkit.dataset import Feynman\nfrom SRToolkit.utils import generate_n_expressions\n\n# Create the Feynman benchmark suite\nfeynman = Feynman()\n\n# List datasets in the benchmark and select the first 2-variable one\ndataset_name = feynman.list_datasets(verbose=False, num_variables=2)[0]\n\n# Create the dataset and the dedicated evaluator object\ndataset = feynman.create_dataset(dataset_name)\nevaluator = dataset.create_evaluator()\n\n# Generate 100 random expressions for a baseline evaluation\nexpressions = generate_n_expressions(dataset.symbol_library, 100)\n\n# Evaluate the expressions and print their error\nfor expr in expressions:\n    rmse = evaluator.evaluate_expr(expr)\n    print(f\"Expr: {''.join(expr)}, Error: {rmse}\")\n\n# Get structured results of the evaluation, focusing on the 20 best expressions\nresults = evaluator.get_results(top_k=20)\n```\n\nAdditional examples can be found in the `examples` folder or in the official documentation.\n\n## Roadmap 🗺️\n\nIn future releases, our primary focus will be on benchmarking and comparability:\n\n* **Benchmarking Core:** Add the ability to save/load benchmark runs and automatically evaluate multiple ED/SR approaches.\n\n* **SR Library:** Create a library of easy-to-use and comparable ED/SR approach implementations.\n\n* **Advanced Expressions (Distant Plan):** Implement support for different types of expressions, such as **ODEs and PDEs**.\n\n* **Constraints:** Implement more robust expression generation constraints using techniques like attribute grammars.\n\n## Contributing 🤝\n\nWe welcome contributions! Whether you're adding a new benchmark, implementing an SR approach, fixing a bug, or improving the documentation, please feel free to submit a **Pull Request (PR)** with a clear description of your changes.\n\nWe are especially looking for contributions of:\n\n* New **Benchmarks** and **Datasets** (e.g., datasets from physics, finance, etc.).\n\n* Implementations of additional **Symbolic Regression Approaches** (once the core framework for comparison is finalized).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmeznar%2Fsymbolicregressiontoolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmeznar%2Fsymbolicregressiontoolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmeznar%2Fsymbolicregressiontoolkit/lists"}