import anfis
import membership #import membershipfunction, mfDerivs
import numpy

ts = numpy.loadtxt("trainingSet.txt", usecols=[1,2,3])#numpy.loadtxt('c:\\Python_fiddling\\myProject\\MF\\trainingSet.txt',usecols=[1,2,3])
X = ts[:,0:2]
Y = ts[:,2]

mf = [[['gaussmf',{'mean':-11.,'sigma':5.}],['gaussmf',{'mean':-8.,'sigma':5.}],['gaussmf',{'mean':-14.,'sigma':20.}],['gaussmf',{'mean':-7.,'sigma':7.}]],
            [['gaussmf',{'mean':-10.,'sigma':20.}],['gaussmf',{'mean':-20.,'sigma':11.}],['gaussmf',{'mean':-9.,'sigma':30.}],['gaussmf',{'mean':-10.5,'sigma':5.}]]]


mfc = membership.membershipfunction.MemFuncs(mf)
anf = anfis.ANFIS(X, Y, mfc)
anf.trainHybridJangOffLine(epochs=10)
print round(anf.consequents[-1][0],6)
print round(anf.consequents[-2][0],6)
print round(anf.fittedValues[9][0],6)
if round(anf.consequents[-1][0],6) == -5.275538 and round(anf.consequents[-2][0],6) == -1.990703 and round(anf.fittedValues[9][0],6) == 0.002249:
	print 'test is good'
anf.plotErrors()
anf.plotResults()
@@ -272,11 +272,9 @@
 an':
--11
+0
 .,'s
@@ -271,33 +271,33 @@
 ean':0.,'sigma':
-5
+1
 .%7D%5D,%5B'gaussmf',%7B
@@ -304,17 +304,17 @@
 'mean':-
-8
+1
 .,'sigma
@@ -315,17 +315,17 @@
 'sigma':
-5
+2
 .%7D%5D,%5B'ga
@@ -340,17 +340,16 @@
 'mean':-
-1
 4.,'sigm
@@ -343,33 +343,33 @@
 an':-4.,'sigma':
-2
+1
 0.%7D%5D,%5B'gaussmf',
@@ -427,19 +427,17 @@
 %7B'mean':
--10
+1
 .,'sigma
@@ -439,17 +439,16 @@
 sigma':2
-0
 .%7D%5D,%5B'ga
@@ -466,11 +466,9 @@
 an':
--20
+2
 .,'s
@@ -477,10 +477,9 @@
 ma':
-11
+3
 .%7D%5D,
@@ -498,17 +498,17 @@
 'mean':-
-9
+2
 .,'sigma
@@ -509,17 +509,17 @@
 'sigma':
-3
+1
 0.%7D%5D,%5B'g
@@ -669,17 +669,17 @@
 (epochs=
-1
+2
 0)%0Aprint

Fix for Issue 3: altered membership function params to improve results