How to compile a .pyx file of a package after making changes?

Viewed 20

I did some changes to a .pyx file of a python package called pomegranate, but now I don't know how to actually make my code run (after saving the changes and running the program my changes don't occur). I think that I need to compile the .pyx file or maybe the whole package? How to do this?

1 Answers

Instructions are given on the website.

Links to detailed instructions for each model are also given on the page. For example, for Probability Distributions, you can go here. Some code from this page are:

from pomegranate import *
a = NormalDistribution(5, 2)

b = NormalDistribution.from_samples([3, 4, 5, 6, 7])

b = NormalDistribution.from_samples([3, 4, 5, 6, 7], weights=[0.5, 1, 1.5, 1, 0.5])

>>> a = NormalDistribution(5, 2)
>>> a.log_probability(8)
-2.737085713764219
>>> a.probability(8)
0.064758797832971712
>>> b = NormalDistribution.from_samples([3, 4, 5, 6, 7], weights=[0.5, 1, 1.5, 1, 0.5])
>>> b.log_probability(8)
-4.437779569430167

d = NormalDistribution(5, 2)
d.fit([1, 5, 7, 3, 2, 4, 3, 5, 7, 8, 2, 4, 6, 7, 2, 4, 5, 1, 3, 2, 1])
d
{
    "frozen" :false,
    "class" :"Distribution",
    "parameters" :[
        3.9047619047619047,
        2.13596776114341
    ],
    "name" :"NormalDistribution"
}
Related