Question about a class member

John Gordon gordon at panix.com
Thu Jan 7 13:37:45 EST 2016


In <a199a9b7-784e-4e12-8030-4e3fffd636a7 at googlegroups.com> Robert <rxjwg98 at gmail.com> writes:

> I am using a download package. When I read its code, see below please, I 
> don't know what 'sample' is:

> ----------
> model = hmm.GaussianHMM(n_components=4, covariance_type="full")

> model.startprob_ = startprob
> model.transmat_ = transmat
> model.means_ = means
> model.covars_ = covars

> # Generate samples
> X, Z = model.sample(50)
> -------------

sample() is a method in the GaussianHMM class.  (In this case, it's
a method in the _BaseHMM class, from which GaussianHMM inherits.)

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list