我正在使用Pomegranate library來實現HMM。我下面什麼文件說使用from_samples
函數說參數labels
之一應該是:石榴HMM標籤:具有多個元素的數組的真值是不明確的。
An array of state labels for each sequence. This is only used in ‘labeled’ training. If used this must be comprised of n lists where n is the number of sequences to train on, and each of those lists must have one label per observation. Default is None.
我的代碼是:
model = HiddenMarkovModel('Gestures').from_samples(
NormalDistribution, 3, training, labels=[0, 1, 2], algorithm='labeled')
我得到的錯誤:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
這是沒有意義,因爲我輸入數組,但我想它認爲我應該輸入布爾?