pandoc-symreg: A tool to convert symbolic regression expressions into different formats.

[ gpl, library, math, program, text ] [ Propose Tags ] [ Report a vulnerability ]

A pandoc-like cli tool and library to convert symbolic regression expressions to convenient formats


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.2.1.3
Change log CHANGELOG.md
Dependencies attoparsec (>=0.14 && <0.15), attoparsec-expr (>=0.1 && <0.2), base (>=4.7 && <5), bytestring (>=0.11 && <0.12), containers (>=0.6.5 && <0.7), deriving-compat (>=0.6.3 && <0.7), hegg (>=0.3.0 && <0.4), ieee754 (>=0.8.0 && <0.9), mtl (>=2.2 && <2.4), optparse-applicative (>=0.18 && <0.19), pandoc-symreg, srtree (>=1.0.0.4 && <1.1) [details]
License GPL-3.0-only
Copyright 2023 Fabricio Olivetti de França
Author Fabricio Olivetti de França
Maintainer fabricio.olivetti@gmail.com
Category Text, Math
Home page https://github.com/folivetti/pandoc-symreg#readme
Bug tracker https://github.com/folivetti/pandoc-symreg/issues
Source repo head: git clone https://github.com/folivetti/pandoc-symreg
Uploaded by olivetti at 2023-06-25T11:57:33Z
Distributions
Executables pandoc-symreg
Downloads 342 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for pandoc-symreg-0.2.1.3

[back to package description]

pandoc-symreg: a pandoc-like tool to convert symbolic regression expressions to convenient formats.

githubrelease hackagerelease stackage LTSpackage CItests license

Conversion tool for Symbolic Regression algorithms

Pandoc-Symreg is a Haskell library and CLI inspired by Pandoc for converting the output of Symbolic Regression tools to convenient formats for post analysis and documentation. It currently supports converting the output from

And it can convert to

  • python (Numpy expression)
  • math (Plain math expression)
  • tikz (TikZ code to print a tree)
  • latex (LaTeX equation)

This tool also supports changing floating-point numbers into parameter variables (named t or theta) and simplifying the expression using Equality Saturation as described in:

de França, Fabrício Olivetti and Kronberger, Gabriel. "Reducing Overparameterization of Symbolic Regression Models with Equality Saturation." Proceedings of the Genetic and Evolutionary Computation Conference. 2023. DOI: https://doi.org/10.1145/3583131.3590346

Installing

This tool can be installed via Cabal or Stack. The easiest way to install is via Haskell stack:

  • Install Haskell Tool Stack
  • Clone this repository
  • Inside the project directory run the command stack install

There are also binaries available at releases

Usage

Usage: pandoc-symreg (-f|--from ['tir'|'hl'|'operon'|'bingo'|'gomea'|'pysr'|'sbp'|'eplex'])
                     (-t|--to ['python'|'math'|'tikz'|'latex']) 
                     [-i|--input INPUT] [-o|--output OUTPUT] 
                     [-v|--varnames VARNAMES] [-p|--parameters] [--simplify]

  Convert different symbolic expressions format to common formats.

Available options:
  -f,--from ['tir'|'hl'|'operon'|'bingo'|'gomea'|'pysr'|'sbp'|'eplex']
                           Input expression format
  -t,--to ['python'|'math'|'tikz'|'latex']
                           Output expression format
  -i,--input INPUT         Input file containing expressions. Empty string gets
                           expression from stdin. (default: "")
  -o,--output OUTPUT       Output file to store expressions. Empty string prints
                           expressions to stdout. (default: "")
  -v,--varnames VARNAMES   Comma separated list of variables names. Empty list
                           assumes the default of each algorithm (e.g,
                           "x,y,epsilon"). (default: "")
  -p,--parameters          Convert floating point numbers to free parameters.
  --simplify               Simplifies the expression using Equality Saturation.
  -h,--help                Show this help text

Contributing

If you want to add support to your SR algorithm, have a look at the file src/PandocSR.hs at the current parsers. You can either modify that file and make a Pull request or open an issue with the following informations:

  • The name of your algorithm
  • A list of supported univariate functions and their string representations
  • A list of supported bivariate functions and their string representations
  • A list of supported binary operators and their string representations. The string representation is sensitive to whether the operator is surrounded by space or not. See the source code for some examples.

Notice that we currently support a limited set of math functions and operators. See SRTree for the current list. Please open an issue describing any other function that you want to be supported.

If you want to add support to other output formats. Please open an issue with a description of the format and a link to the official project of the format, if any.

Bug reports and feature requests are welcome.

License

© 2023-2023 Fabricio Olivetti de Franca (fabricio.olivetti@gmail.com). Released under the GPL, version 3 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.)