I am working on sign language recognition on GitHub available here https://github.com/udacity/AIND-Recognize.
I have a problem on a rubric of Model selection. When I run this cell there
import warnings
from hmmlearn.hmm import GaussianHMM
def train_a_word(word, num_hidden_states, features):
warnings.filterwarnings("ignore", category=DeprecationWarning)
training = asl.build_training(features)
X, lengths = training.get_word_Xlengths(word)
model = GaussianHMM(n_components=num_hidden_states, n_iter=1000).fit(X, lengths)
logL = model.score(X, lengths)
return model, logL
demoword = 'BOOK'
model, logL = train_a_word(demoword, 3 , features=features_ground)
print("Number of states trained in model for {} is {}".format(demoword, model.n_components))
print("logL = {}".format(logL))
I have this error:
TypeError Traceback (most recent call last) in () 12 13 demoword = 'BOOK' ---> 14 model,
logL = train_a_word(demoword, 3 , features=features_ground) 15 print("Number of states
trained in model for {} is {}".format(demoword, model.n_components))
16 print("logL = {}".format(logL)) in train_a_word(word, num_hidden_states, features)
7 training = asl.build_training(features) 8 X, lengths = training.get_word_Xlengths(word)
----> 9 model = GaussianHMM(n_components=num_hidden_states, n_iter=1000).fit(X, lengths)
10 logL = model.score(X, lengths) 11 return model, logL
TypeError: fit() takes 2 positional arguments but 3 were given
And I can't figure it out and I want to mention that we were not supposed to modify this cell.