MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / main

Function main

hmm_class/hmm_classifier.py:88–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87
88def main():
89 X, Y, V = get_data()
90 print("len(X):", len(X))
91 print("Vocabulary size:", V)
92 X, Y = shuffle(X, Y)
93 N = 20 # number to test
94 Xtrain, Ytrain = X[:-N], Y[:-N]
95 Xtest, Ytest = X[-N:], Y[-N:]
96
97 model = HMMClassifier()
98 model.fit(Xtrain, Ytrain, V)
99 print("Score:", model.score(Xtest, Ytest))
100
101
102if __name__ == '__main__':

Callers 1

hmm_classifier.pyFile · 0.70

Calls 4

fitMethod · 0.95
scoreMethod · 0.95
HMMClassifierClass · 0.85
get_dataFunction · 0.70

Tested by

no test coverage detected