Пример #1
0
 def test_Anfis_Neural_Network(self):
     anfis = ANFIS(10e-4,5,False)
     anfis.dataset_prepare("trainingSet.txt",2)
     anfis.membership_pattern("gaussmf",[0. , 1.])
     error,converge = anfis.train("se",10e-3)
     print("\nerror cost is",error,"\nconverge value is",converge)
     self.assertEqual(error[-2] >= error[-1] or error[-2] - error[-1] < 0.0001, True)
Пример #2
0
 def test_ANFIS_train_converge_value(self):
     anfis = ANFIS(10e-4,5,True)
     anfis.dataset_prepare("trainingSet.txt",2)
     anfis.membership_pattern("gaussmf",[0. , 1.])
     with self.assertRaises(TypeError):
         anfis.train("se",1.5)
Пример #3
0
 def test_ANFIS_membership_pattern_param_el2(self):
     anfis = ANFIS(10.1,3,True)
     anfis.dataset_prepare("trainingSet.txt",2)
     with self.assertRaises(TypeError):
         anfis.membership_pattern("gaussmf",[0.,"1."])
Пример #4
0
 def test_ANFIS_train_error_type(self):
     anfis = ANFIS(10e-4,5,False)
     anfis.dataset_prepare("trainingSet.txt",2)
     anfis.membership_pattern("gaussmf",[0. , 1.])
     with self.assertRaises(TypeError):
         anfis.train(1)
Пример #5
0
 def test_ANFIS_membership_pattern_membership_value(self):
     anfis = ANFIS(10.1,3,True)
     anfis.dataset_prepare("trainingSet.txt",2)
     with self.assertRaises(TypeError):
         anfis.membership_pattern("sample",[0. , 1.])