Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.11 KB

README.md

File metadata and controls

39 lines (27 loc) · 1.11 KB

pomegranate-mathematica

A small package to parse Wolfram Mathematica distributions and get pomegranate objects instead, so it is operable from python. For the reference on how to use distributions from pomegranate consult their documentation

Install with pip

pip install pomegranate-mathematica

Requirements

  • pomegranate (only tested for 0.11)
  • lark-parser

Usage

import pomegranate_mathematica as pmmath

pmmath.to_pomegranate("NormalDistribution[1.0, 2.5]")

Why?

I just had plenty of output from Wolfram Mathematica, and converting it manually to pomegranate was too tedious. So here we go.

What's available?

The list of Wolfram Mathematica distributions that are supported, and their pomegranate counterpart: (If the parser sees something that it can't recognize it throws an exception. GIGO.)

  • MixtureDistribution (GeneralMixtureModel in pomegranate)
  • NormalDistribution
  • LogNormalDistribution
  • UniformDistribution
  • BernoulliDistribution
  • ExponentialDistribution
  • PoissonDistribution
  • BetaDistribution
  • GammaDistribution