ax.grid(True) figures.append(plt) for p in figures: p.show() visualize(my_testword, model) from my_model_selectors import SelectorConstant training = asl.build_training( features_ground ) # Experiment here with different feature sets defined in part 1 word = 'VEGETABLE' # Experiment here with different words model = SelectorConstant(training.get_all_sequences(), training.get_all_Xlengths(), word, n_constant=3).select() print("Number of states trained in model for {} is {}".format( word, model.n_components)) from sklearn.model_selection import KFold training = asl.build_training( features_ground) # Experiment here with different feature sets word = 'VEGETABLE' # Experiment here with different words word_sequences = training.get_word_sequences(word) split_method = KFold() for cv_train_idx, cv_test_idx in split_method.split(word_sequences): print("Train fold indices:{} Test fold indices:{}".format( cv_train_idx, cv_test_idx)) # view indices of the folds
def test_select_constant_interface(self): model = SelectorConstant(self.sequences, self.xlengths, 'BUY').select() self.assertGreaterEqual(model.n_components, 2) model = SelectorConstant(self.sequences, self.xlengths, 'BOOK').select() self.assertGreaterEqual(model.n_components, 2)