def test_simple(self): km = ClusterKMeans(self.user_ink_data,algorithm='dtw') clustered_data = km.clustered_data() cDTW = ClassifierDTW() cDTW.train(clustered_data, center_type='centroid') accuracy,_,_ = cDTW.test(self.label_ink_pairs) self.assertGreater(accuracy, 93.0)
def test_simple(self): km = ClusterKMeans(self.user_ink_data, min_cluster_size=10) clustered_data = km.clustered_data() chmm = ClassifierHMM() chmm.train(clustered_data) accuracy,_,_ = chmm.test(self.label_ink_pairs) self.assertGreater(accuracy, 94.0)
def test_optimize(self): km = ClusterKMeans(self.user_ink_data,algorithm='dtw') km.optimize_cluster_num(self.label_ink_pairs, verbose=False) clustered_data = km.clustered_data() cDTW = ClassifierDTW() cDTW.train(clustered_data, center_type='centroid') accuracy,_,_ = cDTW.test(self.label_ink_pairs) self.assertGreater(accuracy, 93.0)
def test_specific_target(self): km = ClusterKMeans(self.user_ink_data, target_user_id='user_1', min_cluster_size=10) clustered_data = km.clustered_data() chmm = ClassifierHMM() chmm.train(clustered_data) accuracy,_,_ = chmm.test(self.label_ink_pairs) self.assertGreater(accuracy, 95.0)
def test_optimize(self): km = ClusterKMeans(self.user_ink_data, min_cluster_size=10) km.optimize_cluster_num(self.label_ink_pairs, verbose=False) clustered_data = km.clustered_data() chmm = ClassifierHMM() chmm.train(clustered_data) accuracy,_,_ = chmm.test(self.label_ink_pairs) self.assertGreater(accuracy, 94.0)