예제 #1
0
파일: hmm.py 프로젝트: sdiao/CS134
	def test_hmm(self):
		pp = PreProcessor()
		pp.test_preprocess()
		instance_list = pp.get_instance_list()
		self.label_codebook=pp.get_label_codebook()
		self.feature_codebook=pp.get_feature_codebook()
		self.train(instance_list)
		print "\ntransition_count_table--------------------"
		print self.transition_count_table
		print "\ntransition_matrix-------------------------"
		print self.transition_matrix
		print "\ninitial_state_count_table------------------"
		print self.initial_state_count_table
		print "\ntermination_state_count_table------------------"
		print self.termination_state_count_table
		print "\nemission matrix----------------------------"
		print self.emission_matrix

		for i in range(10):
			self.test_classify_instance(instance_list[i])