{"id":35176283,"url":"https://github.com/ogeagla/closyr","last_synced_at":"2026-05-17T20:37:05.154Z","repository":{"id":223696735,"uuid":"741021185","full_name":"ogeagla/closyr","owner":"ogeagla","description":"A symbolic regression tool written in Clojure","archived":false,"fork":false,"pushed_at":"2026-01-10T16:15:16.000Z","size":16740,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-10T18:21:10.483Z","etag":null,"topics":["clojure","computer-algebra","genetic-algorithms","genetic-programming","symbolic-ai","symbolic-math","symbolic-regression"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ogeagla.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-01-09T14:37:43.000Z","updated_at":"2025-12-30T06:55:23.000Z","dependencies_parsed_at":"2024-02-21T16:36:15.038Z","dependency_job_id":"f62502fa-32fe-4e52-8c31-1c969dcdc2c3","html_url":"https://github.com/ogeagla/closyr","commit_stats":null,"previous_names":["ogeagla/closyr"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ogeagla/closyr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogeagla%2Fclosyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogeagla%2Fclosyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogeagla%2Fclosyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogeagla%2Fclosyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ogeagla","download_url":"https://codeload.github.com/ogeagla/closyr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogeagla%2Fclosyr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33154036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["clojure","computer-algebra","genetic-algorithms","genetic-programming","symbolic-ai","symbolic-math","symbolic-regression"],"created_at":"2025-12-28T22:20:16.605Z","updated_at":"2026-05-17T20:37:05.148Z","avatar_url":"https://github.com/ogeagla.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# closyr\n\n[![Clojure CI](https://github.com/ogeagla/closyr/actions/workflows/clojure.yml/badge.svg?branch=master)](https://github.com/ogeagla/closyr/actions/workflows/clojure.yml)\n\n![icon_v5_qtr.png](resources%2Ficons%2Ficon_v5_qtr.png)\n\nA Symbolic Regression tool to search for symbolic expressions which minimize residuals to an objective, written in Clojure.\n\n![gui_evolution_sample_Peek 2024-02-14 08-21.gif](screenshots%2Fgui_evolution_sample_Peek%202024-02-14%2008-21.gif)\n\nWarning: This is experimental software, with an unstable API. Expect breaking changes prior to a major release.\n\n- Draw an objective function, select a built-in dataset, or provide a CSV\n- Select number of points, iterations\n- See progress \n  - Chart of best fitting function\n  - Chart of loss over time\n  - A selectable text version of the function\n\n## Installation\n\n\nRun the application from binary, download a release JAR and see the Usage section below.  \nThis project is not yet available in a JAR repository (though I'd use Clojars if enough requests).\n\n\nOr, you can run the app from source, using Clojure development tools (`leiningen`) in this project:\n\n    $ lein deps/repl/run/uberjar...\n\n## Usage\n\nUse the application via GUI or in the terminal. \n\nThere are 4 ways to run the application.  See next section for details about the options you can provide when running the app.\n\n\n### Run the provided realase JAR\n\nRequirements: Java\n\n\n    $ java -jar closyr-0.1.0-SNAPSHOT-standalone.jar ...options here...\n\n\n### Lein Run\n\nRequirements: Java, Leiningen\n\n\n    $ lein run\n\nOr headless (just in the terminal), where you can specify options and input data:\n\n    $ lein run -t -p 25 -i 5 -x 0,1,2,3,4,5,6 -y 1,2,30,4,5,6,10\n\nWhich is the same as:\n\n    $ lein run --headless --population 1000 --iterations 200 --xs 0,1,2,3,4,5,6 --ys 1,2,30,4,5,6,10 \n\n###  In Clojure REPL\n\nRequirements: Java, Leiningen (I will provide a deps file if enough interest)\n\n\n    (require '[closyr.symbolic-regression :as symreg]) \n    (symreg/run-app-with-gui)\n\n### Build and run JAR\n\nRequirements: Java, Leiningen\n\n\n    $ lein uberjar\n    $ java -jar target/uberjar/closyr-0.1.0-standalone.jar\n\nYou can also provide the same command-line options to `java` command, like:\n\n    $ java -jar target/uberjar/closyr-0.1.0-standalone.jar -t -p 25 -i 5 -x 0,1,2,3,4,5,6 -y 1,2,30,4,5,6,10\n\n## Options\n| Short, Long Option      | Required?       | Example | Default | Description                                                                                                                   |\n|-------------------------|-----------------|---------|---------|-------------------------------------------------------------------------------------------------------------------------------|\n| `-t`,`--headless`       | no              | `-t`    | `false` | run without GUI, in terminal only                                                                                             |     \n| `-c`,`--use-flamechart` | no              | `-c`    | `false` | run with flamecharts, run then visit http://localhost:54321/flames.svg                                                        |     \n| `-p`,`--population`     | no              | `100`   | `20`    | size of population which will evolve; the number of functions we create and modify                                            |    \n| `-i`,`--iterations`     | no              | `50`    | `10`    | number of iterations to run for                                                                                               |    \n| `-l`,`--max-leafs`      | no              | `40`    | `40`    | max number of AST tree leafs in candidate functions                                                                           |    \n| `-x`,`--xs`             | no, unless `ys` | `1,3,4` | random  | the xs for the points in the dataset to fit against; if provided, must also provide `ys` and be the same count                | \n| `-y`,`--ys`             | no, unless `xs` | `2,4,8` | random  | the ys for the points in the dataset to fit against; if provided, must also provide `xs` and be the same count                |    \n| `-f`,`--infile`         | no              | `f.csv` |         | A CSV file. Contains either 2 columns without titles in first row, or has columns `x` and `y` to be used as objective dataset |  \n\n## Example Screenshots\n\nOn successful application start, you can start an run a search.  You might see something like this when done:\n\n![gui_done_2024-02-12_08-44.png](screenshots%2Fgui_done_2024-02-12_08-44.png)\n\nAn example of using the GUI:\n\n![gui_usage_clip_Peek 2024-02-12 09-03.gif](screenshots%2Fgui_usage_clip_Peek%202024-02-12%2009-03.gif)\n\n## Tests\n\n    $ lein test\n\nCoverage looks like this if you run `lein cloverage`:\n\n![test_coverage_2024-02-16_16-39.png](screenshots%2Ftest_coverage_2024-02-16_16-39.png)\n\n## How It Works\n\n- We use Genetic Algorithms to allow candidate functions of best fit to compete.\n- They compete on a computed score on the input data, and we use the sum of residuals to generate the score.\n- Evolution consists of mutation and crossover. \n- Mutations act on the function's AST and modify branches, leafs, or the whole tree.  Operations like `+0.1`, `*x`, `/Sin(x)` are applied to functions.\n- Crossovers combine two functions' ASTs at a random point, and combine using various operators like `+`, and `*`.\n\n## Roadmap\n\n- [x] CLI options accept a CSV file (GUI already supports this)\n- [ ] More tests\n- [ ] Use something like ProGuard to shrink the JAR for releases \n  - https://www.guardsquare.com/manual/configuration/examples\n  - https://stackoverflow.com/questions/12281365/obfuscating-clojure-uberjars-with-proguard\n  - https://github.com/eiffelqiu/obfuscate-clojure-project-demo/tree/master\n- [ ] A different frontend.  The current Java Swing frontend does the job, but it's not easy to maintain and it's hard to make look better.\n- [ ] Can this be a follow-up to this issue, asking for a symbolic regression tool on the JVM? https://github.com/axkr/symja_android_library/issues/850\n- [ ] When I created this and my other symbolic regression tools, I didn't know about the formal field of symbolic regression.  I've since found some great libraries that I should review and apply the lessons to this project: https://github.com/MilesCranmer/PySR\n\n\n## Credits\n\n- This project would not have been possible without the symbolic math library `Symja` (https://github.com/axkr/symja_android_library), which has been great to use and I consider it to be like a `MathJs` (https://github.com/josdejong/mathjs) on the JVM.\n\n\n## Contribute\n\nI accept PRs, please open an issue to discuss beforehand to make sure we are in alignment. Thanks!\n\n\n\n## License\n\nCopyright © 2024 Octavian Geagla\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n\n``` \n________/\\\\\\\\\\\\\\\\\\__/\\\\\\___________________/\\\\\\\\\\__________/\\\\\\\\\\\\\\\\\\\\\\____/\\\\\\________/\\\\\\____/\\\\\\\\\\\\\\\\\\_____\n _____/\\\\\\////////__\\/\\\\\\_________________/\\\\\\///\\\\\\______/\\\\\\/////////\\\\\\_\\///\\\\\\____/\\\\\\/___/\\\\\\///////\\\\\\___\n  ___/\\\\\\/___________\\/\\\\\\_______________/\\\\\\/__\\///\\\\\\___\\//\\\\\\______\\///____\\///\\\\\\/\\\\\\/____\\/\\\\\\_____\\/\\\\\\___\n   __/\\\\\\_____________\\/\\\\\\______________/\\\\\\______\\//\\\\\\___\\////\\\\\\_____________\\///\\\\\\/______\\/\\\\\\\\\\\\\\\\\\\\\\/____\n    _\\/\\\\\\_____________\\/\\\\\\_____________\\/\\\\\\_______\\/\\\\\\______\\////\\\\\\____________\\/\\\\\\_______\\/\\\\\\//////\\\\\\____\n     _\\//\\\\\\____________\\/\\\\\\_____________\\//\\\\\\______/\\\\\\__________\\////\\\\\\_________\\/\\\\\\_______\\/\\\\\\____\\//\\\\\\___\n      __\\///\\\\\\__________\\/\\\\\\______________\\///\\\\\\__/\\\\\\_____/\\\\\\______\\//\\\\\\________\\/\\\\\\_______\\/\\\\\\_____\\//\\\\\\__\n       ____\\////\\\\\\\\\\\\\\\\\\_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\____\\///\\\\\\\\\\/_____\\///\\\\\\\\\\\\\\\\\\\\\\/_________\\/\\\\\\_______\\/\\\\\\______\\//\\\\\\_\n        _______\\/////////__\\///////////////_______\\/////_________\\///////////___________\\///________\\///________\\///__\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogeagla%2Fclosyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fogeagla%2Fclosyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogeagla%2Fclosyr/lists"}