Python 3.5 PyMC - suppress the progress showing

1k views Asked by At

on pymc version '2.3.6' in Python 3.5

I am trying to suppress the progress update given when running the MCMC:

observation = pymc.Poisson('obs', lambda_, value= count_data, observed= True)
model = pymc.Model([observation, lambda_1, lambda_2, kappa])
mcmc = pymc.MCMC(model)
mcmc.sample(20000, 1000, 1)

Any idea how i could do this? Thanks!

2

There are 2 answers

0
altroware On BEST ANSWER

it seems that the value for verbose that does that is -1. I would use the following more explicit syntax:

mcmc.sample(iter=20000, lenght=1000, verbose=-1)

Alternatively:

mcmc.sample(iter=20000, lenght=1000, progress_bar=0)

Cheers,

A.

PS: you can look yourself in the source code of installation_directory/pymc/MCMC.py. The installation directory can be found using:

pymc.__file__
1
sascha On

According to the docs here, the sampler is called like that:

sample(iter, length, verbose, ...)

This would mean, that your are explicitly activating verbose with your 3rd argument:

mcmc.sample(20000, 1000, 1)  # Make the third argument a zero

Sadly i can't test it at the moment, but this should be a good first step (if i read the docs correctly).