Skip to content

Wolfram Mathematica distributions parser for pomegranate

License

Notifications You must be signed in to change notification settings

d-lowl/pomegranate-mathematica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Wolfram Mathematica distributions parser for pomegranate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages