1

我想生成符号样本,而不是来自hmm.MultinomialHMM.

我的代码例如:

model = hmm.MultinomialHMM(n_components=2)
tr =np.array([[0.8, 0.2],
              [0.3, 0.7]])

model.n_features = 4

em = np.array([[0.3,0.7,0.0,0.0],
               [0.0,0.0,0.1,0.9]])
model.transmat_ = tr
model.emissionprob_=em
model.startprob_ = np.array([0.5,0.5])

#generate sample
symb, hid = model.sample(10)

symb也是_

array([[1],
       [1],
       [3],
       [3],
       [3],
       [2],
       [3],
       [3],
       [1],
       [3]])

但我需要设置一个符号

4

0 回答 0