pandoc-symreg

A tool to convert symbolic regression expressions into different formats.

https://github.com/folivetti/pandoc-symreg#readme

Version on this page:0.2.0.0
LTS Haskell 21.25:0.2.0.0
Stackage Nightly 2023-06-21:0.2.0.0
Latest on Hackage:0.2.1.3

See all snapshots pandoc-symreg appears in

GPL-3.0-only licensed by Fabricio Olivetti de França
Maintained by [email protected]
This version can be pinned in stack with:pandoc-symreg-0.2.0.0@sha256:ba441b9f5b4eedfac5c393446ef614a54133b3fb50e39060ab37e4204ba5f8b9,2779

Module documentation for 0.2.0.0

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

github release hackage release stackage LTS package CI tests license

Conversion tool for Symbolic Regression tools

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)

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'])
                     (-t|--to ['python'|'math'|'tikz'|'latex']) 
                     [-i|--input INPUT] [-o|--output OUTPUT] 
                     [-v|--varnames VARNAMES] [-p|--parameters]

  Convert different symbolic expressions format to common formats.

Available options:
  -f,--from ['tir'|'hl'|'operon'|'bingo']
                           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.
  -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 ([email protected]). Released under the GPL, version 3 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.)

Changes

Changelog for pandoc-symreg

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to the Haskell Package Versioning Policy.

Unreleased

  • Simplification with Equality Saturation
  • Added CI tests

0.2.1.0 - 2023-04-30

  • Changed to srtree-1.0.0.1
  • Fixed not parsing white spaces between operators
  • Simplification disabled for now

0.1.1.0 - 2023-02-13

  • Added support to GP-GOMEA
  • Added support to PySR
  • Added -simplify flag to apply SRTree simplification

0.1.0.1 - 2023-01-13

Changed

  • Updated the bounds for base to work with stackage nightly

0.1.0.0 - 2023-01-13

Added

  • First release
  • Added support to TIR, HeuristicLab, Operon, and Bingo algorithms
  • Added support to python, math, TikZ, and laTeX outputs
  • Added support to replace numerical values with adjustable parameters variables