Beispiel #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)
Beispiel #2
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)
Beispiel #3
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)
Beispiel #4
0
 def test_ANFIS_constractor_learning_rate(self):
     with self.assertRaises(TypeError):
         ANFIS(10,3,False)
Beispiel #5
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."])
Beispiel #6
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.])
Beispiel #7
0
 def test_ANFIS_dataset_prepare_input_dim(self):
     anfis = ANFIS(10.1,3,True)
     with self.assertRaises(TypeError):
         anfis.dataset_prepare("trainingSet.txt",2.5)
Beispiel #8
0
 def test_ANFIS_dataset_prepare_path(self):
     anfis = ANFIS(10.1,3,True)
     with self.assertRaises(TypeError):
         anfis.dataset_prepare(5,2)
Beispiel #9
0
 def test_ANFIS_constractor_plot(self):
     with self.assertRaises(TypeError):
         ANFIS(10.1,3,"True")
Beispiel #10
0
 def test_ANFIS_constractor_epochs_value(self):
     with self.assertRaises(TypeError):
         ANFIS(10.1,1,False)